Пример #1
0
        // 修改
        protected void GridGoodsSeries_OnUpdateCommand(object sender, GridCommandEventArgs e)
        {
            var    editedItem  = (GridEditableItem)e.Item;
            var    id          = (Guid)editedItem.GetDataKeyValue("SeriesID");
            string seriesName  = ((TextBox)editedItem.FindControl("TB_SeriesName")).Text;
            var    goodsSeries = new GoodsSeriesInfo();

            goodsSeries.SeriesID   = id;
            goodsSeries.SeriesName = seriesName;

            string errorMessage;
            var    result = _goodsCenterSao.UpdateSeries(goodsSeries, out errorMessage);//更新系列

            if (result)
            {
                //记录工作日志
                var personnelInfo = CurrentSession.Personnel.Get();
                WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, id, "",
                                           OperationPoint.GoodsSeriesManager.Edit.GetBusinessInfo(), string.Empty);
            }
            else
            {
                RAM.Alert("操作无效!" + errorMessage);
            }
        }
 /// <summary>
 /// 金额汇总
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void RgCompanyItemDataBound(object sender, GridItemEventArgs e)
 {
     //if (_cost <= 0)
     //{
     //if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
     //{
     //    var lab = e.Item.FindControl("Lab_RealityBalance") as Label;
     //    if (lab != null)
     //        if (!string.IsNullOrEmpty(lab.Text))
     //        {
     //            _amount += Convert.ToDecimal(lab.Text);
     //        }
     //    //
     //    var labPay = e.Item.FindControl("LabPayRealityBalance") as Label;
     //    if (labPay != null)
     //        if (!string.IsNullOrEmpty(labPay.Text))
     //        {
     //            _payAmount += Convert.ToDecimal(labPay.Text);
     //        }
     //}
     //}
     if (e.Item.ItemType == GridItemType.Footer)
     {
         var tbTotalAmount = e.Item.FindControl("TB_TotalAmount") as Label;
         if (tbTotalAmount != null)
         {
             tbTotalAmount.Text += string.Format("合计:{0} 元", WebControl.NumberSeparator(_amount));// "计算的总数,或者也可以单独计算 ";//
         }
         var tbPayTotalAmount = e.Item.FindControl("TbTotalAmount") as Label;
         if (tbPayTotalAmount != null)
         {
             tbPayTotalAmount.Text += string.Format("合计:{0} 元", WebControl.NumberSeparator(_payAmount));// "计算的总数,或者也可以单独计算 ";//
         }
     }
 }
Пример #3
0
 protected void BeforeLoan(CostReportInfo model)
 {
     if (model.IsSystem)
     {
         model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
     }
     else
     {
         //查询没有付款的票据
         var isPayList = CostReportBillInfoList.Where(p => !p.IsPay);
         if (isPayList.Any())                               //有没有付款的票据
         {
             model.State = (int)CostReportState.NoAuditing; //状态:票据待受理
         }
         else
         {
             if (model.IsLastTime)
             {
                 if (CostReportTravelInfoList.Any() || CostReportTerminiInfoList.Any() || !string.IsNullOrEmpty(model.GoodsCode) || !model.InvoiceId.Equals(Guid.Empty))
                 {
                     model.State = (int)CostReportState.NoAuditing;//状态:票据待受理
                 }
                 else
                 {
                     model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
                 }
             }
             else
             {
                 model.State = (int)CostReportState.AlreadyAuditing;//状态:待付款
             }
         }
     }
     model.Memo = WebControl.RetrunUserAndTime("[【审核】:审核通过;审核说明:" + (string.IsNullOrEmpty(txt_AuditingMemo.Text) ? "暂无说明" : txt_AuditingMemo.Text) + ";]");
 }
