예제 #1
0
 protected void btnSave_Click(object sender, System.EventArgs e)
 {
     if (string.Compare(this.type, "Add", true) == 0)
     {
         PCPettyCash item = this.CreatePettyCash();
         try
         {
             this.pcSer.Add(item);
             base.RegisterScript("top.ui.tabSuccess({parentName: '_pettycashlist'});");
             return;
         }
         catch (System.Exception)
         {
             base.RegisterScript("top.ui.alert('新增失败');");
             return;
         }
     }
     if (string.Compare(this.type, "Edit", true) == 0)
     {
         PCPettyCash byId = this.pcSer.GetById(this.pcId);
         this.UpdatePettyCash(byId);
         try
         {
             this.pcSer.Update(byId);
             base.RegisterScript("top.ui.tabSuccess({parentName: '_pettycashlist'});");
         }
         catch (System.Exception)
         {
             base.RegisterScript("top.ui.alert('编辑失败');");
         }
     }
 }
예제 #2
0
    public void GetPattyCash()
    {
        PTdbmService             pTdbmService             = new PTdbmService();
        PTYhmcService            pTYhmcService            = new PTYhmcService();
        BasicSerialNumberService basicSerialNumberService = new BasicSerialNumberService();
        PTdbm byId = pTdbmService.GetById(1);

        this.lblTitle.Text       = byId.V_BMMC + "备用金申请表";
        this.lblPayMentDate.Text = System.DateTime.Now.ToShortDateString();
        if (!string.IsNullOrEmpty(this.pcId))
        {
            PCPettyCash byId2 = this.pcSer.GetById(this.pcId);
            if (byId2 != null)
            {
                PTyhmc byId3 = pTYhmcService.GetById(byId2.Applicant);
                PTdbm  byId4 = pTdbmService.GetById(byId3.i_bmdm);
                this.lblDepartMent.Text = byId4.V_BMMC;
                this.lblOperator.Text   = byId3.v_xm;
                this.lblContent.Text    = byId2.Matter;
                this.lblMoney.Text      = byId2.Cash.ToString();
                this.lblTotalMoney.Text = this.lblMoney.Text;
                this.lblDrawPeople.Text = byId3.v_xm;
                this.lblpayee.Text      = byId2.Payee;
                this.lblBank.Text       = byId2.Bank;
                this.lblAccount.Text    = byId2.Account;
                if (byId2.Project != null)
                {
                    this.lblProjectCode.Text = byId2.Project.PrjCode;
                }
                this.lblFileNumber.Text = basicSerialNumberService.GetNo("PC_PettyCash", this.pcId);
            }
        }
    }
예제 #3
0
    private void Initial()
    {
        PTdbmService  pTdbmService  = new PTdbmService();
        PTYhmcService pTYhmcService = new PTYhmcService();
        PTdbm         byId          = pTdbmService.GetById(1);

        this.lblTitle.Text = byId.V_BMMC + "备用金申请表";
        if (!string.IsNullOrEmpty(this.pcId))
        {
            PCPettyCash byId2 = this.pcSer.GetById(this.pcId);
            if (byId2 != null)
            {
                this.hfldPettyCashIds.Value = this.pcId;
                PTyhmc byId3 = pTYhmcService.GetById(byId2.Applicant);
                PTdbm  byId4 = pTdbmService.GetById(byId3.i_bmdm);
                this.lblPayer.Text           = byId2.Payer;
                this.lblApplicationDate.Text = byId2.ApplicationDate.ToString("yyyy-MM-dd");
                this.lblDepart.Text          = byId4.V_BMMC;
                this.lblApplicant.Text       = byId3.v_xm;
                this.lblAccount.Text         = byId2.Account;
                this.lblBank.Text            = byId2.Bank;
                this.lblMatter.Text          = byId2.Matter;
                if (byId2.Project != null)
                {
                    this.lblProject.Text = byId2.Project.PrjName;
                }
                this.lblCash.Text              = byId2.Cash.ToString();
                this.lblpayee.Text             = byId2.Payee;
                this.lblCashDate.Text          = byId2.CashDate.ToString("yyyy-MM-dd");
                this.lblApplicationReason.Text = StringUtility.ReplaceTxt(byId2.ApplicationReason);
            }
        }
    }
