예제 #1
0
        /// <summary>
        /// 保存销售发货单
        /// </summary>
        /// <returns></returns>
        public static bool UpdateSellBack(Hashtable ht, SellBackModel sellBackModel, List<SellBackDetailModel> sellBackDetailModellList, out string strMsg)
        {
            bool isSucc = false;//是否添加成功
            strMsg = "";
            if (IsUpdate(sellBackModel.BackNo))
            {
                string strSql = "delete from officedba.SellBackDetail where  BackNo=@BackNo  and CompanyCD=@CompanyCD";
                SqlParameter[] paras = { new SqlParameter("@BackNo", sellBackModel.BackNo), new SqlParameter("@CompanyCD", sellBackModel.CompanyCD) };
                TransactionManager tran = new TransactionManager();
                tran.BeginTransaction();
                try
                {

                    UpdateSellBack(ht,sellBackModel, tran);
                    SqlHelper.ExecuteNonQuery(tran.Trans, CommandType.Text, strSql.ToString(), paras);
                    InsertSellBackDetail(sellBackDetailModellList, tran);
                    tran.Commit();
                    isSucc = true;
                    strMsg = "保存成功!";

                }
                catch (Exception ex)
                {
                    tran.Rollback();
                    strMsg = "保存失败,请联系系统管理员!";
                    throw ex;
                }
            }
            else
            {
                isSucc = false;
                strMsg = "非制单状态的未提交审批、审批未通过或撤销审批单据不可修改!";
            }
            return isSucc;
        }
예제 #2
0
 /// <summary>
 /// 保存销售发货单
 /// </summary>
 /// <returns></returns>
 public static bool SaveSellBack(Hashtable ht, SellBackModel sellBackModel, List<SellBackDetailModel> sellBackDetailModellList, out string strMsg)
 {
     bool isSucc = false;//是否添加成功
     TransactionManager tran = new TransactionManager();
     strMsg = "";
     //判断单据编号是否存在
     if (NoIsExist(sellBackModel.BackNo))
     {
         tran.BeginTransaction();
         try
         {
             InsertSellBack(ht,sellBackModel, tran);
             InsertSellBackDetail(sellBackDetailModellList, tran);
             tran.Commit();
             isSucc = true;
             strMsg = "保存成功!";
         }
         catch (Exception ex)
         {
             tran.Rollback();
             strMsg = "保存失败,请联系系统管理员!";
             throw ex;
         }
     }
     else
     {
         isSucc = false;
         strMsg = "该编号已被使用,请输入未使用的编号!";
     }
     return isSucc;
 }