Пример #4
0
        //发票接收
        protected void imgbtn_Receive_Click(object sender, EventArgs e)
        {
            var    invoice     = ((ImageButton)sender).CommandArgument;
            var    invoiceInfo = invoice.Split(',');
            string invoiceId   = invoiceInfo[0];
            string invoiceType = invoiceInfo[1];
            CompanyFundReceiptInvoiceInfo model =
                _companyFundReceiptInvoice.Getlmshop_CompanyFundReceiptInvoiceByInvoiceId(new Guid(invoiceId));

            if (model.InvoiceState.Equals((int)CompanyFundReceiptInvoiceState.Submit))
            {
                string remark = WebControl.RetrunUserAndTime("【接收发票】");
                if (invoiceType.Equals("1"))
                {
                    _companyFundReceiptInvoice.Updatelmshop_CompanyFundReceiptInvoiceByInvoiceId(remark, new Guid(invoiceId),
                                                                                                 (int)CompanyFundReceiptInvoiceState.Verification);
                }
                else
                {
                    _companyFundReceiptInvoice.Updatelmshop_CompanyFundReceiptInvoiceByInvoiceId(remark, new Guid(invoiceId),
                                                                                                 (int)CompanyFundReceiptInvoiceState.Receive);
                }
                MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
            else
            {
                MessageBox.Show(this, "状态已更新,不允许此操作!");
            }
        }
Пример #5
0
        // 删除
        protected void GridGoodsSeries_OnDeleteCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem = (GridEditableItem)e.Item;
            var id         = (Guid)editedItem.GetDataKeyValue("SeriesID");

            try
            {
                string errorMessage;
                var    result = _goodsCenterSao.DeleteSeries(id, out errorMessage);//删除分类
                if (result)
                {
                    //记录工作日志
                    var personnelInfo = CurrentSession.Personnel.Get();
                    WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, id, "",
                                               OperationPoint.GoodsSeriesManager.Delete.GetBusinessInfo(), string.Empty);
                }
                else
                {
                    RAM.Alert("操作无效!" + errorMessage);
                }
            }
            catch
            {
                RAM.Alert("删除失败!");
            }
        }
        private void CreationChart()
        {
            MemberChart.Clear();
            var         mgArray = new decimal[12];
            IGoodsOrder order   = new GoodsOrder(GlobalConfig.DB.FromType.Read);
            var         memberShopingChartList = order.GetQueryOrderByFinancial(Year, (OrderState)OrderState, PayMode, CountryId, ProvinceId, CityId, GlobalConfig.KeepYear, SaleFilialeID, SalePlatformID);

            if (memberShopingChartList.Count > 0)
            {
                decimal count = memberShopingChartList.Aggregate <KeyValuePair <int, decimal>, decimal>(0, (current, t) => current + t.Value);

                foreach (var keyValuePair in memberShopingChartList)
                {
                    mgArray[keyValuePair.Key - 1] = WebControl.CurrencyValue(keyValuePair.Value);
                }
                MemberChart.DataSource = mgArray;
                MemberChart.DataBind();
                MemberChart.ChartTitle.TextBlock.Text = "当前条件订单总金额" + WebControl.CurrencyValue(count) + ",详细如下:";
                //ChartSeries memberChart = MemberChart.Series.GetSeries(0);
                //ChartSeries nullChare = MemberChart.Series.GetSeries(1);
                //memberChart.Name = "订单发生额";
                //nullChare.Name = "";
            }
            else
            {
                MemberChart.ChartTitle.TextBlock.Text = "无发生数据";
            }
        }
        //作废
        protected void btn_Del_Click(object sender, EventArgs e)
        {
            var reportId       = ((Button)sender).CommandArgument;
            var costReportInfo = _costReport.GetReportByReportId(new Guid(reportId));

            if (!(costReportInfo.State.Equals((int)CostReportState.Auditing) || costReportInfo.State.Equals((int)CostReportState.AuditingNoPass) || (costReportInfo.ReportKind.Equals((int)CostReportKind.Later) && costReportInfo.State.Equals((int)CostReportState.InvoiceNoPass))))
            {
                MessageBox.Show(this, "该单据状态已更新,不允许此操作!");
                return;
            }

            using (var ts = new TransactionScope(TransactionScopeOption.Required))
            {
                try
                {
                    var memo = WebControl.RetrunUserAndTime("[【作废申报】:申报作废;]");
                    _costReport.UpdateReport(new Guid(reportId), (int)CostReportState.Cancel, string.Empty, memo, Guid.Empty);

                    //添加操作日志
                    _operationLogManager.Add(Personnel.PersonnelId, Personnel.RealName, new Guid(reportId), costReportInfo.ReportNo, OperationPoint.CostDeclare.AuditDeclare.GetBusinessInfo(), 1, "");

                    RG_Report.Rebind();
                    ts.Complete();
                }
                catch
                {
                    MessageBox.AppendScript(this, "作废申报失败!");
                }
            }
        }