예제 #4
0
 public void InitPettyCash()
 {
     if (!string.IsNullOrEmpty(this.pcId))
     {
         PCPettyCash byId = this.pcSer.GetById(this.pcId);
         byId.CleanDate = System.Convert.ToDateTime(this.txtStatetime.Text);
         byId.CleanNote = this.txtNote.Text.Trim();
         byId.State     = "1";
         this.pcSer.Update(byId);
     }
     base.RegisterScript("top.ui.winSuccess({parentName:'_PClearedit'});");
 }
예제 #5
0
    public string GetPettyCashMatter(object pettyCashId)
    {
        PCPettyCashService pCPettyCashService = new PCPettyCashService();

        if (pettyCashId != null)
        {
            PCPettyCash byId = pCPettyCashService.GetById(pettyCashId.ToString());
            if (byId != null)
            {
                return(byId.Matter);
            }
        }
        return(string.Empty);
    }
예제 #6
0
    protected void btnExportExcel_Click(object sender, System.EventArgs e)
    {
        IQueryable <PCPettyCash> source = this.Queryable();

        source =
            from p in source
            orderby p.ApplicationDate descending
            orderby p.InputDate descending
            select p;
        DataTable dataTable = new DataTable();

        dataTable.Columns.Add("序号");
        dataTable.Columns.Add("申请日期");
        dataTable.Columns.Add("申请金额");
        dataTable.Columns.Add("事项");
        dataTable.Columns.Add("用款日期");
        dataTable.Columns.Add("还款状态");
        dataTable.Columns.Add("项目");
        int num = source.Count <PCPettyCash>();

        System.Collections.Generic.List <PCPettyCash> list = source.ToList <PCPettyCash>();
        for (int i = 0; i < num; i++)
        {
            PCPettyCash pCPettyCash = list[i];
            DataRow     dataRow     = dataTable.NewRow();
            dataRow["序号"]   = i + 1;
            dataRow["申请日期"] = pCPettyCash.ApplicationDate.ToString("yyyy-MM-dd");
            dataRow["申请金额"] = pCPettyCash.Cash;
            dataRow["事项"]   = pCPettyCash.Matter;
            dataRow["用款日期"] = pCPettyCash.CashDate.ToString("yyyy-MM-dd");
            dataRow["还款状态"] = Common2.GetStateNoColor(pCPettyCash.RepayFlowState.ToString());
            if (pCPettyCash.Project != null)
            {
                dataRow["项目"] = pCPettyCash.Project.PrjName;
            }
            dataTable.Rows.Add(dataRow);
        }
        string text = "备用金申请.xls";

        if (base.Request.Browser.Browser.ToUpper() != "SAFARI")
        {
            text = HttpUtility.UrlEncode(text, System.Text.Encoding.UTF8);
        }
        ExcelHelper.ExportDataTableToExcel(dataTable, text, "");
    }
예제 #7
0
 public void SaveRepayCash()
 {
     if (!string.IsNullOrEmpty(this.pcId))
     {
         PCPettyCash byId = this.pcSer.GetById(this.pcId);
         byId.RepayCash = (string.IsNullOrEmpty(this.txtReturnMoney.Text) ? 0m : System.Convert.ToDecimal(this.txtReturnMoney.Text));
         decimal d = decimal.Parse(this.txtOweMoney.Text);
         if (byId.RepayCash < d)
         {
             base.RegisterScript("top.ui.alert('还款金额不能小于欠款金额');");
             return;
         }
         byId.RepayFlowState = -1;
         byId.IsRepay        = true;
         this.pcSer.Update(byId);
     }
     base.RegisterScript("top.ui.winSuccess({parentName:'_PcReadyedit'});");
 }
