コード例 #1
0
    protected AsTest GetModel()
    {
        AsTest asTest = new AsTest();

        asTest.Id = (string.IsNullOrEmpty(this.Id) ? System.Guid.NewGuid().ToString() : this.Id);
        asTest.ApplicationDate = DateTime.Now;
        asTest.ApplicantId     = this.hlfUserCode.Value.Trim();
        decimal num = string.IsNullOrEmpty(this.Cash.Text.Trim()) ? 0m : System.Convert.ToDecimal(this.Cash.Text.Trim());

        asTest.Cash              = num;
        asTest.FlowState         = -1;
        asTest.ApplicationReason = string.IsNullOrEmpty(this.ApplicationReason.Text.Trim()) ? "" : System.Convert.ToString(this.ApplicationReason.Text.Trim());
        return(asTest);
    }
コード例 #2
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        AsTest model = this.GetModel();

        if (this.type == "Add")
        {
            this.AstSer.Add(model);
        }
        else if (this.type == "Edit")
        {
            this.AstSer.Update(model);
        }
        base.RegisterScript("top.ui.tabSuccess({parentName:'_AsTestList'});");
    }
コード例 #3
0
 protected void Bindpage()
 {
     if (!string.IsNullOrEmpty(this.Id))
     {
         AsTest byId = this.AstSer.GetById(this.Id);
         if (byId != null)
         {
             this.hlfUserCode.Value      = byId.ApplicantId;
             this.ApplicantId.Text       = byId.ApplicantId;
             this.Cash.Text              = byId.Cash.ToString();
             this.ApplicationReason.Text = byId.ApplicationReason.ToString();
         }
     }
 }
コード例 #4
0
    private void Initial()
    {
        AsTest byId = this.AstSer.GetById(this.pcId);

        if (byId != null)
        {
            this.hlfUserCode.Value      = byId.ApplicantId;
            this.ApplicantId.Text       = byId.ApplicantId;
            this.Cash.Text              = byId.Cash.ToString();
            this.ApplicationReason.Text = byId.ApplicationReason.ToString();
        }
        //      AsTestService pTdbmService = new AsTestService();
        //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);
        //	}
        //}
    }