Пример #8
0
        //费用申报(lmshop_CostReport)
        protected void EditCostReportModel(CostReportInfo model, PersonnelInfo personnelInfo)
        {
            model.ReportNo       = new CodeManager().GetCode(CodeType.RE);
            model.ReportKind     = (int)CostReportKind.FeeIncome;
            model.AssumeBranchId = string.IsNullOrEmpty(ddl_AssumeBranch.SelectedValue) ? Guid.Empty : new Guid(ddl_AssumeBranch.SelectedValue);
            model.AssumeGroupId  = string.IsNullOrEmpty(ddl_AssumeGroup.SelectedValue) ? Guid.Empty : new Guid(ddl_AssumeGroup.SelectedValue);
            model.AssumeShopId   = string.IsNullOrEmpty(ddl_AssumeShop.SelectedValue) ? Guid.Empty : new Guid(ddl_AssumeShop.SelectedValue);
            model.CostsVarieties = string.IsNullOrEmpty(Hid_CostsClass.Value) ? -1 : int.Parse(Hid_CostsClass.Value);
            model.GoodsCode      = string.Empty;
            model.CompanyClassId = string.IsNullOrEmpty(ddl_CompanyClass.SelectedValue) ? Guid.Empty : new Guid(ddl_CompanyClass.SelectedValue);
            model.CompanyId      = string.IsNullOrEmpty(ddl_FeeType.SelectedValue) ? Guid.Empty : new Guid(ddl_FeeType.SelectedValue);
            model.UrgentOrDefer  = int.Parse(rbl_UrgentOrDefer.SelectedValue);
            model.UrgentReason   = model.UrgentOrDefer.Equals(1) ? txt_UrgentReason.Text : string.Empty;
            model.ReportName     = txt_ReportName.Text;
            model.StartTime      = DateTime.Parse(txt_StartTime.Text);
            model.EndTime        = DateTime.Parse(txt_EndTime.Text);
            model.PayCompany     = txt_PayCompany.Text;
            model.ReportCost     = Math.Abs(Decimal.Parse(txt_ReportCost.Text));
            model.RealityCost    = model.ReportCost;
            model.ApplyForCost   = model.ReportCost;
            model.ActualAmount   = model.ReportCost;
            model.CostType       = int.Parse(rbl_CostType.SelectedValue);
            model.Deposit        = 2;
            if (model.CostType.Equals(2))
            {
                model.BankAccountName = txt_BankName.Text.Trim() + "," + txt_SubBankName.Text.Trim();
            }
            model.InvoiceType      = (int)CostReportInvoiceType.WaitCheck;
            model.PayBankAccountId = string.IsNullOrEmpty(rcb_PayBankAccount.SelectedValue) ? Guid.Empty : new Guid(rcb_PayBankAccount.SelectedValue); //结算账号
            model.AssumeFilialeId  = string.IsNullOrEmpty(Hid_AssumeFiliale.Value) ? Guid.Empty : new Guid(Hid_AssumeFiliale.Value);                   //结算公司
            model.ReportMemo       = txt_ReportMemo.Text;

            model.ReportFilialeId   = personnelInfo.FilialeId;
            model.ReportBranchId    = personnelInfo.BranchId;
            model.ReportPersonnelId = personnelInfo.PersonnelId;
            model.State             = (int)CostReportState.Auditing;
            if (string.IsNullOrEmpty(Request.QueryString["ReportId"]))
            {
                model.ReportDate = DateTime.Now;
            }
            model.Memo        = WebControl.RetrunUserAndTime("[【费用收入】:" + txt_ReportMemo.Text + ";]");
            model.IsLastTime  = true;
            model.IsSystem    = false;
            model.ApplyNumber = 1;
            model.IsEnd       = false;

            if (!string.IsNullOrEmpty(rcb_PayBankAccount.SelectedValue))
            {
                var bankAccountInfo = _bankAccounts.GetBankAccounts(new Guid(rcb_PayBankAccount.SelectedValue));
                if (bankAccountInfo != null && bankAccountInfo.IsMain)
                {
                    model.IsOut = true;
                }
                else
                {
                    model.IsOut = false;
                }
            }
        }
Пример #9
0
 //票据数据源
 protected void RepeaterBillDataBind()
 {
     Repeater_Bill.DataSource = CostReportBillInfoList.OrderByDescending(p => p.OperatingTime).ThenByDescending(p => p.IsPay);
     Repeater_Bill.DataBind();
     lit_SumNoTaxAmount.Text = WebControl.RemoveDecimalEndZero(CostReportBillInfoList.Sum(p => p.NoTaxAmount)) + "元";
     lit_SumTax.Text         = WebControl.RemoveDecimalEndZero(CostReportBillInfoList.Sum(p => p.Tax)) + "元";
     lit_SumTaxAmount.Text   = WebControl.RemoveDecimalEndZero(CostReportBillInfoList.Sum(p => p.TaxAmount)) + "元";
 }
        /// <summary>
        /// 取得用户操作权限
        /// </summary>
        protected bool GetPowerOperationPoint(string powerName)
        {
            string pageName = WebControl.FileName;

            if (powerName == "InnerPurchaseApprove")
            {
                var dd = WebControl.GetPowerOperationPoint(pageName, powerName);
            }

            return(WebControl.GetPowerOperationPoint(pageName, powerName));
        }
        protected void IbExportDataClick(object sender, ImageClickEventArgs e)
        {
            string fileName = "出入库记录";

            fileName += WebControl.GetNowTime().ToShortDateString();
            fileName  = Server.UrlEncode(fileName);
            StockGrid.ExportSettings.ExportOnlyData = true;
            StockGrid.ExportSettings.IgnorePaging   = true;
            StockGrid.ExportSettings.FileName       = fileName;
            StockGrid.MasterTableView.ExportToExcel();
        }
Пример #12
0
        protected void PayVerification(CostReportInfo model)
        {
            model.State = (int)CostReportState.NoAuditing;//状态:票据待受理

            #region 结算账号
            IBankAccounts bankAccounts    = new BankAccounts(GlobalConfig.DB.FromType.Read);
            var           bankAccountInfo = bankAccounts.GetBankAccounts(model.PayBankAccountId);
            string        payBankAccount  = bankAccountInfo == null ? "暂无结算" : (bankAccountInfo.BankName + "【" + bankAccountInfo.AccountsName + "】");
            #endregion

            model.Memo = WebControl.RetrunUserAndTime("[【审核】:审核通过;审核说明:" + (string.IsNullOrEmpty(txt_AuditingMemo.Text) ? "暂无说明" : txt_AuditingMemo.Text) + ";]") + WebControl.RetrunUserAndTime("[【已付款】:已支付" + WebControl.RemoveDecimalEndZero(model.RealityCost) + "元;结算账号:" + payBankAccount + ";]");
        }