예제 #8
0
    private void Initial()
    {
        PTdbmService  pTdbmService  = new PTdbmService();
        PTYhmcService pTYhmcService = new PTYhmcService();
        PTdbm         byId          = pTdbmService.GetById(1);

        this.lblTitle.Text = byId.V_BMMC + "备用金申请表";
        if (string.Compare(this.type, "Add", true) == 0)
        {
            this.txtPayer.Text           = byId.V_BMMC;
            this.txtApplicationDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
            this.txtCashDate.Text        = System.DateTime.Now.AddDays(3.0).ToString("yyyy-MM-dd");
            PTyhmc byId2 = pTYhmcService.GetById(base.UserCode);
            this.txtApplicant.Text = byId2.v_xm;
            PTdbm byId3 = pTdbmService.GetById(byId2.i_bmdm);
            this.txtDepart.Text = byId3.V_BMMC;
        }
        if (!string.IsNullOrEmpty(this.pcId))
        {
            PCPettyCash byId4 = this.pcSer.GetById(this.pcId);
            if (byId4 != null)
            {
                PTyhmc byId5 = pTYhmcService.GetById(byId4.Applicant);
                PTdbm  byId6 = pTdbmService.GetById(byId5.i_bmdm);
                this.txtPayer.Text           = byId4.Payer;
                this.txtApplicationDate.Text = byId4.ApplicationDate.ToString("yyyy-MM-dd");
                this.txtDepart.Text          = byId6.V_BMMC;
                this.txtApplicant.Text       = byId5.v_xm;
                this.txtAccount.Text         = byId4.Account;
                this.txtBank.Text            = byId4.Bank;
                this.txtMatter.Text          = byId4.Matter;
                if (byId4.Project != null)
                {
                    this.txtProject.Text       = byId4.Project.PrjName;
                    this.hfldPrjTypeCode.Value = byId4.Project.TypeCode;
                }
                this.txtCash.Text              = byId4.Cash.ToString();
                this.txtCashDate.Text          = byId4.CashDate.ToString("yyyy-MM-dd");
                this.txtApplicationReason.Text = byId4.ApplicationReason;
                this.txtpayee.Text             = byId4.Payee;
            }
        }
    }
예제 #9
0
 private void UpdatePettyCash(PCPettyCash pc)
 {
     if (pc != null)
     {
         pc.Payer             = this.txtPayer.Text.Trim();
         pc.ApplicationDate   = System.Convert.ToDateTime(this.txtApplicationDate.Text);
         pc.Applicant         = base.UserCode;
         pc.Account           = this.txtAccount.Text.Trim();
         pc.Bank              = this.txtBank.Text.Trim();
         pc.Matter            = this.txtMatter.Text.Trim();
         pc.PrjTypeCode       = this.hfldPrjTypeCode.Value;
         pc.Cash              = System.Convert.ToDecimal(this.txtCash.Text);
         pc.Payee             = this.txtpayee.Text.Trim();
         pc.CashDate          = System.Convert.ToDateTime(this.txtCashDate.Text);
         pc.ApplicationReason = this.txtApplicationReason.Text.Trim();
         pc.ModifyUser        = base.UserCode;
         pc.ModifyDate        = System.DateTime.Now;
     }
 }
예제 #10
0
    protected void InitPage()
    {
        PCPettyCash byId = this.pcSer.GetById(this.pcId);

        if (byId != null)
        {
            PTyhmc byId2 = this.yhmcSer.GetById(byId.Applicant);
            this.txtApplicant.Text   = byId2.v_xm;
            this.txtDatetime.Text    = byId.ApplicationDate.ToString("yyyy-MM-dd");
            this.txtMoney.Text       = System.Convert.ToString(byId.Cash);
            this.txtMatter.Text      = byId.Matter;
            this.txtCashDate.Text    = byId.CashDate.ToString("yyyy-MM-dd");
            this.txtAmount.Text      = this.GetAmountCash(this.pcId).ToString();
            this.txtAuditAmount.Text = this.GetAuditAmount(this.pcId).ToString();
            this.txtReportMoney.Text = (byId.Cash - this.GetAmountCash(this.pcId)).ToString();
            this.txtOweMoney.Text    = (byId.Cash - this.GetAuditAmount(this.pcId)).ToString();
            if (byId.Project != null)
            {
                this.txtProject.Text = byId.Project.PrjName;
            }
        }
    }