예제 #3
0
        /// <summary>
        /// 保存销售发货单
        /// </summary>
        /// <returns></returns>
        public static bool UpdateSellBack(Hashtable ht, SellBackModel sellBackModel, List<SellBackDetailModel> sellBackDetailModellList, out string strMsg)
        {
            bool isSucc = false;//是否添加成功
            //定义变量
            string remark = string.Empty;
            strMsg = "";
            try
            {
                isSucc = SellBackDBHelper.UpdateSellBack(ht,sellBackModel, sellBackDetailModellList, out strMsg);
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            catch (Exception ex)
            {
                //输出日志
                SellLogCommon.WriteSystemLog(ex, LogInfo.LogType.SYSTEM, LogInfo.SystemLogKind.SYSTEM_ERROR, ConstUtil.MODULE_ID_SELLBACK_ADD);
                //设置操作成功标识 
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            SellLogCommon.InsertLog(sellBackModel.BackNo, ConstUtil.MODULE_ID_SELLBACK_ADD, ConstUtil.CODING_RULE_TABLE_SELLBACK, remark, ConstUtil.LOG_PROCESS_UPDATE);
            return isSucc;

        }
예제 #4
0
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        //设置行为参数
        string orderString = hiddExpOrder.Value.Trim();//排序
        string order = "desc";//排序:降序
        string orderBy = (!string.IsNullOrEmpty(orderString)) ? orderString.Substring(0, orderString.Length - 2) : "BackDate";//要排序的字段,如果为空,默认为"ID"
        if (orderString.EndsWith("_a"))
        {
            order = "asc";//排序:升序
        }
        int pageCount = int.Parse(hiddExpTotal.Value);//每页显示记录数
        int pageIndex = 1;//当前页     
        int TotalCount = 0;//总记录数
        string ord = orderBy + " " + order;//排序字段
        DataTable dt = new DataTable();

        string strorderNo = hiddExpOrderNo.Value.Trim();
        string strTitle = hiddExpTitle.Value.Trim();
        string strCustID = hiddExpCustID.Value.Trim();
        string strSeller = hiddExpSeller.Value.Trim();
        string strFromType = hiddExpFromType.Value.Trim();
        string strBillStatus = hiddExpBillStatus.Value.Trim();
        string strFlowStatus = hiddExpFlowStatus.Value.Trim();
        string strReason = hiddExpReasonType.Value.Trim();
        string strSttlDate1 = hiddExpOfferDate1.Value.Trim();
        string strSttlDate = hiddExpOfferDate.Value.Trim();
        string strProjectID = hiddProjectID.Value.Trim();

        string orderNo = strorderNo.Length == 0 ? null : strorderNo;
        string Title = strTitle.Length == 0 ? null : strTitle;
        int? CustID = strCustID.Length == 0 ? null : (int?)Convert.ToInt32(strCustID);
        int? Seller = strSeller.Length == 0 ? null : (int?)Convert.ToInt32(strSeller);
        string FromType = strFromType.Length == 0 ? null : strFromType;
        string BillStatus = strBillStatus.Length == 0 ? null : strBillStatus;
        DateTime? date = strSttlDate.Length == 0 ? null : (DateTime?)Convert.ToDateTime(strSttlDate);
        DateTime? date1 = strSttlDate1.Length == 0 ? null : (DateTime?)Convert.ToDateTime(strSttlDate1);
        int? FlowStatus = strFlowStatus.Length == 0 ? null : (int?)Convert.ToInt32(strFlowStatus);
        int? Reason = strReason.Length == 0 ? null : (int?)Convert.ToInt32(strReason);
        int? ProjectID = strProjectID.Length == 0 ? null : (int?)Convert.ToInt32(strProjectID);
        //扩展属性
        string EFIndex = Request.QueryString["EFIndex"];
        string EFDesc = Request.QueryString["EFDesc"];
        GetBillExAttrControl1.ExtIndex = EFIndex;
        GetBillExAttrControl1.ExtValue = EFDesc;
        GetBillExAttrControl1.SetExtControlValue();

        SellBackModel model = new SellBackModel();
        model.BillStatus = BillStatus;
        model.Seller = Seller;
        model.BackDate = date;

        model.FromType = FromType;
        model.BackNo = orderNo;
        model.CustID = CustID;
        model.Title = Title;
        model.ProjectID = ProjectID;
        dt = SellBackBus.GetOrderList(model, date1, Reason, FlowStatus,EFIndex,EFDesc, pageIndex, pageCount, ord, ref TotalCount);

        //导出标题
        string headerTitle = "单据编号|单据主题|源单类型|客户|业务员|退货日期|总金额|单据状态|审批状态";
        //string headerTitle = "建档日期|启用状态";
        string[] header = headerTitle.Split('|');

        //导出标题所对应的列字段名称
        string columnFiled = "BackNo|Title|FromTypeText|CustName|EmployeeName|BackDate|TotalPrice|BillStatusText|FlowInstanceText";
        //string columnFiled = "CreateDate|strUsedStatus";
        string[] field = columnFiled.Split('|');

        XBase.Common.OutputToExecl.ExportToTable(this.Page, dt, header, field, "销售退货单列表");
    }
예제 #5
0
 /// <summary>
 /// 获取单据列表 
 /// </summary>
 /// <param name="sellOfferModel">sellOfferModel表实体</param>
 /// <param name="FlowStatus">审批状态</param>
 /// <returns></returns>
 public static DataTable GetOrderList(SellBackModel sellBackModel, DateTime? dt, int? Reason, int? FlowStatus,string EFIndex,string EFDesc, int pageIndex, int pageCount, string ord, ref int TotalCount)
 {
     return SellBackDBHelper.GetOrderList(sellBackModel, dt, Reason, FlowStatus, EFIndex, EFDesc, pageIndex, pageCount, ord, ref TotalCount);
 }
예제 #6
0
        /// <summary>
        /// 取消确认单据
        /// </summary>
        /// <param name="OrderNO">单据编号</param>
        /// <param name="strMsg">操作返回的信息</param>
        /// <returns></returns>
        public static bool UnConfirmOrder(SellBackModel sellBackModel, out string strMsg)
        {
            string strElement = string.Empty;
            bool isSucc = false;//是否添加成功
            //定义变量
            string remark = string.Empty;

            //操作名称
            strElement = ConstUtil.LOG_PROCESS_UNCONFIRM;
            strMsg = "";

            try
            {
                isSucc = SellBackDBHelper.UnConfirmOrder(sellBackModel.BackNo, out strMsg);
                //取消确认成功后调用“自动生成凭证”方法
                if (isSucc == true)
                {
                    string str = "";
                    bool AutoVoucherInsertFlag = XBase.Business.Office.FinanceManager.AutoVoucherBus.AntiConfirmVoucher("officedba.sellback," + sellBackModel.ID, out str);
                    if (AutoVoucherInsertFlag == true)
                    {
                        //strMsg += str;
                    }
                    else
                    {
                        strMsg += str;
                    }

                }
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            catch (Exception ex)
            {
                //输出日志
                SellLogCommon.WriteSystemLog(ex, LogInfo.LogType.SYSTEM, LogInfo.SystemLogKind.SYSTEM_ERROR, ConstUtil.MODULE_ID_SELLBACK_ADD);
                //设置操作成功标识 
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            //写入日志
            SellLogCommon.InsertLog(sellBackModel.BackNo, ConstUtil.MODULE_ID_SELLBACK_ADD, ConstUtil.CODING_RULE_TABLE_SELLBACK, remark, strElement);

            return isSucc;
        }
예제 #7
0
        /// <summary>
        /// 确认单据
        /// </summary>
        /// <param name="OrderNO">单据编号</param>
        /// <param name="strMsg">操作返回的信息</param>
        /// <returns></returns>
        public static bool ConfirmOrder(SellBackModel sellBackModel, out string strMsg, out string strFieldText)
        {
            string strElement = string.Empty;
            bool isSucc = false;//是否添加成功
            //定义变量
            string remark = string.Empty;

            //操作名称
            strElement = ConstUtil.LOG_PROCESS_CONFIRM;
            strFieldText = "";
            strMsg = "";

            try
            {
                isSucc = SellBackDBHelper.ConfirmOrder(sellBackModel.BackNo, out strMsg, out strFieldText);
                //确认成功后调用“自动生成凭证”方法
                if (isSucc == true)
                {
                    string str = "";
                    bool AutoVoucherInsertFlag = XBase.Business.Office.FinanceManager.AutoVoucherBus.AutoVoucherInsert(4, Convert.ToDecimal(sellBackModel.TotalFee), "officedba.sellback," + sellBackModel.ID, sellBackModel.CurrencyType + "," + sellBackModel.Rate, Convert.ToInt32(sellBackModel.CustID), out str);
                    //returnValue=0 业务单未设凭证模板,returnValue=1 企业不启用业务单自动生成凭证,returnValue = 2 企业不启用自动生成凭证自动登帐, returnValue = 3 自动生成凭证失败 ,returnValue = "4" 回写业务单登记凭证状态成功,returnValue = "5" 回写业务单登记凭证状态失败
                    if (AutoVoucherInsertFlag == true)
                    {
                        strMsg += str;
                    }
                    else
                    {
                        strMsg += str;
                    }

                }
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            catch (Exception ex)
            {
                //输出日志
                SellLogCommon.WriteSystemLog(ex, LogInfo.LogType.SYSTEM, LogInfo.SystemLogKind.SYSTEM_ERROR, ConstUtil.MODULE_ID_SELLBACK_ADD);
                //设置操作成功标识 
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            //写入日志
            SellLogCommon.InsertLog(sellBackModel.BackNo, ConstUtil.MODULE_ID_SELLBACK_ADD, ConstUtil.CODING_RULE_TABLE_SELLBACK, remark, strElement);

            return isSucc;
        }
예제 #8
0
        /// <summary>
        /// 获取退货单列表 
        /// </summary>
        /// <param name="sellContractModel">sellContractModel表实体</param>
        /// <param name="FlowStatus">审批状态</param>
        /// <returns></returns>
        public static DataTable GetOrderList(SellBackModel sellBackModel, DateTime? dt, int? Reason, int? FlowStatus,string EFIndex,string EFDesc, int pageIndex, int pageCount, string ord, ref int TotalCount)
        {
            string strSql = string.Empty;
            strSql = "select * from (SELECT s.ID, s.BackNo, s.Title,s.ModifiedDate, CONVERT(varchar(100), s.BackDate, 23) AS BackDate, s.TotalPrice, c.CustName, e.EmployeeName, ";
            strSql += "CASE s.FromType WHEN 0 THEN '无来源' WHEN 1 THEN '销售发货单' END AS FromTypeText, ";
            strSql += "CASE s.BillStatus WHEN 1 THEN '制单' WHEN 2 THEN '执行' WHEN 3 THEN '变更' WHEN 4 THEN ";
            strSql += "'手工结单' WHEN 5 THEN '自动结单' END AS BillStatusText, CASE WHEN (SELECT TOP 1 FlowStatus ";
            strSql += "FROM officedba.FlowInstance WHERE BillID = s.ID AND BillTypeFlag = 5 AND BillTypeCode = 5 ";
            strSql += "ORDER BY ModifiedDate DESC) IS NULL THEN '' WHEN (SELECT TOP 1 FlowStatus ";
            strSql += "FROM officedba.FlowInstance WHERE BillID = s.ID AND BillTypeFlag = 5 AND BillTypeCode = 5 ";
            strSql += "ORDER BY ModifiedDate DESC) = 1 THEN '待审批' WHEN (SELECT TOP 1 FlowStatus ";
            strSql += "FROM officedba.FlowInstance WHERE BillID = s.ID AND BillTypeFlag = 5 AND BillTypeCode = 5 ";
            strSql += "ORDER BY ModifiedDate DESC) = 2 THEN '审批中' WHEN (SELECT TOP 1 FlowStatus ";
            strSql += "FROM officedba.FlowInstance WHERE BillID = s.ID AND BillTypeFlag = 5 AND BillTypeCode = 5 ";
            strSql += "ORDER BY ModifiedDate DESC) = 3 THEN '审批通过' WHEN (SELECT TOP 1 FlowStatus ";
            strSql += "FROM officedba.FlowInstance WHERE BillID = s.ID AND BillTypeFlag = 5 AND BillTypeCode = 5 ";
            strSql += "ORDER BY ModifiedDate DESC) = 4 THEN '审批不通过' WHEN (SELECT TOP 1 FlowStatus ";
            strSql += "FROM officedba.FlowInstance WHERE BillID = s.ID AND BillTypeFlag = 5 AND BillTypeCode = 5 ";
            strSql += "ORDER BY ModifiedDate DESC) = 5 THEN '撤销审批' END AS FlowInstanceText, isnull(CASE ";
            strSql += "((SELECT count(1) FROM officedba.StorageInOther AS soo ";
            strSql += "WHERE soo.FromType = '1' AND soo.FromBillID = s.ID)+ ";
            strSql += "(SELECT count(1)                                                          ";
            strSql += "FROM officedba.BlendingDetails                                                    ";
            strSql += "WHERE BillingType = '3' AND BillCD = s.BackNo and CompanyCD=s.CompanyCD) ";
            strSql += " ) WHEN 0 THEN '无引用' END, '被引用') AS RefText, ";
            strSql += "(SELECT TOP 1 FlowStatus FROM officedba.FlowInstance ";
            strSql += "WHERE BillID = s.ID AND BillTypeFlag = 5 AND BillTypeCode = 5 ";
            strSql += "ORDER BY ModifiedDate DESC) AS FlowStatus ";
            strSql += "FROM officedba.SellBack AS s LEFT JOIN ";
            strSql += "officedba.CustInfo AS c ON s.CustID = c.ID LEFT JOIN ";
            strSql += "officedba.EmployeeInfo AS e ON s.Seller = e.ID  where 1=1 and s.CompanyCD=@CompanyCD";
            string strCompanyCD = string.Empty;//单位编号
            strCompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            ArrayList arr = new ArrayList();
            arr.Add(new SqlParameter("@CompanyCD", strCompanyCD));

            //扩展属性
            if (!string.IsNullOrEmpty(EFIndex) && !string.IsNullOrEmpty(EFDesc))
            {
                strSql += " and s.ExtField" + EFIndex + " like @EFDesc ";
                arr.Add(new SqlParameter("@EFDesc", "%" + EFDesc + "%"));
            }
            if (sellBackModel.ProjectID != null)
            {
                strSql += " and s.ProjectID=@ProjectID ";
                arr.Add(new SqlParameter("@ProjectID", sellBackModel.ProjectID));
            }
            if (sellBackModel.BillStatus != null)
            {
                strSql += " and s.BillStatus= @BillStatus";
                arr.Add(new SqlParameter("@BillStatus", sellBackModel.BillStatus));
            }

            if (sellBackModel.FromType != null)
            {
                strSql += " and s.FromType=@FromType";
                arr.Add(new SqlParameter("@FromType", sellBackModel.FromType));
            }

            if (sellBackModel.BackNo != null)
            {
                strSql += " and s.BackNo like @BackNo";
                arr.Add(new SqlParameter("@BackNo", "%" + sellBackModel.BackNo + "%"));
            }
            if (Reason != null)
            {
                strSql += " and s.BackNo in (select BackNo from officedba.SellBackDetail where CompanyCD=s.CompanyCD and Reason=@Reason) ";
                arr.Add(new SqlParameter("@Reason", Reason));
            }
            if (sellBackModel.BackDate != null)
            {
                strSql += " and s.BackDate >= @BackDate";
                arr.Add(new SqlParameter("@BackDate", sellBackModel.BackDate));
            }
            if (dt != null)
            {
                strSql += " and s.BackDate <= @BackDate1";
                arr.Add(new SqlParameter("@BackDate1", dt));
            }
            if (sellBackModel.CustID != null)
            {
                strSql += " and s.CustID=@CustID";
                arr.Add(new SqlParameter("@CustID", sellBackModel.CustID));
            }
            if (sellBackModel.Title != null)
            {
                strSql += " and s.Title like @Title";
                arr.Add(new SqlParameter("@Title", "%" + sellBackModel.Title + "%"));
            }
            if (sellBackModel.Seller != null)
            {
                strSql += " and s.Seller=@Seller";
                arr.Add(new SqlParameter("@Seller", sellBackModel.Seller));
            }
            strSql += " ) as f  where 1=1 ";
            if (FlowStatus != null)
            {
                if (FlowStatus != 0)
                {
                    strSql += " and f.FlowStatus=@FlowStatus";
                    arr.Add(new SqlParameter("@FlowStatus", FlowStatus));
                }
                else
                {
                    strSql += " and f.FlowStatus is null ";
                }

            }

            return SqlHelper.CreateSqlByPageExcuteSqlArr(strSql.ToString(), pageIndex, pageCount, ord, arr, ref TotalCount);
        }
예제 #9
0
        /// <summary>
        /// 为主表插入数据
        /// </summary>
        /// <param name="sellBackModel"></param>
        /// <param name="tran"></param>
        private static void InsertSellBack(Hashtable htExtAttr, SellBackModel sellBackModel, TransactionManager tran)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into officedba.SellBack(");
            strSql.Append("CompanyCD,BackNo,CustID,FromType,FromBillID,CustTel,Title,BackDate,Seller,SellDeptId,CarryType,SendAddress,ReceiveAddress,PayType,MoneyType,CurrencyType,Rate,isAddTax,TotalPrice,Tax,TotalFee,Discount,DiscountTotal,RealTotal,CountTotal,NotPayTotal,BackTotal,Remark,BillStatus,Creator,CreateDate,Confirmor,ConfirmDate,Closer,CloseDate,ModifiedDate,ModifiedUserID,BusiType,ProjectID)");
            strSql.Append(" values (");
            strSql.Append("@CompanyCD,@BackNo,@CustID,@FromType,@FromBillID,@CustTel,@Title,@BackDate,@Seller,@SellDeptId,@CarryType,@SendAddress,@ReceiveAddress,@PayType,@MoneyType,@CurrencyType,@Rate,@isAddTax,@TotalPrice,@Tax,@TotalFee,@Discount,@DiscountTotal,@RealTotal,@CountTotal,@NotPayTotal,@BackTotal,@Remark,@BillStatus,@Creator,getdate(),@Confirmor,@ConfirmDate,@Closer,@CloseDate,getdate(),@ModifiedUserID,@BusiType,@ProjectID)");

            SqlParameter[] param = null;
            ArrayList lcmd = new ArrayList();
            #region 参数
            lcmd.Add(SqlHelper.GetParameterFromString("@CompanyCD", sellBackModel.CompanyCD));
            lcmd.Add(SqlHelper.GetParameterFromString("@CustID", sellBackModel.CustID.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@CustTel", sellBackModel.CustTel));
            lcmd.Add(SqlHelper.GetParameterFromString("@BackNo", sellBackModel.BackNo));
            lcmd.Add(SqlHelper.GetParameterFromString("@Title", sellBackModel.Title));
            lcmd.Add(SqlHelper.GetParameterFromString("@FromType", sellBackModel.FromType));
            lcmd.Add(SqlHelper.GetParameterFromString("@FromBillID", sellBackModel.FromBillID.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@BackDate", sellBackModel.BackDate.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@Seller", sellBackModel.Seller.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@SellDeptId", sellBackModel.SellDeptId.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@SendAddress", sellBackModel.SendAddress));
            lcmd.Add(SqlHelper.GetParameterFromString("@ReceiveAddress", sellBackModel.ReceiveAddress));
            lcmd.Add(SqlHelper.GetParameterFromString("@CarryType", sellBackModel.CarryType.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@PayType", sellBackModel.PayType.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@MoneyType", sellBackModel.MoneyType.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@CurrencyType", sellBackModel.CurrencyType.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@Rate", sellBackModel.Rate.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@TotalPrice", sellBackModel.TotalPrice.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@isAddTax", sellBackModel.isAddTax.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@Tax", sellBackModel.Tax.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@TotalFee", sellBackModel.TotalFee.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@Discount", sellBackModel.Discount.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@DiscountTotal", sellBackModel.DiscountTotal.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@RealTotal", sellBackModel.RealTotal.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@CountTotal", sellBackModel.CountTotal.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@NotPayTotal", sellBackModel.NotPayTotal.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@BackTotal", sellBackModel.BackTotal.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@Remark", sellBackModel.Remark));
            lcmd.Add(SqlHelper.GetParameterFromString("@BillStatus", sellBackModel.BillStatus));
            lcmd.Add(SqlHelper.GetParameterFromString("@Creator", sellBackModel.Creator.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@Confirmor", sellBackModel.Confirmor.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@ConfirmDate", sellBackModel.ConfirmDate.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@Closer", sellBackModel.Closer.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@CloseDate", sellBackModel.CloseDate.ToString()));
            lcmd.Add(SqlHelper.GetParameterFromString("@ModifiedUserID", sellBackModel.ModifiedUserID));
            lcmd.Add(SqlHelper.GetParameterFromString("@BusiType", sellBackModel.BusiType));
            lcmd.Add(SqlHelper.GetParameterFromString("@ProjectID", sellBackModel.ProjectID.ToString()));
            #endregion

            #region 拓展属性

            if (htExtAttr != null && htExtAttr.Count != 0)
            {
                strSql.Append(" ;UPDATE officedba.SellBack set ");
                foreach (DictionaryEntry de in htExtAttr)// fileht为一个Hashtable实例
                {
                    strSql.Append(de.Key.ToString().Trim() + "=@" + de.Key.ToString().Trim() + ",");
                    lcmd.Add(SqlHelper.GetParameterFromString("@" + de.Key.ToString().Trim(), de.Value.ToString().Trim()));
                }
                strSql.Append(" BillStatus=@BillStatus  where CompanyCD=@CompanyCD and BackNo=@BackNo ");
            }
            if (lcmd != null && lcmd.Count > 0)
            {
                param = new SqlParameter[lcmd.Count];
                for (int i = 0; i < lcmd.Count; i++)
                {
                    param[i] = (SqlParameter)lcmd[i];
                }
            }
            #endregion

            foreach (SqlParameter para in param)
            {
                if (para.Value == null)
                {
                    para.Value = DBNull.Value;
                }
            }
            SqlHelper.ExecuteNonQuery(tran.Trans, CommandType.Text, strSql.ToString(), param);
        }