Пример #13
0
        /// <summary>新建
        /// </summary>
        protected void RadGrid_InvoiceRollList_InsertCommand(object sender, GridCommandEventArgs e)
        {
            if (!SubmitController.Enabled)
            {
                return;
            }
            var editedItem = e.Item as GridEditableItem;
            var newId      = Guid.NewGuid();

            if (editedItem != null)
            {
                var textBoxReceiptor        = editedItem.FindControl("TextBox_Receiptor") as TextBox;
                var textBoxInvoiceCode      = editedItem.FindControl("TextBox_InvoiceCode") as TextBox;
                var textBoxInvoiceStartNo   = editedItem.FindControl("TextBox_InvoiceStartNo") as TextBox;
                var textBoxInvoiceEndNo     = editedItem.FindControl("TextBox_InvoiceEndNo") as TextBox;
                var textBoxInvoiceRollCount = editedItem.FindControl("TextBox_InvoiceRollCount") as TextBox;
                var radDatePickerTime       = editedItem.FindControl("RadDatePicker_Time") as RadDatePicker;
                var radComboBoxFiliale      = editedItem.FindControl("RCB_Filiale") as RadComboBox;
                var invoiceRollInfo         = new Keede.Ecsoft.Model.InvoiceRoll
                {
                    Id               = newId,
                    Receiptor        = textBoxReceiptor != null?textBoxReceiptor.Text:string.Empty,
                    InvoiceCode      = textBoxInvoiceCode != null?textBoxInvoiceCode.Text:string.Empty,
                    InvoiceStartNo   = textBoxInvoiceStartNo == null?0:int.Parse(string.IsNullOrEmpty(textBoxInvoiceStartNo.Text.Trim()) ? "0" : textBoxInvoiceStartNo.Text.Trim()),
                    InvoiceEndNo     = textBoxInvoiceEndNo == null?0:int.Parse(string.IsNullOrEmpty(textBoxInvoiceEndNo.Text.Trim()) ? "0" : textBoxInvoiceEndNo.Text.Trim()),
                    InvoiceRollCount = textBoxInvoiceRollCount == null?0:int.Parse(string.IsNullOrEmpty(textBoxInvoiceRollCount.Text.Trim()) ? "0" : textBoxInvoiceRollCount.Text.Trim()),
                    CreateTime       = radDatePickerTime != null?radDatePickerTime.SelectedDate ?? DateTime.Now:DateTime.Now,
                    FilialeId        = radComboBoxFiliale != null?new Guid(radComboBoxFiliale.SelectedValue):Guid.Empty
                };
                invoiceRollInfo.InvoiceCount = invoiceRollInfo.InvoiceEndNo - invoiceRollInfo.InvoiceStartNo + 1;
                if (invoiceRollInfo.InvoiceCount < 1)
                {
                    RAM.Alert("发票份数是:" + invoiceRollInfo.InvoiceCount + "份,填写发票号码错误");
                    return;
                }
                var success = Invoice.WriteInstance.AddInvoiceRoll(invoiceRollInfo);
                if (success)
                {
                    var personnelInfo = CurrentSession.Personnel.Get();
                    //发票库管理发票入库操作记录添加
                    WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, invoiceRollInfo.Id, invoiceRollInfo.InvoiceCode,
                                               OperationPoint.InvoiceStorageManage.InvoiceIntoLibrary.GetBusinessInfo(), string.Empty);
                    SubmitController.Submit();
                    RAM.ResponseScripts.Add("location.href=location.href;");
                }
                else
                {
                    RAM.Alert("购买发票添加失败");
                }
            }
        }
 protected void VoucherPay(CostReportInfo model, bool need, string payBankAccount)
 {
     if (need)
     {
         model.State      = (int)CostReportState.Complete;
         model.FinishDate = DateTime.Now;
         model.Memo       = WebControl.RetrunUserAndTime("[【已付款】:已支付" + WebControl.RemoveDecimalEndZero(model.RealityCost) + "元;结算账号:" + payBankAccount + ";]");
     }
     else
     {
         model.State = (int)CostReportState.Pay;
         model.Memo  = WebControl.RetrunUserAndTime("[【待付款】:待支付" + WebControl.RemoveDecimalEndZero(model.RealityCost) + "元;]");
     }
 }
Пример #15
0
 public string ShowStr(object filialeId, object money, object other)
 {
     if (money == null)
     {
         return(string.Empty);
     }
     if (money.ToString().Length == 0)
     {
         return(string.Empty);
     }
     if (Convert.ToDecimal(money) == 0)
     {
         return(string.Empty);
     }
     return(string.Format("{0}[{1}]", WebControl.NumberSeparator(money), WebControl.NumberSeparator(other)));
 }
Пример #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         //绑定销售平台
         BandingSaleTerrace();
         if (!WebControl.GetPowerOperationPoint(PAGE_NAME, "Auditing"))
         {
             ActivityFilingRad.MasterTableView.Columns.FindByUniqueName("Auditing").Visible = false;
         }
         if (!WebControl.GetPowerOperationPoint(PAGE_NAME, "Delete"))
         {
             ActivityFilingRad.MasterTableView.Columns.FindByUniqueName("Delete").Visible = false;
         }
     }
 }