예제 #11
0
    public void InitPage()
    {
        PCPettyCash byId = this.pcSer.GetById(this.Id);

        if (byId != null)
        {
            this.lblBllProducer.Text = PageHelper.QueryUser(this, base.UserCode);
            this.lblPrintDate.Text   = System.DateTime.Now.ToShortDateString();
            this.lblDatetime.Text    = byId.ApplicationDate.ToString("yyyy-MM-dd");
            this.lblMoney.Text       = System.Convert.ToString(byId.Cash);
            this.lblMatter.Text      = byId.Matter;
            this.lblCashDate.Text    = byId.CashDate.ToString("yyyy-MM-dd");
            this.lblAmount.Text      = this.GetAmountCash(this.Id).ToString();
            this.lblAuditAmount.Text = this.GetAuditAmount(this.Id).ToString();
            this.lblReportMoney.Text = (byId.Cash - this.GetAmountCash(this.Id)).ToString();
            this.lblOweMoney.Text    = (byId.Cash - this.GetAuditAmount(this.Id)).ToString();
            this.lblReturnMoney.Text = this.lblOweMoney.Text;
            if (byId.Project != null)
            {
                this.lblProject.Text = byId.Project.PrjName;
            }
        }
    }
예제 #12
0
    protected void InitEditPage()
    {
        BudIndirectDiaryCost byId = this.budInCostSer.GetById(this.id);

        this.txtName.Text          = byId.Name;
        this.txtIndireCode.Text    = byId.IndireCode;
        this.txtDeparment.Text     = byId.Department;
        this.txtInputDate.Text     = byId.InputDate.ToString("yyyy-M-dd");
        this.txtInputUser.Text     = byId.InputUser;
        this.txtPeople.Text        = byId.IssuedBy;
        this.hdnPeople.Value       = byId.InssuedByCode;
        this.hfldPettyCashId.Value = byId.PettyCashId;
        PCPettyCash byId2 = this.pettyCashSer.GetById(byId.PettyCashId);

        if (byId2 != null)
        {
            this.txtConType.Text = byId2.Matter;
        }
        this.costType             = byId.CostType;
        this.ViewState["guid"]    = base.Request["id"];
        this.ViewState["details"] = this.GetDiaryDetails(this.id);
        this.BindDetails();
    }
예제 #13
0
    private void InitDiary()
    {
        BudIndirectDiaryCost byId = this.diarySer.GetById(this.diaryId);

        this.lblName.Text       = byId.Name;
        this.lblInputDate.Text  = byId.InputDate.ToString("yyyy-MM-dd");
        this.lblDepartment.Text = byId.Department;
        this.lblInputUser.Text  = byId.InputUser;
        this.lblIssueBy.Text    = byId.IssuedBy;
        this.lblCode.Text       = byId.IndireCode;
        if (byId.CostType == "P")
        {
            PTPrjInfoService pTPrjInfoService = new PTPrjInfoService();
            PTPrjInfo        byId2            = pTPrjInfoService.GetById(byId.ProjectId);
            if (byId2 != null)
            {
                this.lblPrjName.Text = byId2.PrjName;
            }
        }
        else
        {
            this.ltlCostTypeName.Text = "组织机构";
            PTdbmService pTdbmService = new PTdbmService();
            PTdbm        byId3        = pTdbmService.GetById(byId.ProjectId);
            if (byId3 != null)
            {
                this.lblPrjName.Text = byId3.V_bmqc;
            }
        }
        PCPettyCashService pCPettyCashService = new PCPettyCashService();
        PCPettyCash        byId4 = pCPettyCashService.GetById(byId.PettyCashId);

        if (byId4 != null)
        {
            this.lblPettyCash.Text = byId4.Matter;
        }
    }