Ejemplo n.º 1
0
        /// <summary>
        ///     提交编辑
        /// </summary>
        private bool SubmintEdit()
        {
            if (StockOut != null)
            {
                ModifiedGrid();

                StockOut.FCompanyId = CurrentUser.AccountComId;

                StockOut.FMemo = txtFMemo.Text.Trim();
                StockOut.FDate = txtFDate.SelectedDate;

                var parms = new Dictionary <string, object>();
                parms.Clear();

                parms.Add("@keyID", StockOut.KeyId);
                parms.Add("@companyId", CurrentUser.AccountComId);
                var amt =
                    Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);
                StockOut.FDistributionPoint = ddlFDistributionPoint.SelectedValue;
                StockOut.FAmount            = amt;
                StockOut.FDate    = txtFDate.SelectedDate;
                StockOut.CreateBy = CurrentUser.AccountName;


                return(StockOutService.SaveChanges() >= 0);
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     提交编辑
        /// </summary>
        private bool SubmintEdit()
        {
            if (StockOut != null)
            {
                ModifiedGrid();

                StockOut.FCode = txtFCode.Text;
                StockOut.FName = tbxFCustomer.Text;
                //------------------------------------------------------

                StockOut.FAddress   = txtFAddress.Text.Trim();
                StockOut.FCompanyId = CurrentUser.AccountComId;

                StockOut.FShipper    = !ddlFShipper.SelectedValue.Equals("-1") ? ddlFShipper.SelectedText : "";
                StockOut.FVehicleNum = !ddlFVehicleNum.SelectedValue.Equals("-1") ? ddlFVehicleNum.SelectedText : "";

                //StockOut.FFlag = 1;

                //StockOut.FFreight = Convert.ToDecimal(txtFFreight.Text.Trim());
                StockOut.FLinkman = txtFLinkman.Text.Trim();
                StockOut.FMemo    = txtFMemo.Text.Trim();
                StockOut.FPhone   = txtFPhone.Text.Trim();

                //var parms = new Dictionary<string, object>();
                //parms.Clear();

                //parms.Add("@keyID", StockOut.KeyId);
                //parms.Add("@companyId", CurrentUser.ToString());

                //var amt =
                //    Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);

                StockOut.FAmount            = 0;
                StockOut.FDistributionPoint = ddlFDistributionPoint.SelectedValue;


                StockOut.FSalesman       = ddlFSalesman.SelectedValue;
                StockOut.FArea           = ddlFArea.SelectedValue;
                StockOut.FAmt            = 0;// Convert.ToDecimal(txtFAmt.Text.Trim());
                StockOut.FReconciliation = txtFReconciliation.Text;

                StockOut.FDeliveryMethod  = ddlDeliveryMethod.SelectedValue;
                StockOut.FLogisticsNumber = txtFLogisticsNumber.Text;

                StockOut.FSupercargo = GasHelper.GetDropDownListArrayString(ddlFSupercargo.SelectedItemArray);
                StockOut.FDriver     = GasHelper.GetDropDownListArrayString(ddlFDriver.SelectedItemArray);

                StockOut.FCate    = hfdCate.Text;
                StockOut.FDate    = txtFDate.SelectedDate;
                StockOut.CreateBy = CurrentUser.AccountName;

                return(StockOutService.SaveChanges() >= 0);
            }
            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     提交添加
        /// </summary>
        private bool SubmintAdd()
        {
            var stock = StockOutService.Where(p => p.KeyId == txtKeyId.Text.Trim() && p.FCompanyId == CurrentUser.AccountComId).FirstOrDefault();

            if (stock != null)
            {
                ModifiedGrid();
                /////////////////////////////////////////////////////////////////////////////
                stock.FCode = txtFCode.Text;
                stock.FName = tbxFCustomer.Text;
                //--------------------------------------------------

                stock.FAddress    = txtFAddress.Text.Trim();
                stock.FFlag       = 1;
                stock.FDeleteFlag = 0;
                stock.FFreight    = Convert.ToDecimal(txtFFreight.Text.Trim());
                stock.FLinkman    = txtFLinkman.Text.Trim();
                stock.FMemo       = txtFMemo.Text.Trim();
                stock.FPhone      = txtFPhone.Text.Trim();

                stock.FShipper    = !ddlFShipper.SelectedValue.Equals("-1") ? ddlFShipper.SelectedText : "";
                stock.FVehicleNum = !ddlFVehicleNum.SelectedValue.Equals("-1") ? ddlFVehicleNum.SelectedText : "";

                stock.FOutFlag = "未出库";
                //var parms = new Dictionary<string, object>();
                //parms.Clear();

                //parms.Add("@keyID", stock.KeyId);
                //parms.Add("@companyId", CurrentUser.AccountComId);

                //var amt =
                //    Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);

                stock.FAmount = 0;


                //stock.f

                stock.FDate     = txtFDate.SelectedDate;
                stock.FSalesman = ddlFSalesman.SelectedValue;
                stock.FArea     = ddlFArea.SelectedValue;
                stock.FAmt      = 0;// string.IsNullOrEmpty(txtFAmt.Text.Trim()) ? 0 : Convert.ToDecimal(txtFAmt.Text.Trim());
                //stock.FDiscountAmount = string.IsNullOrEmpty(txtFDiscountAmount.Text.Trim()) ? 0 : Convert.ToDecimal(txtFDiscountAmount.Text.Trim());
                stock.FReconciliation  = txtFReconciliation.Text;
                stock.FDeliveryMethod  = ddlDeliveryMethod.SelectedValue;
                stock.FLogisticsNumber = ddlFCate.SelectedValue;//txtFLogisticsNumber.Text;

                stock.FSupercargo        = GasHelper.GetDropDownListArrayString(ddlFSupercargo.SelectedItemArray);
                stock.FDriver            = GasHelper.GetDropDownListArrayString(ddlFDriver.SelectedItemArray);
                stock.FDistributionPoint = ddlFDistributionPoint.SelectedValue;
                //stock.FSubjectCode = ddlSubject.SelectedValue;
                //stock.FSubjectName = ddlSubject.SelectedText;
                stock.FSKNum = "";

                stock.FAuditFlag = 1;

                StockOutService.SaveChanges();


                if (txtKeyId.Text.Contains("TM"))
                {
                    //单据号问题
                    string newKeyId   = SequenceService.CreateSequence(Convert.ToDateTime(txtFDate.SelectedDate), "PI", CurrentUser.AccountComId);
                    var    orderParms = new Dictionary <string, object>();
                    orderParms.Clear();
                    orderParms.Add("@oldKeyId", txtKeyId.Text);
                    orderParms.Add("@newKeyId", newKeyId);
                    orderParms.Add("@Bill", "45");
                    orderParms.Add("@companyId", CurrentUser.AccountComId);

                    SqlService.ExecuteProcedureCommand("proc_num", orderParms);
                    txtKeyId.Text = newKeyId;

                    ////新增日志
                    //var billStatus = new LHBillStatus
                    //{
                    //    KeyId = newKeyId,
                    //    FCompanyId = CurrentUser.AccountComId,
                    //    FActionName = "新增",
                    //    FDate = DateTime.Now,
                    //    FDeptId = CurrentUser.AccountOrgId,
                    //    FOperator = CurrentUser.AccountName,
                    //    FMemo = String.Format("单据号{0},{1}新增出门证据。", newKeyId, CurrentUser.AccountName)
                    //};

                    //GasHelper.AddBillStatus(billStatus);

                    //var bottles = new Dictionary<string, object>();
                    //bottles.Clear();

                    //bottles.Add("@SalesKeyId", newKeyId);
                    //bottles.Add("@companyid", CurrentUser.AccountComId);
                    //bottles.Add("@date", Convert.ToDateTime(stock.FDate).ToString("yyyy-MM-dd"));

                    //SqlService.ExecuteProcedureCommand("proc_SalesReturnBottle", bottles);


                    //收款部分
                    //var parmsAuto = new Dictionary<string, object>();
                    //parmsAuto.Clear();

                    //parmsAuto.Add("@KeyId", newKeyId);
                    //parmsAuto.Add("@companyId", CurrentUser.AccountComId);
                    //parmsAuto.Add("@FCate", "客户");
                    //parmsAuto.Add("@date", Convert.ToDateTime(stock.FDate).ToString("yyyy-MM-dd"));
                    //parmsAuto.Add("@FSKNum", stock.FSKNum);

                    //SqlService.ExecuteProcedureCommand("proc_SKOrderAuto", parmsAuto);
                }


                if (!string.IsNullOrEmpty(hfdImage.Text))
                {
                    var attachment = new LHAttachment();
                    attachment.FCompanyId = CurrentUser.AccountComId;
                    attachment.FPath      = hfdImage.Text;
                    attachment.KeyId      = txtKeyId.Text;

                    AttachmentService.Add(attachment);
                }


                return(true);
            }

            return(false);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     提交编辑
        /// </summary>
        private bool SubmintEdit()
        {
            if (StockOut != null)
            {
                ModifiedGrid();
                /////////////////////////////////////////////////////////////////////////////

                StockOut.FCode = txtFCode.Text;
                StockOut.FName = tbxFCustomer.Text;
                //------------------------------------------------------
                StockOut.FAddress = txtFAddress.Text.Trim();

                StockOut.FDate = txtFDate.SelectedDate;

                StockOut.FShipper    = !ddlFShipper.SelectedValue.Equals("-1") ? ddlFShipper.SelectedText : "";
                StockOut.FVehicleNum = !ddlFVehicleNum.SelectedValue.Equals("-1") ? ddlFVehicleNum.SelectedText : "";

                StockOut.FFreight = Convert.ToDecimal(txtFFreight.Text.Trim());
                StockOut.FLinkman = txtFLinkman.Text.Trim();
                StockOut.FMemo    = txtFMemo.Text.Trim();
                StockOut.FPhone   = txtFPhone.Text.Trim();

                //var parms = new Dictionary<string, object>();
                //parms.Clear();

                //parms.Add("@keyID", StockOut.KeyId);
                //parms.Add("@companyId", CurrentUser.AccountComId);

                //var amt =
                //   Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);

                StockOut.FAmount = 0;

                StockOut.FSalesman = ddlFSalesman.SelectedValue;
                StockOut.FArea     = ddlFArea.SelectedValue;
                StockOut.FAmt      = 0;// string.IsNullOrEmpty(txtFAmt.Text.Trim()) ? 0 : Convert.ToDecimal(txtFAmt.Text.Trim());//
                //StockOut.FDiscountAmount = string.IsNullOrEmpty(txtFDiscountAmount.Text.Trim()) ? 0 : Convert.ToDecimal(txtFDiscountAmount.Text.Trim());
                StockOut.FReconciliation = txtFReconciliation.Text;
                StockOut.FDeliveryMethod = ddlDeliveryMethod.SelectedValue;

                StockOut.FLogisticsNumber = ddlFCate.SelectedValue;;

                StockOut.FSupercargo = GasHelper.GetDropDownListArrayString(ddlFSupercargo.SelectedItemArray);
                StockOut.FDriver     = GasHelper.GetDropDownListArrayString(ddlFDriver.SelectedItemArray);
                //StockOut.FSubjectCode = ddlSubject.SelectedValue;
                //StockOut.FSubjectName = ddlSubject.SelectedText;

                StockOut.CreateBy           = CurrentUser.AccountName;
                StockOut.FDistributionPoint = ddlFDistributionPoint.SelectedValue;
                StockOut.FStatus            = 10;
                StockOut.FAuditFlag         = 1;

                StockOutService.SaveChanges();


                //var bottles = new Dictionary<string, object>();
                //bottles.Clear();

                //bottles.Add("@SalesKeyId", StockOut.KeyId);
                //bottles.Add("@companyid", CurrentUser.AccountComId);
                //bottles.Add("@date", Convert.ToDateTime(StockOut.FDate).ToString("yyyy-MM-dd"));

                //SqlService.ExecuteProcedureCommand("proc_SalesReturnBottle", bottles);

                ////收款部分
                //var parmsAuto = new Dictionary<string, object>();
                //parmsAuto.Clear();

                //parmsAuto.Add("@KeyId", StockOut.KeyId);
                //parmsAuto.Add("@companyId", CurrentUser.AccountComId);
                //parmsAuto.Add("@FCate", "客户");
                //parmsAuto.Add("@date", Convert.ToDateTime(StockOut.FDate).ToShortDateString());
                //parmsAuto.Add("@FSKNum", string.IsNullOrEmpty(StockOut.FSKNum) ? "" : StockOut.FSKNum);

                //SqlService.ExecuteProcedureCommand("proc_SKOrderAuto", parmsAuto);

                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     提交添加
        /// </summary>
        private bool SubmintAdd()
        {
            var stock = StockOutService.Where(p => p.KeyId == txtKeyId.Text.Trim() && p.FCompanyId == CurrentUser.AccountComId).FirstOrDefault();


            if (stock != null)
            {
                ModifiedGrid();

                stock.FOrgId   = int.Parse(ddlOrgnization.SelectedValue);
                stock.FOrgName = ddlOrgnization.SelectedText;
                stock.FCode    = ddlOrgnization.SelectedValue;
                stock.FName    = ddlOrgnization.SelectedText.Trim();
                //--------------------------------------------------
                stock.FAuditFlag = 0;
                //stock.FAddress = txtFAddress.Text.Trim();
                stock.FCompanyId  = CurrentUser.AccountComId;
                stock.FFlag       = 1;
                stock.FDeleteFlag = 0;
                //stock.FFreight = Convert.ToDecimal(txtFFreight.Text.Trim());
                stock.FLinkman              = txtFLinkman.Text.Trim();
                stock.FReceiver             = ddlFReceiver.SelectedValue;
                stock.FT6ReceiveSendType    = ddlT6ReceiveSendType.SelectedText;
                stock.FT6ReceiveSendTypeNum = ddlT6ReceiveSendType.SelectedValue;
                stock.FMemo        = txtFMemo.Text.Trim();
                stock.FT6Warehouse = ddlFWarehouse.SelectedValue;
                stock.FT6Status    = "未同步";
                //stock.FPhone = txtFPhone.Text.Trim();

                //stock.FShipper = !ddlFShipper.SelectedValue.Equals("-1") ? ddlFShipper.SelectedText : "";
                //stock.FVehicleNum = !ddlFVehicleNum.SelectedValue.Equals("-1") ? ddlFVehicleNum.SelectedText : "";

                var parms = new Dictionary <string, object>();
                parms.Clear();

                parms.Add("@keyID", stock.KeyId);
                parms.Add("@companyId", CurrentUser.AccountComId);
                var amt =
                    Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);

                stock.FAmount = amt;
                stock.FTime1  = DateTime.Now;
                stock.FDate   = txtFDate.SelectedDate;
                //stock.FSalesman = ddlFSalesman.SelectedValue;
                //stock.FArea = ddlFArea.SelectedValue;
                //stock.FAmt = Convert.ToDecimal(txtFAmt.Text.Trim());
                //stock.FReconciliation = txtFReconciliation.Text;
                //stock.FDeliveryMethod = ddlDeliveryMethod.SelectedValue;
                //stock.FLogisticsNumber = txtFLogisticsNumber.Text;

                //stock.FSupercargo = GasHelper.GetDropDownListArrayString(ddlFSupercargo.SelectedItemArray);
                //stock.FDriver = GasHelper.GetDropDownListArrayString(ddlFDriver.SelectedItemArray);

                stock.FCate = ddlFCate.SelectedValue;

                stock.FGroup = ddlFGroup.SelectedValue;

                stock.FDistributionPoint = ddlFDistributionPoint.SelectedValue;

                StockOutService.SaveChanges();

                if (txtKeyId.Text.Contains("TM"))
                {
                    //单据号问题
                    string newKeyId   = SequenceService.CreateSequence(Convert.ToDateTime(txtFDate.SelectedDate), "OT", CurrentUser.AccountComId);
                    var    orderParms = new Dictionary <string, object>();
                    orderParms.Clear();
                    orderParms.Add("@oldKeyId", txtKeyId.Text);
                    orderParms.Add("@newKeyId", newKeyId);
                    orderParms.Add("@Bill", "20");
                    orderParms.Add("@companyId", CurrentUser.AccountComId);
                    SqlService.ExecuteProcedureCommand("proc_num", orderParms);
                    txtKeyId.Text = newKeyId;
                    //--------------------------------------------------------------
                    //var orders = new Dictionary<string, object>();
                    //orders.Clear();
                    //orders.Add("@KeyId",newKeyId);
                    //orders.Add("@companyId", CurrentUser.AccountComId);
                    //SqlService.ExecuteProcedureCommand("proc_ProuctOrder", orders);

                    //新增日志
                    var billStatus = new LHBillStatus
                    {
                        KeyId       = newKeyId,
                        FCompanyId  = CurrentUser.AccountComId,
                        FActionName = "新增",
                        FDate       = DateTime.Now,
                        FDeptId     = CurrentUser.AccountOrgId,
                        FOperator   = CurrentUser.AccountName,
                        FMemo       = String.Format("单据号{0},{1}新增{2}单据。", newKeyId, CurrentUser.AccountName, ddlFCate.SelectedValue)
                    };
                    GasHelper.AddBillStatus(billStatus);
                }

                return(true);
            }


            return(false);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     提交添加
        /// </summary>
        private bool SubmintAdd()
        {
            var stock = StockOutService.Where(p => p.KeyId == txtKeyId.Text.Trim() && p.FCompanyId == CurrentUser.AccountComId).FirstOrDefault();

            if (stock != null)
            {
                ModifiedGrid();


                stock.FCompanyId         = CurrentUser.AccountComId;
                stock.FFlag              = 1;
                stock.FDeleteFlag        = 0;
                stock.FMemo              = txtFMemo.Text.Trim();
                stock.FDate              = txtFDate.SelectedDate;
                stock.FDistributionPoint = ddlFDistributionPoint.SelectedValue;

                var parms = new Dictionary <string, object>();
                parms.Clear();

                parms.Add("@keyID", stock.KeyId);
                parms.Add("@companyId", CurrentUser.AccountComId);
                var amt =
                    Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);

                stock.FAmount = amt;
                stock.FDate   = txtFDate.SelectedDate;

                StockOutService.SaveChanges();

                if (txtKeyId.Text.Contains("TM"))
                {
                    //单据号问题
                    string newKeyId   = SequenceService.CreateSequence(Convert.ToDateTime(txtFDate.SelectedDate), "PK", CurrentUser.AccountComId);
                    var    orderParms = new Dictionary <string, object>();
                    orderParms.Clear();
                    orderParms.Add("@oldKeyId", txtKeyId.Text);
                    orderParms.Add("@newKeyId", newKeyId);
                    orderParms.Add("@Bill", "9");
                    orderParms.Add("@companyId", CurrentUser.AccountComId);
                    SqlService.ExecuteProcedureCommand("proc_num", orderParms);
                    txtKeyId.Text = newKeyId;

                    //新增日志
                    var billStatus = new LHBillStatus
                    {
                        KeyId       = newKeyId,
                        FCompanyId  = CurrentUser.AccountComId,
                        FActionName = "新增",
                        FDate       = DateTime.Now,
                        FDeptId     = CurrentUser.AccountOrgId,
                        FOperator   = CurrentUser.AccountName,
                        FMemo       = String.Format("单据号{0},{1}新增盘亏单据。", newKeyId, CurrentUser.AccountName)
                    };
                    GasHelper.AddBillStatus(billStatus);
                }

                return(true);
            }


            return(false);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     提交编辑
        /// </summary>
        private bool SubmintEdit()
        {
            if (StockOut != null)
            {
                ModifiedGrid();
                /////////////////////////////////////////////////////////////////////////////

                StockOut.FCode = txtFCode.Text;
                StockOut.FName = tbxFCustomer.Text;
                //------------------------------------------------------
                StockOut.FAddress = txtFAddress.Text.Trim();
                //StockOut.FCompanyId = CurrentUser.AccountComId;

                StockOut.FDate = txtFDate.SelectedDate;

                StockOut.FShipper    = !ddlFShipper.SelectedValue.Equals("-1") ? ddlFShipper.SelectedText : "";
                StockOut.FVehicleNum = !ddlFVehicleNum.SelectedValue.Equals("-1") ? ddlFVehicleNum.SelectedText : "";

                StockOut.FFreight = Convert.ToDecimal(txtFFreight.Text.Trim());
                StockOut.FLinkman = txtFLinkman.Text.Trim();
                StockOut.FMemo    = txtFMemo.Text.Trim();
                StockOut.FPhone   = txtFPhone.Text.Trim();

                var parms = new Dictionary <string, object>();
                parms.Clear();

                parms.Add("@keyID", StockOut.KeyId);
                parms.Add("@companyId", CurrentUser.AccountComId);

                var amt =
                    Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);

                StockOut.FAmount = amt;

                StockOut.FSalesman        = ddlFSalesman.SelectedValue;
                StockOut.FArea            = ddlFArea.SelectedValue;
                StockOut.FAmt             = string.IsNullOrEmpty(txtFAmt.Text.Trim()) ? 0 : Convert.ToDecimal(txtFAmt.Text.Trim());//
                StockOut.FDiscountAmount  = string.IsNullOrEmpty(txtFDiscountAmount.Text.Trim()) ? 0 : Convert.ToDecimal(txtFDiscountAmount.Text.Trim());
                StockOut.FReconciliation  = txtFReconciliation.Text;
                StockOut.FDeliveryMethod  = ddlDeliveryMethod.SelectedValue;
                StockOut.FLogisticsNumber = txtFLogisticsNumber.Text;
                StockOut.FSupercargo      = GasHelper.GetDropDownListArrayString(ddlFSupercargo.SelectedItemArray);
                StockOut.FDriver          = GasHelper.GetDropDownListArrayString(ddlFDriver.SelectedItemArray);
                StockOut.FSubjectCode     = ddlSubject.SelectedValue;
                StockOut.FSubjectName     = ddlSubject.SelectedText;

                var bottles = new Dictionary <string, object>();
                bottles.Clear();

                bottles.Add("@SalesKeyId", StockOut.KeyId);
                bottles.Add("@companyid", CurrentUser.AccountComId);
                bottles.Add("@date", Convert.ToDateTime(StockOut.FDate).ToString("yyyy-MM-dd"));

                SqlService.ExecuteProcedureCommand("proc_SalesReturnBottle", bottles);


                //收款部分
                var parmsAuto = new Dictionary <string, object>();
                parmsAuto.Clear();

                parmsAuto.Add("@KeyId", StockOut.KeyId);
                parmsAuto.Add("@companyId", CurrentUser.AccountComId);
                parmsAuto.Add("@FCate", "客户");
                parmsAuto.Add("@date", Convert.ToDateTime(StockOut.FDate).ToShortDateString());
                parmsAuto.Add("@FSKNum", string.IsNullOrEmpty(StockOut.FSKNum) ? "" : StockOut.FSKNum);

                SqlService.ExecuteProcedureCommand("proc_SKOrderAuto", parmsAuto);


                if (!string.IsNullOrEmpty(hfdImage.Text))
                {
                    var attachment = new LHAttachment();
                    attachment.FCompanyId = CurrentUser.AccountComId;
                    attachment.FPath      = hfdImage.Text;
                    attachment.KeyId      = txtKeyId.Text;

                    AttachmentService.Add(attachment);
                }


                //---------------------------------------------------------
                //收发类型
                StockOut.FT6ReceiveSendType    = ddlT6ReceiveSendType.SelectedText;
                StockOut.FT6ReceiveSendTypeNum = ddlT6ReceiveSendType.SelectedValue;
                //部门名称
                StockOut.FT6Department = "";
                //部门代码
                StockOut.FT6DepartmentNum = "";
                //业务员代码
                StockOut.FT6SalesmanNum = "";
                //币种
                StockOut.FT6Currency = ddlFT6Currency.SelectedValue;
                //汇率
                StockOut.FT6ExchangeRate = Convert.ToDecimal(txtFT6ExchangeRate.Text);
                //销售类型
                StockOut.FT6SaleType    = ddlFT6SaleType.SelectedText;
                StockOut.FT6SaleTypeNum = ddlFT6SaleType.SelectedValue;
                //T6同步
                //StockOut.FT6Status = "未同步";

                return(StockOutService.SaveChanges() >= 0);
            }
            return(false);
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     提交添加
        /// </summary>
        private bool SubmintAdd()
        {
            var stock = StockOutService.Where(p => p.KeyId == txtKeyId.Text.Trim() && p.FCompanyId == CurrentUser.AccountComId).FirstOrDefault();

            if (stock != null)
            {
                ModifiedGrid();

                stock.FCode       = txtFCode.Text;
                stock.FName       = tbxFCustomer.Text;
                stock.FAddress    = txtFAddress.Text.Trim();
                stock.FCompanyId  = CurrentUser.AccountComId;
                stock.FFlag       = 1;
                stock.FDeleteFlag = 0;

                if (!string.IsNullOrEmpty(txtFFreight.Text.Trim()))
                {
                    stock.FFreight = Convert.ToDecimal(txtFFreight.Text.Trim());
                }

                stock.FLinkman = txtFLinkman.Text.Trim();
                stock.FMemo    = txtFMemo.Text.Trim();
                stock.FPhone   = txtFPhone.Text.Trim();

                stock.FShipper    = !ddlFShipper.SelectedValue.Equals("-1") ? ddlFShipper.SelectedText : "";
                stock.FVehicleNum = !ddlFVehicleNum.SelectedValue.Equals("-1") ? ddlFVehicleNum.SelectedText : "";


                var parms = new Dictionary <string, object>();
                parms.Clear();
                parms.Add("@companyId", CurrentUser.AccountComId);
                parms.Add("@keyID", stock.KeyId);
                var amt =
                    Convert.ToDecimal(SqlService.ExecuteProcedureCommand("proc_SalesAmt", parms).Tables[0].Rows[0][0]);

                stock.FAmount = amt;

                stock.FSalesman        = ddlFSalesman.SelectedValue;
                stock.FArea            = ddlFArea.SelectedValue;
                stock.FAmt             = string.IsNullOrEmpty(txtFAmt.Text.Trim()) ? 0 : Convert.ToDecimal(txtFAmt.Text.Trim());
                stock.FReconciliation  = txtFReconciliation.Text;
                stock.FDeliveryMethod  = ddlDeliveryMethod.SelectedValue;
                stock.FLogisticsNumber = txtFLogisticsNumber.Text;
                stock.FDate            = txtFDate.SelectedDate;
                stock.FSupercargo      = GasHelper.GetDropDownListArrayString(ddlFSupercargo.SelectedItemArray);
                stock.FDriver          = GasHelper.GetDropDownListArrayString(ddlFDriver.SelectedItemArray);
                stock.FSubjectCode     = ddlSubject.SelectedValue;
                stock.FSubjectName     = ddlSubject.SelectedText;
                stock.FSKNum           = "";



                #region T6 对接接口
                //---------------------------------------------------------
                //收发类型
                stock.FT6ReceiveSendType    = ddlT6ReceiveSendType.SelectedText;
                stock.FT6ReceiveSendTypeNum = ddlT6ReceiveSendType.SelectedValue;
                //部门名称
                stock.FT6Department = "";
                //部门代码
                stock.FT6DepartmentNum = "";
                //业务员代码
                stock.FT6SalesmanNum = "";
                //币种
                stock.FT6Currency = ddlFT6Currency.SelectedValue;
                //汇率
                stock.FT6ExchangeRate = Convert.ToDecimal(txtFT6ExchangeRate.Text);
                //销售类型
                stock.FT6PurchaseType    = ddlFT6PurchaseType.SelectedText;
                stock.FT6PurchaseTypeNum = ddlFT6PurchaseType.SelectedValue;
                //T6同步
                stock.FT6Status    = "未同步";
                stock.FT6Warehouse = ddlWarehouse.SelectedValue;
                //---------------------------------------------------------
                #endregion


                StockOutService.SaveChanges();

                if (txtKeyId.Text.Contains("TM"))
                {
                    //单据号问题
                    string newKeyId   = SequenceService.CreateSequence(Convert.ToDateTime(txtFDate.SelectedDate), "CT", CurrentUser.AccountComId);
                    var    orderParms = new Dictionary <string, object>();
                    orderParms.Clear();
                    orderParms.Add("@oldKeyId", txtKeyId.Text);
                    orderParms.Add("@newKeyId", newKeyId);
                    orderParms.Add("@Bill", "5");
                    orderParms.Add("@companyId", CurrentUser.AccountComId);
                    SqlService.ExecuteProcedureCommand("proc_num", orderParms);
                    txtKeyId.Text = newKeyId;

                    //新增日志
                    var billStatus = new LHBillStatus
                    {
                        KeyId       = newKeyId,
                        FCompanyId  = CurrentUser.AccountComId,
                        FActionName = "新增",
                        FDate       = DateTime.Now,
                        FDeptId     = CurrentUser.AccountOrgId,
                        FOperator   = CurrentUser.AccountName,
                        FMemo       = String.Format("单据号{0},{1}新增采购退货单据。", newKeyId, CurrentUser.AccountName)
                    };
                    GasHelper.AddBillStatus(billStatus);


                    //收款部分
                    var parmsAuto = new Dictionary <string, object>();
                    parmsAuto.Clear();

                    parmsAuto.Add("@KeyId", newKeyId);
                    parmsAuto.Add("@companyId", CurrentUser.AccountComId);
                    parmsAuto.Add("@FCate", "供应商");
                    parmsAuto.Add("@date", Convert.ToDateTime(stock.FDate).ToString("yyyy-MM-dd"));
                    parmsAuto.Add("@FSKNum", stock.FSKNum);

                    SqlService.ExecuteProcedureCommand("proc_SKOrderAuto", parmsAuto);
                }

                return(true);
            }
            return(false);
        }