Пример #17
0
        //审核不通过
        protected void btn_NoPass_Click(object sender, EventArgs e)
        {
            #region 验证数据
            var errorMsg = CheckData();
            if (string.IsNullOrEmpty(txt_AuditingMemo.Text))
            {
                errorMsg += "请填写“审核说明”!";
            }
            if (!string.IsNullOrEmpty(errorMsg))
            {
                MessageBox.Show(this, errorMsg);
                return;
            }
            #endregion

            CostReportInfo model = _costReport.GetReportByReportId(new Guid(Request.QueryString["ReportId"]));
            if (model.State != (int)CostReportState.Auditing)
            {
                MessageBox.Show(this, "该单据状态已更新,不允许此操作!");
                return;
            }

            var state = (int)CostReportState.AuditingNoPass;
            var memo  = WebControl.RetrunUserAndTime("[【审核】:审核不通过;审核说明:" + (string.IsNullOrEmpty(txt_AuditingMemo.Text) ? "暂无说明" : txt_AuditingMemo.Text) + ";]");

            #region 保存数据
            using (var ts = new TransactionScope(TransactionScopeOption.Required))
            {
                try
                {
                    _costReportBill.Updatelmshop_CostReportBillForPassByReportId(model.ReportId, false);
                    _costReport.UpdateReport(model.ReportId, state, txt_AuditingMemo.Text, memo, Personnel.PersonnelId);
                    //添加操作日志
                    _operationLogManager.Add(Personnel.PersonnelId, Personnel.RealName, model.ReportId, model.ReportNo, OperationPoint.CostDeclare.AuditDeclare.GetBusinessInfo(), 1, "");

                    ts.Complete();
                    MessageBox.AppendScript(this, "setTimeout(function(){ CloseAndRebind(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
                }
                catch
                {
                    MessageBox.Show(this, "保存失败!");
                }
            }
            #endregion
        }
Пример #18
0
        protected void IbExportDataClick(object sender, ImageClickEventArgs e)
        {
            string fileName = Regex.Replace(RCB_SalesType.Text, @"[\s\|\-\/\<>\*\?\\]", "");

            if (EndTime == DateTime.MinValue)
            {
                fileName += "-" + WebControl.GetNowTime().ToShortDateString();
            }
            else
            {
                fileName += "-" + StartTime.ToShortDateString() + "-" + EndTime.ToShortDateString();
            }
            fileName = Server.UrlEncode(fileName);
            StockGrid.ExportSettings.ExportOnlyData = false;
            StockGrid.ExportSettings.IgnorePaging   = true;
            StockGrid.ExportSettings.FileName       = fileName;
            StockGrid.MasterTableView.ExportToExcel();
        }
Пример #19
0
        //发票认证完成
        protected void imgbtn_Verification_Click(object sender, EventArgs e)
        {
            var invoiceId = ((ImageButton)sender).CommandArgument;
            CompanyFundReceiptInvoiceInfo model =
                _companyFundReceiptInvoice.Getlmshop_CompanyFundReceiptInvoiceByInvoiceId(new Guid(invoiceId));

            if (model.InvoiceState.Equals((int)CompanyFundReceiptInvoiceState.Authenticate))
            {
                string remark = WebControl.RetrunUserAndTime("【发票认证完成】");
                _companyFundReceiptInvoice.Updatelmshop_CompanyFundReceiptInvoiceByInvoiceId(remark, new Guid(invoiceId),
                                                                                             (int)CompanyFundReceiptInvoiceState.Verification);
                MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
            else
            {
                MessageBox.Show(this, "状态已更新,不允许此操作!");
            }
        }
Пример #20
0
        /// <summary>编辑
        /// </summary>
        protected void RadGrid_InvoiceRollList_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem = e.Item as GridEditableItem;

            if (editedItem != null)
            {
                var textBoxReceiptor        = editedItem.FindControl("TextBox_Receiptor") as TextBox;
                var textBoxInvoiceCode      = editedItem.FindControl("TextBox_InvoiceCode") as TextBox;
                var textBoxInvoiceStartNo   = editedItem.FindControl("TextBox_InvoiceStartNo") as TextBox;
                var textBoxInvoiceEndNo     = editedItem.FindControl("TextBox_InvoiceEndNo") as TextBox;
                var textBoxInvoiceRollCount = editedItem.FindControl("TextBox_InvoiceRollCount") as TextBox;
                var radDatePickerTime       = editedItem.FindControl("RadDatePicker_Time") as RadDatePicker;
                var radComboBoxFiliale      = editedItem.FindControl("RCB_Filiale") as RadComboBox;
                var invoiceRollInfo         = new Keede.Ecsoft.Model.InvoiceRoll
                {
                    Id               = new Guid(editedItem.GetDataKeyValue("Id").ToString()),
                    Receiptor        = textBoxReceiptor != null ? textBoxReceiptor.Text : string.Empty,
                    InvoiceCode      = textBoxInvoiceCode != null ? textBoxInvoiceCode.Text : string.Empty,
                    InvoiceStartNo   = textBoxInvoiceStartNo == null ? 0 : int.Parse(string.IsNullOrEmpty(textBoxInvoiceStartNo.Text.Trim()) ? "0" : textBoxInvoiceStartNo.Text.Trim()),
                    InvoiceEndNo     = textBoxInvoiceEndNo == null ? 0 : int.Parse(string.IsNullOrEmpty(textBoxInvoiceEndNo.Text.Trim()) ? "0" : textBoxInvoiceEndNo.Text.Trim()),
                    InvoiceRollCount = textBoxInvoiceRollCount == null ? 0 : int.Parse(string.IsNullOrEmpty(textBoxInvoiceRollCount.Text.Trim()) ? "0" : textBoxInvoiceRollCount.Text.Trim()),
                    CreateTime       = radDatePickerTime != null ? radDatePickerTime.SelectedDate ?? DateTime.Now : DateTime.Now,
                    FilialeId        = radComboBoxFiliale != null ? new Guid(radComboBoxFiliale.SelectedValue) : Guid.Empty
                };
                invoiceRollInfo.InvoiceCount = invoiceRollInfo.InvoiceEndNo - invoiceRollInfo.InvoiceStartNo + 1;
                if (invoiceRollInfo.InvoiceCount < 1)
                {
                    RAM.Alert("发票份数是:" + invoiceRollInfo.InvoiceCount + "份,填写发票号码错误");
                    return;
                }
                var success = Invoice.WriteInstance.UpdateInvoiceRoll(invoiceRollInfo);
                if (success)
                {
                    var personnelInfo = CurrentSession.Personnel.Get();
                    //发票库管理编辑操作记录添加
                    WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, invoiceRollInfo.Id, invoiceRollInfo.InvoiceCode, OperationPoint.InvoiceStorageManage.Edit.GetBusinessInfo(), string.Empty);
                    ReadInvoiceRollList();
                }
                else
                {
                    RAM.Alert("编辑发票失败,其中的发票卷可能分发在打印了");
                }
            }
        }
        protected void StockGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            decimal total         = 0;
            int     totalQuantity = 0;

            if (IsPostBack)
            {
                WarehouseId = new Guid(RCB_Warehouse.SelectedValue);
                var goodsList = _storageRecordDao.GetGoodsOutInStorageStatisticsList(StorageType, StartTime, EndTime, CompanyId, GlobalConfig.KeepYear, HostingFilialeId, WarehouseId);
                StockGrid.DataSource = goodsList;
                foreach (var goodsOutInStorageStatisticsInfo in goodsList)
                {
                    if (goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.BuyStockIn ||
                        goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.BorrowIn ||
                        goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.LendIn ||
                        goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.SellReturnIn)
                    {
                        total         += Math.Abs(goodsOutInStorageStatisticsInfo.TotalPrice);
                        totalQuantity += goodsOutInStorageStatisticsInfo.Quantity;
                    }
                    if (goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.BuyStockOut ||
                        goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.AfterSaleOut ||
                        goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.BorrowOut ||
                        goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.LendOut ||
                        goodsOutInStorageStatisticsInfo.StorageType == (int)StorageRecordType.SellStockOut)
                    {
                        total         -= Math.Abs(goodsOutInStorageStatisticsInfo.TotalPrice);
                        totalQuantity -= goodsOutInStorageStatisticsInfo.Quantity;
                    }
                }
                TotalAmount   = WebControl.NumberSeparator(total);
                TotalQuantity = WebControl.NumberSeparator(totalQuantity);
            }
            else
            {
                StockGrid.DataSource = new List <GoodsOutInStorageStatisticsInfo>();
                TotalAmount          = "0";
            }
            var totalPrice = StockGrid.MasterTableView.Columns.FindByUniqueName("ToalAmount");
            var quantity   = StockGrid.MasterTableView.Columns.FindByUniqueName("Quantity");

            totalPrice.FooterText = total > 0 ? string.Format("合计:{0}", WebControl.NumberSeparator(total)) : string.Empty;
            quantity.FooterText   = totalQuantity > 0 ? string.Format("合计:{0}", WebControl.NumberSeparator(totalQuantity)) : string.Empty;
        }
