예제 #1
0
        //打款完成
        protected void btn_PayFinish_Click(object sender, EventArgs e)
        {
            #region 验证数据
            if (string.IsNullOrEmpty(RCB_BankAccountsId.SelectedValue))
            {
                MessageBox.Show(this, "请选择“资金账号”!");
                return;
            }
            #endregion

            var idAndSalePlatformIds = Request.QueryString["Paras"].Split(',');
            try
            {
                foreach (var item in idAndSalePlatformIds)
                {
                    var id             = item.Split('&')[0];
                    var salePlatformId = item.Split('&')[1];

                    PayFinish(new Guid(salePlatformId), new Guid(id));
                }
                MessageBox.AppendScript(this, "CloseAndRebind();");
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "打款失败!" + ex.Message);
            }
        }
예제 #2
0
        //保存数据
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            #region 验证数据
            var errorMsg = CheckData();
            if (!string.IsNullOrEmpty(errorMsg))
            {
                MessageBox.Show(this, errorMsg);
                return;
            }
            #endregion

            var invoiceType = Request.QueryString["InvoiceType"];
            if (int.Parse(invoiceType).Equals((int)CostReportInvoiceType.VatInvoice))
            {
            }
            var result = _costReportBill.Updatelmshop_CostReportBillByBillId(CostReportBillInfo);
            if (result)
            {
                string remark = ERP.UI.Web.Common.WebControl.RetrunUserAndTime("【票据修改】");
                _costReportBill.Updatelmshop_CostReportBillRemarkByBillId(remark, CostReportBillInfo.BillId);
                MessageBox.AppendScript(this, "CloseAndRebind();");
            }
            else
            {
                MessageBox.Show(this, "保存失败!");
            }
        }
예제 #3
0
        //退回申请
        protected void btn_ReturnApply_Click(object sender, EventArgs e)
        {
            #region 验证数据
            if (string.IsNullOrEmpty(txt_RefuseReason.Text))
            {
                MessageBox.Show(this, "请填写“拒绝理由”!");
                return;
            }
            #endregion

            var idAndSalePlatformIds = Request.QueryString["Paras"].Split(',');
            try
            {
                foreach (var item in idAndSalePlatformIds)
                {
                    var id             = item.Split('&')[0];
                    var salePlatformId = item.Split('&')[1];

                    ReturnApply(new Guid(salePlatformId), new Guid(id));
                }
                MessageBox.AppendScript(this, "CloseAndRebind();");
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, "退回失败!" + ex.Message);
            }
        }
        //作废
        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, "作废申报失败!");
                }
            }
        }
        //票据接收
        protected void imgbtn_Receive_Click(object sender, EventArgs e)
        {
            var billId               = ((ImageButton)sender).CommandArgument;
            var invoiceType          = ((ImageButton)sender).CommandName;
            CostReportBillInfo model = _costReportBill.Getlmshop_CostReportBillByBillId(new Guid(billId));

            if (model.BillState.Equals((int)CostReportBillState.Submit))
            {
                int    state;
                string remarkMsg = string.Empty;
                if (int.Parse(invoiceType).Equals((int)CostReportInvoiceType.VatInvoice))
                {
                    state     = (int)CostReportBillState.Receive;
                    remarkMsg = "【接收票据】";
                }
                else
                {
                    state     = (int)CostReportBillState.Verification;
                    remarkMsg = "【票据认证完成】";
                }
                var remark = ERP.UI.Web.Common.WebControl.RetrunUserAndTime(remarkMsg);
                _costReportBill.Updatelmshop_CostReportBillByBillId(remark, new Guid(billId), state);
                MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
            else
            {
                MessageBox.Show(this, "状态已更新,不允许此操作!");
            }
        }
예제 #6
0
        //批量强制删除
        protected void btn_ForceDel_Click(object sender, EventArgs e)
        {
            if (Request["ckId"] != null)
            {
                var goodsIdsAndGoodsNamesAndGoodsAuditState = Request["ckId"].Split(',');
                var goodsIdList = goodsIdsAndGoodsNamesAndGoodsAuditState.Select(item => new Guid(item.Split('&')[0])).ToList();

                //删除主商品
                string errorMessage;
                var    personnel = CurrentSession.Personnel.Get();
                var    isSuccess = _goodManager.DeleteGoods(goodsIdList, personnel.RealName, personnel.PersonnelId, out errorMessage);
                if (isSuccess)
                {
                    MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
                    MessageBox.Show(this, "主商品删除成功!");
                }
                else
                {
                    MessageBox.Show(this, "主商品删除失败!");
                }
            }
            else
            {
                MessageBox.Show(this, "请选择相关数据!");
            }
        }
 //批量审批通过
 protected void btn_Pass_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Hid_ReportId.Value))
     {
         var errorMsg  = new StringBuilder();
         var reportIds = Hid_ReportId.Value.Split(',');
         foreach (var item in reportIds)
         {
             CostReportInfo model = _costReport.GetReportByReportId(new Guid(item));
             if (model.State != (int)CostReportState.Auditing)
             {
                 errorMsg.Append("“").Append(model.ReportNo).Append("”状态已更新,不允许此操作!").Append("\\n");
                 continue;
             }
             try
             {
                 AuditPass(model);
             }
             catch
             {
                 errorMsg.Append("“").Append(model.ReportNo).Append("”保存失败!").Append("\\n");
             }
         }
         if (!string.IsNullOrEmpty(errorMsg.ToString()))
         {
             MessageBox.Show(this, errorMsg.ToString());
         }
         MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
     }
 }
