quotationdal.cs

来自「为了便于企业对客户按照地区进行统计查询分析」· CS 代码 · 共 106 行

CS
106
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Model;

namespace DataAccess.DAL
{
    public class QuotationDAL
    {
        DataAccess.Comm.Comm c = new DataAccess.Comm.Comm();

        /// <summary>
        /// 新增报价单主表信息
        /// </summary>
        /// <param name="quotation"></param>
        public void InsertQuotationMain(XS_QuotationMain quotation)
        {
            SqlParameter[] param = {
                    new SqlParameter("@QuotationCode",SqlDbType.VarChar,20), 
                    new SqlParameter("@QuotationDate",SqlDbType.DateTime),
                    new SqlParameter("@CusCode",SqlDbType.VarChar,20),
                    new SqlParameter("@ConsignAddress",SqlDbType.VarChar,20),
                    new SqlParameter("@DeptCode",SqlDbType.VarChar,20),
                    new SqlParameter("@PersonCode",SqlDbType.VarChar,20),
                    new SqlParameter("@TransferWayCode",SqlDbType.VarChar,20),
                    new SqlParameter("@PayCode",SqlDbType.VarChar,20),
                    new SqlParameter("@ExchRate",SqlDbType.Float),
                    new SqlParameter("@ContactPerson",SqlDbType.VarChar,20),
                    new SqlParameter("@ContactType",SqlDbType.Bit),
                    new SqlParameter("@Remark",SqlDbType.VarChar,100)
                      };
            param[0].Value = quotation.QuotationCode;
            param[1].Value = quotation.QuotationDate;
            param[2].Value = quotation.CusCode;
            param[3].Value = quotation.ConsignAddress;
            param[4].Value = quotation.DeptCode;
            param[5].Value = quotation.PersonCode;
            param[6].Value = quotation.TransferWayCode;
            param[7].Value = quotation.PayCode;
            param[8].Value = quotation.ExchRate;
            param[9].Value = quotation.ContactPerson;
            param[10].Value = quotation.ContactType;
            param[11].Value = quotation.Remark;
            c.Excute("InsertQuotationMain", param);
        }

        /// <summary>
        /// 新增报价单子表信息
        /// </summary>
        /// <param name="quotation"></param>
        public void InsertQuotationSub(XS_QuotationSub quotation)
        {
            SqlParameter[] param ={
                    new SqlParameter("@WareCode",SqlDbType.VarChar,20),
                    new SqlParameter("@Quantity",SqlDbType.Decimal),
                    new SqlParameter("@TaxRate",SqlDbType.Decimal),
                    new SqlParameter("@CapitalUnitPrice",SqlDbType.Decimal),
                    new SqlParameter("@CapitalMoney",SqlDbType.Float),
                    new SqlParameter("@CapitalTax",SqlDbType.Float),
                    new SqlParameter("@CapitalWholeMoney",SqlDbType.Float),
                    new SqlParameter("@ConsultCost",SqlDbType.Float),
                    new SqlParameter("@Remark",SqlDbType.VarChar,100),
                     };
            param[0].Value = quotation.WareCode;
            param[1].Value = quotation.Quantity;
            param[2].Value = quotation.TaxRate;
            param[3].Value = quotation.CapitalUnitPrice;
            param[4].Value = quotation.CapitalMoney;
            param[5].Value = quotation.CapitalTax;
            param[6].Value = quotation.CaptitalWholeMoney;
            param[7].Value = quotation.ConsultCost;
            param[8].Value = quotation.Remark;
            c.Excute("InsertQuotationSub", param);
        }

        /// <summary>
        /// 修改报价单主表信息
        /// </summary>
        /// <param name="quotation"></param>
        public void UpdateQuotation(XS_QuotationMain quotation)
        {
            SqlParameter[] param = {
                    new SqlParameter("@CusCode",SqlDbType.VarChar,20),
                    new SqlParameter("@DeptCode",SqlDbType.VarChar,20),
                    new SqlParameter("@PersonCode",SqlDbType.VarChar,20),
                    new SqlParameter("@ContactPerson",SqlDbType.VarChar,20),
                    new SqlParameter("@ContactType",SqlDbType.VarChar,20),
                    new SqlParameter("@Checker",SqlDbType.VarChar,20),
                    };
            param[0].Value = quotation.CusCode;
            param[1].Value = quotation.DeptCode;
            param[2].Value = quotation.PersonCode;
            param[3].Value = quotation.ContactPerson;
            param[4].Value = quotation.ContactType;
            param[5].Value = quotation.Checker;
            c.Excute("UpdateQuotationMain", param);
        }

        public void UpdateQuotation(XS_QuotationSub quotation)
        { 
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?