Пример #22
0
        /// <summary>保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnTextChanged_CompactMoney(object sender, EventArgs e)
        {
            try
            {
                var tbCompactMoney = (TextBox)sender;
                var dataItem       = (GridDataItem)tbCompactMoney.Parent.Parent;
                var companyId      = dataItem.GetDataKeyValue("CompanyId");
                var compactMoney   = WebControl.NumberRecovery(tbCompactMoney.Text);

                //正则表达式
                if (Regex.IsMatch(compactMoney, @"^(([1-9]\d{0,9})|0)(\.\d{1,2})?$"))
                {
                    var info = new ProcurementCompactQuantityInfo
                    {
                        CompanyId    = new Guid(companyId.ToString()),
                        DateYear     = DateYear,
                        CompactMoney = Convert.ToDecimal(compactMoney)
                    };
                    var result = _procurementCompactQuantityDal.SaveProcurementCompactQuantity(info);
                    if (!result)
                    {
                        RAM.Alert("系统提示:数据保存异常,请尝试刷新后继续操作!");
                    }
                    else
                    {
                        RadGridProcurementCompactQuantity.Rebind();
                    }
                }
                else
                {
                    var companyInfo = _companyCussent.GetCompanyCussent(new Guid(companyId.ToString()));
                    var companyName = string.Empty;
                    if (companyInfo != null)
                    {
                        companyName = companyInfo.CompanyName;
                    }
                    RAM.Alert(string.Format("系统提示:{0}输入金额格式不正确!(不能设置负值)", companyName));
                }
            }
            catch (Exception)
            {
                RAM.Alert("系统提示:保存异常,请尝试刷新后继续操作!");
            }
        }