예제 #8
0
        //受理不通过
        protected void btn_NoPass_Click(object sender, EventArgs e)
        {
            CostReportInfo model = _costReport.GetReportByReportId(new Guid(Request.QueryString["ReportId"]));

            if (model.State != (int)CostReportState.NoAuditing)
            {
                MessageBox.Show(this, "该单据状态已更新,不允许此操作!");
                return;
            }

            var state = (int)CostReportState.InvoiceNoPass;
            var memo  = ERP.UI.Web.Common.WebControl.RetrunUserAndTime("[【票据受理】:票据不合格;受理说明:" + (string.IsNullOrEmpty(txt_AuditingMemo.Text) ? "暂无说明" : txt_AuditingMemo.Text) + ";]");

            #region 保存数据
            using (var ts = new TransactionScope(TransactionScopeOption.Required))
            {
                try
                {
                    _costReport.UpdateReport(model.ReportId, state, txt_AuditingMemo.Text, memo, Guid.Empty);
                    //添加操作日志
                    _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
        }
예제 #9
0
        //批量受理提示(提示申请单总数、发票总数、收据总数)
        protected void btn_Accept_Click(object sender, EventArgs e)
        {
            Hid_ID.Value = string.Empty;
            if (Request["ckId"] != null)
            {
                var           datas  = Request["ckId"].Split(',');
                List <string> listID = new List <string>();
                foreach (var item in datas)
                {
                    listID.Add(item.Split('&')[0]);
                }

                if (listID.Count > 0)
                {
                    Hid_ID.Value = string.Join(",", listID.ToArray());
                    ArrayList arrayList = _SubsidyPaymentSerivce.GetSumList(Hid_ID.Value.Split(',').ToList());
                    if (arrayList.Count > 0)
                    {
                        lbl_Total.Text            = arrayList[0].ToString();
                        lbl_SumSubsidyAmount.Text = arrayList[1].ToString();
                    }
                }
            }
            else
            {
                RAM.Alert("请选择相关数据!");
                return;
            }
            MessageBox.AppendScript(this, "moveShow();ShowValue('" + Hid_ID.Value + "');");
        }
예제 #10
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, "状态已更新,不允许此操作!");
            }
        }
        //批量操作
        protected void btn_Pass_Click(object sender, EventArgs e)
        {
            var errorMsg = new StringBuilder();

            if (!string.IsNullOrEmpty(Hid_BillId.Value))
            {
                var billIds = Hid_BillId.Value.Split(',');
                foreach (var item in billIds)
                {
                    CostReportBillInfo model = _costReportBill.Getlmshop_CostReportBillByBillId(new Guid(item));
                    if (!model.BillState.ToString().Equals(ddl_BillState.SelectedValue))
                    {
                        errorMsg.Append("“票据号码:").Append(model.BillNo).Append("”不符合“" + ddl_BillState.SelectedItem.Text + "”状态!").Append("\\n");
                        continue;
                    }
                    try
                    {
                        BatchPass(model);
                    }
                    catch
                    {
                        errorMsg.Append("“票据号码:").Append(model.BillNo).Append("”保存失败!").Append("\\n");
                    }
                }
                if (!string.IsNullOrEmpty(errorMsg.ToString()))
                {
                    MessageBox.Show(this, errorMsg.ToString());
                }
                MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
        }
예제 #12
0
        //受理通过
        protected void btn_Pass_Click(object sender, EventArgs e)
        {
            CostReportInfo model = _costReport.GetReportByReportId(new Guid(Request.QueryString["ReportId"]));

            if (model.State != (int)CostReportState.NoAuditing)
            {
                MessageBox.Show(this, "该单据状态已更新,不允许此操作!");
                return;
            }

            bool isPayBill = false;//是否将票据设置成付款完成

            if (model.ReportKind == (int)CostReportKind.Before)
            {
                //预借款
                BeforeLoan(model, out isPayBill);
            }
            else if (model.ReportKind == (int)CostReportKind.Later)
            {
                //凭证报销
                VoucherPay(model);
            }
            else if (model.ReportKind == (int)CostReportKind.Paying)
            {
                isPayBill = true;
                //已扣款核销
                PayVerification(model);
            }
            model.AuditingMemo = txt_AuditingMemo.Text;
            model.AcceptDate   = DateTime.Now;

            #region 保存数据
            using (var ts = new TransactionScope(TransactionScopeOption.Required))
            {
                try
                {
                    _costReportBill.Updatelmshop_CostReportBillForPassByReportId(model.ReportId, true);
                    if (isPayBill)
                    {
                        _utility.UpdateFieldByPk("lmShop_CostReportBill", "IsPay", new object[] { true }, "ReportId", model.ReportId.ToString());
                    }
                    _costReport.UpdateReport(model);

                    //添加操作日志
                    _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
        }
        //更改状态
        public void btn_CheckState_Click(object sender, EventArgs e)
        {
            var id     = Hid_Id.Value;
            var state  = Hid_State.Value;
            var result = _vocabulary.UpdateStateById(new Guid(id), int.Parse(state));

            if (result)
            {
                MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
        }
예제 #14
0
        //审阅
        protected void btn_Review_Click(object sender, EventArgs e)
        {
            var result = _utility.UpdateFieldByPk("lmShop_CostReport", "ReviewState", new object[] { 1 }, "ReportId", Request.QueryString["ReportId"]);

            if (result > 0)
            {
                MessageBox.AppendScript(this, "setTimeout(function(){ CloseAndRebind(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
            else
            {
                MessageBox.Show(this, "审阅失败!");
            }
        }
        //批量操作提示(提示票据单总数、含税金额)
        protected void btn_Batch_Click(object sender, EventArgs e)
        {
            Hid_BillId.Value         = string.Empty;
            lit_AuthenticateMsg.Text = string.Empty;
            lit_Msg.Text             = string.Empty;
            var errorMsg = new StringBuilder();

            if (Request["ckId"] != null)
            {
                var    datas   = Request["ckId"].Split(',');
                string billIds = string.Empty;
                foreach (var item in datas)
                {
                    var billId    = item.Split('&')[0];
                    var billState = item.Split('&')[1];
                    var billNo    = item.Split('&')[2];
                    if (!billState.Equals(ddl_BillState.SelectedValue))
                    {
                        errorMsg.Append("“票据号码:").Append(billNo).Append("”不符合“" + ddl_BillState.SelectedItem.Text + "”状态!").Append("<br/>");
                        continue;
                    }
                    billIds += "," + billId;
                }

                if (!string.IsNullOrEmpty(billIds))
                {
                    Hid_BillId.Value = billIds.Substring(1);
                    ArrayList arrayList = _costReportBill.GetSumBill(Hid_BillId.Value.Split(','));
                    if (arrayList.Count > 0)
                    {
                        errorMsg.Append("<b>票据单</b><span style='color:red; padding:0 5px 0 5px;'>" + arrayList[0] + "</span>张、<b>含税金额</b><span style='color:red; padding:0 5px 0 5px;'>" + ERP.UI.Web.Common.WebControl.RemoveDecimalEndZero(decimal.Parse(arrayList[1].ToString())) + "</span>元");
                    }
                }
            }
            else
            {
                errorMsg.Append("<span style='color:red;'>请选择相关数据!</span>");
            }

            if (Hid_Type.Value.Equals("1"))
            {
                lit_Msg.Text = errorMsg.ToString();
                MessageBox.AppendScript(this, "ShowValue('" + Hid_BillId.Value + "');moveShow();");
            }
            else if (Hid_Type.Value.Equals("2"))
            {
                lit_AuthenticateMsg.Text = errorMsg.ToString();
                MessageBox.AppendScript(this, "ShowValue('" + Hid_BillId.Value + "');moveShowAuthenticate('" + Hid_BillId.Value + "');");
            }
        }
        //生成Txt
        protected void btn_Txt_Click(object sender, EventArgs e)
        {
            var vocabularyInfoList = _vocabulary.GetVocabularyListByVocabularyName(string.Empty);

            if (vocabularyInfoList.Count == 0)
            {
                MessageBox.Show(this, "没有可生成的数据!");
                return;
            }
            var errorMsg = string.Empty;

            try
            {
                #region 将上传文件保存至临时文件夹
                string folderPath = "~/UserDir/Vocabulary/Export/";
                if (!Directory.Exists(Server.MapPath(folderPath)))
                {
                    Directory.CreateDirectory(Server.MapPath(folderPath));
                }
                var filePath = Server.MapPath(folderPath + "bannedword.txt");
                #endregion

                #region 创建并写入文件
                //如果文件不存在,创建文件;如果存在,覆盖文件; true:追加, false:覆盖原文件
                StreamWriter sw = new StreamWriter(filePath, false, Encoding.UTF8);
                foreach (var item in vocabularyInfoList)
                {
                    //开始写入
                    sw.Write(item.VocabularyName + "\r\n");
                }
                //清空缓冲区
                sw.Flush();
                //关闭流
                sw.Close();
                #endregion
            }
            catch (Exception ex)
            {
                errorMsg = ex.Message;
            }
            if (string.IsNullOrEmpty(errorMsg))
            {
                MessageBox.AppendScript(this, "document.getElementById(\"a_Look\").click();");
            }
            else
            {
                MessageBox.Show(this, errorMsg);
            }
        }
        //删除
        protected void btn_Del_Click(object sender, EventArgs e)
        {
            var id     = ((Button)sender).CommandArgument;
            var result = _vocabulary.DelById(new string[] { id });

            if (result)
            {
                MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
                MessageBox.Show(this, "删除成功!");
            }
            else
            {
                MessageBox.Show(this, "删除失败!");
            }
        }
        //批量操作
        protected void btn_Batch_Click(object sender, EventArgs e)
        {
            Hid_SelectedValue.Value = string.Empty;
            string  paras       = string.Empty;
            decimal amountTotal = 0;
            int     count       = 0;
            string  filialeId   = string.Empty;
            var     errorMsg    = new StringBuilder();

            if (Request["ckId"] != null)
            {
                var datas = Request["ckId"].Split(',');
                foreach (var item in datas)
                {
                    var parameter     = item.Split('$')[0];
                    var amount        = item.Split('$')[1];
                    var saleFilialeId = item.Split('$')[2];
                    var userName      = item.Split('$')[3];

                    if (string.IsNullOrEmpty(filialeId))
                    {
                        filialeId = saleFilialeId;
                    }

                    if (!filialeId.Equals(saleFilialeId))
                    {
                        errorMsg.Append("所选数据不属于同一个销售公司,请重新选择!").Append("\\n");
                    }
                    paras       += "," + parameter;
                    amountTotal += decimal.Parse(amount);
                    count++;
                }
            }
            else
            {
                errorMsg.Append("请选择相关数据!");
            }

            if (!string.IsNullOrEmpty(errorMsg.ToString()))
            {
                MessageBox.Show(this, errorMsg.ToString());
            }
            else
            {
                Hid_SelectedValue.Value = paras.Substring(1);
                MessageBox.AppendScript(this, "$(function () {ShowValue('" + Hid_SelectedValue.Value + "');BatchOperate('" + Server.UrlEncode(paras.Substring(1)) + "','" + filialeId + "','" + amountTotal + "','" + count + "');});");
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadSaleFilialeData();   //销售公司
         LoadOrderTypeData();     //订单类型
         LoadSalePlatformeData(); //所有销售平台及门店数据
         txt_YearAndMonth.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
         txt_StartTime.Text    = DateTime.Now.ToString("yyyy-MM-01");
         txt_EndTime.Text      = DateTime.Now.ToString("yyyy-MM-dd");
     }
     else
     {
         MessageBox.AppendScript(this, "ShowValue('" + Hid_SalePlatform.Value + "','SalePlatform');ShowValue('" + Hid_OrderType.Value + "','OrderType');");
     }
 }
        //退回
        protected void imgbtn_Back_Click(object sender, EventArgs e)
        {
            var billId = ((ImageButton)sender).CommandArgument;
            CostReportBillInfo model = _costReportBill.Getlmshop_CostReportBillByBillId(new Guid(billId));

            if (!model.BillState.Equals((int)CostReportBillState.UnSubmit))
            {
                string remark = ERP.UI.Web.Common.WebControl.RetrunUserAndTime("【票据退回】");
                _costReportBill.Updatelmshop_CostReportBillByBillId(remark, new Guid(billId), (int)CostReportBillState.UnSubmit);
                MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
            else
            {
                MessageBox.Show(this, "状态已更新,不允许此操作!");
            }
        }
예제 #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         LoadStateData();         //处理状态
         LoadReportKindData();    //申报类型
         LoadAssumeFilialeData(); //结算公司
         LoadBillStateData();     //票据状态
         LoadCostSortData();      //加载费用分类
     }
     //判断登录用户是否有此操作的权限
     if (GetPowerOperationPoint("Review"))
     {
         ReportCost.Visible = ddlReportCost.Visible = ReviewState.Visible = ddlReviewState.Visible = true;
     }
     MessageBox.AppendScript(this, "ShowValue('" + Hid_State.Value + "');");
 }
예제 #22
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
        }
예제 #23
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, "状态已更新,不允许此操作!");
            }
        }
        //票据删除
        protected void imgbtn_Del_Click(object sender, EventArgs e)
        {
            var billId = ((ImageButton)sender).CommandArgument;
            CostReportBillInfo model = _costReportBill.Getlmshop_CostReportBillByBillId(new Guid(billId));

            if (model.BillState.Equals((int)CostReportBillState.UnSubmit))
            {
                var result = _costReportBill.Deletelmshop_CostReportBillByBillId(new Guid(billId));
                if (result)
                {
                    MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
                }
            }
            else
            {
                MessageBox.Show(this, "状态已更新,不允许此操作!");
            }
        }
        /// <summary>
        /// 订单类型
        /// </summary>
        protected void LoadOrderTypeData()
        {
            OrderType = new Dictionary <int, string>
            {
                { -1, "全部" },
                { 0, "网络发货订单" },
                { 1, "门店采购订单" },
                { 2, "帮门店发货订单" }
            };
            Rcb_OrderType.DataSource     = OrderType;
            Rcb_OrderType.DataTextField  = "Value";
            Rcb_OrderType.DataValueField = "Key";
            Rcb_OrderType.DataBind();

            #region 默认展示“网络发货订单”,“帮门店发货订单”
            Hid_OrderType.Value = "0,2";
            MessageBox.AppendScript(this, "ShowValue('" + Hid_OrderType.Value + "','OrderType');");
            #endregion
        }
 //批量删除
 protected void btn_BatchDel_Click(object sender, EventArgs e)
 {
     if (Request["ckId"] != null)
     {
         var result = _vocabulary.DelById(Request["ckId"].Split(','));
         if (result)
         {
             MessageBox.AppendScript(this, "setTimeout(function(){ refreshGrid(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
             MessageBox.Show(this, "批量删除成功!");
         }
         else
         {
             MessageBox.Show(this, "批量删除失败!");
         }
     }
     else
     {
         MessageBox.Show(this, "请选择相关数据!");
     }
 }
예제 #27
0
        //保存数据
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            #region 验证数据
            var errorMsg = CheckData();
            if (!string.IsNullOrEmpty(errorMsg))
            {
                MessageBox.Show(this, errorMsg);
                return;
            }
            #endregion

            CostReportBillInfo.BillUnit    = txt_BillUnit.Text;
            CostReportBillInfo.BillDate    = DateTime.Parse(txt_BillDate.Text);
            CostReportBillInfo.NoTaxAmount = decimal.Parse(txt_NoTaxAmount.Text);
            CostReportBillInfo.Tax         = decimal.Parse(txt_Tax.Text);
            CostReportBillInfo.BillNo      = txt_BillNo.Text;
            CostReportBillInfo.TaxAmount   = decimal.Parse(txt_TaxAmount.Text);
            CostReportBillInfo.BillCode    = txt_BillCode.Text;
            CostReportBillInfo.Memo        = txt_Memo.Text;
            var invoiceType = Request.QueryString["InvoiceType"];
            if (int.Parse(invoiceType).Equals((int)CostReportInvoiceType.VatInvoice))
            {
                if ((decimal.Parse(txt_NoTaxAmount.Text) + decimal.Parse(txt_Tax.Text)) != decimal.Parse(txt_TaxAmount.Text))
                {
                    MessageBox.Show(this, "“未税金额”+“税额”≠“含税金额”!");
                    return;
                }
            }
            var result = _costReportBill.Updatelmshop_CostReportBillByBillId(CostReportBillInfo);
            if (result)
            {
                string remark = ERP.UI.Web.Common.WebControl.RetrunUserAndTime("【票据修改】");
                _costReportBill.Updatelmshop_CostReportBillRemarkByBillId(remark, CostReportBillInfo.BillId);
                MessageBox.AppendScript(this, "setTimeout(function(){ CloseAndRebind(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
            }
            else
            {
                MessageBox.Show(this, "保存失败!");
            }
        }
        /// <summary>
        /// 申请人转移
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            if (Request["ckId"] != null)
            {
                var arrReportId  = Request["ckId"].Split(',');
                var reportIdlist = new List <Guid>();
                foreach (var item in arrReportId)
                {
                    reportIdlist.Add(new Guid(item));
                }

                var result = _costReport.UpdateReportPersonnelIdByReportId(reportIdlist, new Guid(hf_newReportPersonnel.Value));
                if (!result)
                {
                    MessageBox.Show(this, "转派失败!");
                }
                else
                {
                    MessageBox.AppendScript(this, "setTimeout(function(){ CloseAndRebind(); }, " + GlobalConfig.PageAutoRefreshDelayTime + ");");
                }
            }
        }
        //批量审批提示(提示申请单总数、申报金额)
        protected void btn_Audit_Click(object sender, EventArgs e)
        {
            Hid_ReportId.Value = string.Empty;
            var errorMsg = new StringBuilder();

            if (Request["ckId"] != null)
            {
                var    datas     = Request["ckId"].Split(',');
                string reportIds = string.Empty;
                foreach (var item in datas)
                {
                    var reportId = item.Split('&')[0];
                    var state    = item.Split('&')[1];
                    var reportNo = item.Split('&')[2];
                    if (!int.Parse(state).Equals((int)CostReportState.Auditing))
                    {
                        errorMsg.Append("“").Append(reportNo).Append("”状态已更新,不允许此操作!").Append("<br/>");
                        continue;
                    }
                    reportIds += "," + reportId;
                }

                if (!string.IsNullOrEmpty(reportIds))
                {
                    Hid_ReportId.Value = reportIds.Substring(1);
                    ArrayList arrayList = _costReport.GetSumReport(Hid_ReportId.Value.Split(','));
                    if (arrayList.Count > 0)
                    {
                        errorMsg.Append("<b>申请单</b><span style='color:red; padding:0 5px 0 5px;'>" + arrayList[0] + "</span>张、<b>申报金额</b><span style='color:red; padding:0 5px 0 5px;'>" + ERP.UI.Web.Common.WebControl.RemoveDecimalEndZero(decimal.Parse(arrayList[1].ToString())) + "</span>元");
                    }
                }
            }
            else
            {
                errorMsg.Append("<span style='color:red;'>请选择相关数据!</span>");
            }
            lit_Msg.Text = errorMsg.ToString();
            MessageBox.AppendScript(this, "moveShow();ShowValue('" + Hid_ReportId.Value + "');");
        }
예제 #30
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, "请选择相关数据!");
     }
 }