Ejemplo n.º 1
0
        /// <summary>
        ///     提交添加
        /// </summary>
        private bool SubmintAdd()
        {
            var order = FKOrderService.Where(p => p.keyId == txtKeyId.Text.Trim() && p.FCompanyId == CurrentUser.AccountComId).FirstOrDefault();

            if (order != null)
            {
                order.FCode = txtFCode.Text;
                order.FName = tbxFCustomer.Text;
                //--------------------------------------------------
                order.FDeleteFlag = 0;
                order.FMemo       = txtFMemo.Text.Trim();
                order.CreateBy    = CurrentUser.AccountName;
                order.FDate       = txtFDate.SelectedDate;

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

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

                order.FAmount = amt;

                FKOrderService.SaveChanges();

                if (txtKeyId.Text.Contains("TM"))
                {
                    //单据号问题
                    string newKeyId   = SequenceService.CreateSequence(Convert.ToDateTime(txtFDate.SelectedDate), "NF", CurrentUser.AccountComId);
                    var    orderParms = new Dictionary <string, object>();
                    orderParms.Clear();
                    orderParms.Add("@oldKeyId", txtKeyId.Text);
                    orderParms.Add("@newKeyId", newKeyId);
                    orderParms.Add("@Bill", "19");
                    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.º 2
0
        /// <summary>
        ///     加载页面数据
        /// </summary>
        private void LoadData()
        {
            switch (Actions)
            {
            case WebAction.Add:
                txtKeyId.Text = SequenceService.CreateSequence("TM", CurrentUser.AccountComId);
                Region1.Title = "添加一般费用单";
                var temp = new LHFKOrder
                {
                    keyId = txtKeyId.Text,

                    FFlag = 1,

                    FDeleteFlag = 1,

                    //一般费用单
                    FType = Convert.ToInt32(GasEnumBill.GeneralExpense),

                    CreateBy = CurrentUser.AccountName,

                    FDate = txtFDate.SelectedDate,

                    FAmount = 0,

                    FCate = "内",

                    FCompanyId = CurrentUser.AccountComId
                };

                //临时写入单据
                FKOrderService.Add(temp);

                var summary = new JObject
                {
                    { "FCode", "合计" },
                    { "FAmt", 0 },
                };

                Grid1.SummaryData = summary;

                break;

            case WebAction.Edit:
                txtKeyId.Text = KeyId;
                Region1.Title = "编辑一般费用单";
                if (SkOrder != null)
                {
                    txtFCode.Text     = SkOrder.FCode;
                    tbxFCustomer.Text = SkOrder.FName;
                    txtFMemo.Text     = SkOrder.FMemo;

                    BindDataGrid();
                }
                break;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     提交编辑
        /// </summary>
        private bool SubmintEdit()
        {
            if (SkOrder != null)
            {
                SkOrder.FCode = txtFCode.Text;
                SkOrder.FName = tbxFCustomer.Text;
                SkOrder.FMemo = txtFMemo.Text.Trim();

                return(FKOrderService.SaveChanges() >= 0);
            }
            return(false);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     提交编辑
        /// </summary>
        private bool SubmintEdit()
        {
            if (SkOrder != null)
            {
                SkOrder.FCode    = txtFCode.Text;
                SkOrder.FName    = tbxFCustomer.Text;
                SkOrder.FDate    = txtFDate.SelectedDate;
                SkOrder.FMemo    = txtFMemo.Text.Trim();
                SkOrder.CreateBy = CurrentUser.AccountName;

                return(FKOrderService.SaveChanges() >= 0);
            }
            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     加载页面数据
        /// </summary>
        private void LoadData()
        {
            switch (Actions)
            {
            case WebAction.Add:
                txtKeyId.Text = SequenceService.CreateSequence("TM", CurrentUser.AccountComId);
                Region1.Title = "添加付款单";
                var temp = new LHFKOrder
                {
                    keyId = txtKeyId.Text,

                    FFlag = 1,

                    FDeleteFlag = 1,

                    FType = Convert.ToInt32(GasEnumBill.Payment),

                    CreateBy = CurrentUser.AccountName,

                    FDate = txtFDate.SelectedDate,

                    FAmount = 0,

                    FCate = "供应商",

                    FCompanyId = CurrentUser.AccountComId
                };

                //临时写入单据
                FKOrderService.Add(temp);


                var summary = new JObject
                {
                    { "FCode", "合计" },
                    { "FAmt", 0 },
                };

                Grid1.SummaryData = summary;

                break;

            case WebAction.Edit:
                txtKeyId.Text = KeyId;
                Region1.Title = "编辑付款单";
                if (SkOrder != null)
                {
                    txtFCode.Text     = SkOrder.FCode;
                    tbxFCustomer.Text = SkOrder.FName;

                    //txtFAddress.Text = StockOut.FAddress;
                    //txtFFreight.Text = StockOut.FFreight.ToString();

                    //txtFLinkman.Text = StockOut.FLinkman;
                    txtFMemo.Text = SkOrder.FMemo;
                    //txtFPhone.Text = StockOut.FPhone;

                    //ddlFDriver.Text = StockOut.FDriver;
                    //ddlFShipper.SelectedValue = StockOut.FShipper;
                    //ddlFSupercargo.Text = StockOut.FSupercargo;
                    //ddlFVehicleNum.SelectedValue = StockOut.FVehicleNum;

                    BindDataGrid();
                }
                break;
            }
        }