Пример #23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="currentNotolled"></param>
        /// <param name="nonceTotolled"></param>
        /// <param name="isChecked"></param>
        /// <returns></returns>
        public string ShowCurrentNotolled(object currentNotolled, object nonceTotolled, object isChecked)
        {
            if (RTVCompanyCussent.SelectedNode == null)
            {
                return("-");
            }
            string toolTips = RTVCompanyCussent.SelectedNode.ToolTip;

            if (!string.IsNullOrWhiteSpace(toolTips) && toolTips == "Filiale" && Convert.ToInt32(isChecked) == 1)
            {
                var current = Convert.ToDecimal(currentNotolled);
                var nonce   = Convert.ToDecimal(nonceTotolled);
                if (current != nonce && current != 0)
                {
                    return(string.Format("<font color='red'>{0}</font>", WebControl.RemoveDecimalEndZero(Convert.ToDecimal(currentNotolled))));
                }
                return(WebControl.RemoveDecimalEndZero(Convert.ToDecimal(currentNotolled)));
            }
            return("0.00");
        }
Пример #24
0
        //添加商品分类
        protected void Add_Click(object sender, EventArgs e)
        {
            try
            {
                GoodsClassInfo goodsClassInfo = NonceGoodsClassInfo;
                goodsClassInfo.GoodsClassFieldList = GoodsClassFieldIdList;
                string errorMessage;
                var    result = _goodsCenterSao.AddClass(goodsClassInfo, out errorMessage);
                if (result)
                {
                    //商品分类添加操作记录添加
                    var personnelInfo = CurrentSession.Personnel.Get();
                    WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, goodsClassInfo.ClassId, "",
                                               OperationPoint.GoodsClassManager.Add.GetBusinessInfo(), "");

                    if (TVGoodsClass.SelectedNode == null)
                    {
                        RadTreeNode addNode = CreateNode(goodsClassInfo.ClassName, false, goodsClassInfo.ClassId.ToString());
                        TVGoodsClass.Nodes.Add(addNode);
                    }
                    else
                    {
                        RadTreeNode currentNode = TVGoodsClass.FindNodeByValue(goodsClassInfo.ParentClassId.ToString());
                        RadTreeNode addNode     = CreateNode(goodsClassInfo.ClassName, false, goodsClassInfo.ClassId.ToString());
                        currentNode.Nodes.Add(addNode);
                        OpenTree(currentNode);
                        BindParentClass();
                    }
                    InsterItem(sender, e);
                }
                else
                {
                    RAM.Alert("商品分类添加失败!操作异常!" + errorMessage);
                }
            }
            catch
            {
                RAM.Alert("产品分类添加失败!");
            }
        }
Пример #25
0
        //删除属性
        protected void FieldGrid_DeleteCommand(object sender, GridCommandEventArgs e)
        {
            var editedItem = (GridDataItem)e.Item;
            var fieldId    = new Guid(editedItem.GetDataKeyValue("FieldId").ToString());

            if (fieldId == Guid.Empty)
            {
                RAM.Alert(string.Format("操作无效!{0}", "FieldId不能空"));
                return;
            }
            try
            {
                string errorMessage;
                var    result = _goodsFieldSao.DeleteField(fieldId, out errorMessage);
                if (result)
                {
                    //商品属性更改操作记录添加
                    var personnelInfo = CurrentSession.Personnel.Get();
                    WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, fieldId, "",
                                               OperationPoint.GoodsAttributeManager.Edit.GetBusinessInfo(), string.Empty);
                    if (editedItem.OwnerTableView.DataMember == "TopField")
                    {
                        FieldGrid.Rebind();
                    }
                    else
                    {
                        editedItem.OwnerTableView.Rebind();
                    }
                }
                else
                {
                    RAM.Alert("操作无效!" + errorMessage);
                }
            }
            catch
            {
                RAM.Alert("商品属性信息删除失败!");
            }
        }
Пример #26
0
        protected void RgCheckInfoNeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            IList <CompanyFundReceiptInfo> list = _companyFundReceipt.GetAllFundReceiptInfoList(new Guid(SelectSaleFilialeId), ReceiptPage.DoReceivePay, Status,
                                                                                                StartTime, EndTime, ReceiptNo, Type).ToList();

            if (BankId != Guid.Empty)
            {
                list = list.Where(ent => ent.PayBankAccountsId == BankId).ToList();
            }
            if (SExecuteTime != DateTime.MinValue)
            {
                list = list.Where(c => c.ExecuteDateTime >= SExecuteTime).ToList();
            }
            if (EExecuteTime != DateTime.MaxValue)
            {
                list = list.Where(c => c.ExecuteDateTime < EExecuteTime).ToList();
            }
            if (list.Count != 0)
            {
                CompanyFundReceiptsList = list;
            }
            if (list.Count > 0)
            {
                BankIds = list.Where(ent => ent.PayBankAccountsId != Guid.Empty).Select(ent => ent.PayBankAccountsId).ToList();
            }
            //合计金额
            var sum = RG_CheckInfo.MasterTableView.Columns.FindByUniqueName("RealityBalance");

            if (list.Count > 0)
            {
                var realityBalanceSum = list.Sum(ent => Math.Abs(ent.RealityBalance));
                sum.FooterText = string.Format("合计:{0}", WebControl.NumberSeparator(realityBalanceSum));
            }
            else
            {
                sum.FooterText = string.Empty;
            }
            RG_CheckInfo.DataSource = list;
        }
Пример #27
0
 protected void OnTextChanged_CostInvoiceLimit(object sender, EventArgs e)
 {
     try
     {
         var tbCostInvoiceLimit = (TextBox)sender;
         var dataItem           = (GridDataItem)tbCostInvoiceLimit.Parent.Parent;
         var filialeId          = dataItem.GetDataKeyValue("FilialeId");
         var costInvoiceLimit   = WebControl.NumberRecovery(tbCostInvoiceLimit.Text);
         //正则表达式
         if (Regex.IsMatch(costInvoiceLimit, @"^(([1-9]\d{0,9})|0)(\.\d{1,2})?$"))
         {
             var info = new CostInvoiceMoneyInfo
             {
                 FilialeId = new Guid(filialeId.ToString()),
                 DateYear  = DateYear,
                 DateMonth = DateMonth,
                 Limit     = Convert.ToDecimal(costInvoiceLimit)
             };
             var result = _costInvoiceMoneyDao.SaveCostInvoiceMoney(info);
             if (!result)
             {
                 RAM.Alert("系统提示:数据保存异常,请尝试刷新后继续操作!");
             }
             else
             {
                 RadGridCostInvoiceMoney.Rebind();
             }
         }
         else
         {
             RAM.Alert("系统提示:输入金额格式不正确!");
         }
     }
     catch (Exception)
     {
         RAM.Alert("系统提示:保存异常,请尝试刷新后继续操作!");
     }
 }
Пример #28
0
 //发票批量认证完成
 protected void btn_BatchVerification_Click(object sender, EventArgs e)
 {
     if (Request["ckId"] != null)
     {
         var errorMsg   = new StringBuilder();
         var invoiceIds = Request["ckId"].Split(',');
         foreach (var item in invoiceIds)
         {
             CompanyFundReceiptInvoiceInfo model =
                 _companyFundReceiptInvoice.Getlmshop_CompanyFundReceiptInvoiceByInvoiceId(new Guid(item));
             if (model.InvoiceState != (int)CompanyFundReceiptInvoiceState.Authenticate)
             {
                 errorMsg.Append("发票号码“").Append(model.InvoiceNo).Append("”状态已更新,不允许此操作!").Append("\\n");
                 continue;
             }
             try
             {
                 string remark = WebControl.RetrunUserAndTime("【发票认证完成】");
                 _companyFundReceiptInvoice.Updatelmshop_CompanyFundReceiptInvoiceByInvoiceId(remark,
                                                                                              new Guid(item), (int)CompanyFundReceiptInvoiceState.Verification);
             }
             catch
             {
                 errorMsg.Append("发票号码“").Append(model.InvoiceNo).Append("”保存失败!").Append("\\n");
             }
         }
         if (!string.IsNullOrEmpty(errorMsg.ToString()))
         {
             MessageBox.Show(this, errorMsg.ToString());
         }
         MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
     }
     else
     {
         MessageBox.Show(this, "请选择相关数据!");
     }
 }
Пример #29
0
        // 增加
        protected void GridGoodsSeries_OnInsertCommand(object sender, GridCommandEventArgs e)
        {
            var    editedItem = (GridEditableItem)e.Item;
            string seriesName = ((TextBox)editedItem.FindControl("TB_SeriesName")).Text;
            var    info       = new GoodsSeriesInfo();

            info.SeriesID   = Guid.NewGuid();
            info.SeriesName = seriesName;

            string errorMessage;
            var    result = _goodsCenterSao.AddSeries(info, out errorMessage);//插入系列

            if (result)
            {
                //记录工作日志
                var personnelInfo = CurrentSession.Personnel.Get();
                WebControl.AddOperationLog(personnelInfo.PersonnelId, personnelInfo.RealName, info.SeriesID, "",
                                           OperationPoint.GoodsSeriesManager.Add.GetBusinessInfo(), string.Empty);
            }
            else
            {
                RAM.Alert("操作无效!" + errorMessage);
            }
        }
Пример #30
0
        private void ShowFooterText(IList <CompanyFundReceiptInfo> list)
        {
            //待索取发票合计显示列(申请金额)
            var realityBalanceColumn = RG_CheckInfo.MasterTableView.Columns.FindByUniqueName("RealityBalance");
            //待认证发票合计显示列(打款日期)
            var finishDateColumn = RG_CheckInfo.MasterTableView.Columns.FindByUniqueName("FinishDate");

            if (list.Count > 0)
            {
                //发票待索取合计
                var sum1 = list.Where(ent => ent.ReceiptStatus == (int)CompanyFundReceiptState.GettingInvoice).Sum(
                    ent => ent.RealityBalance);
                //发票待认证合计
                var sum2 = list.Where(ent => ent.ReceiptStatus == (int)CompanyFundReceiptState.WaitAttestation).Sum(
                    ent => ent.RealityBalance);
                realityBalanceColumn.FooterText = "待索取发票合计:" + WebControl.NumberSeparator(sum1);
                finishDateColumn.FooterText     = "待认证发票合计:" + WebControl.NumberSeparator(sum2);
            }
            else
            {
                realityBalanceColumn.FooterText = "待索取发票合计:0.00";
                finishDateColumn.FooterText     = "待认证发票合计:0.00";
            }
        }