Beispiel #1
0
 public void InitPage()
 {
     if (!string.IsNullOrEmpty(this.Ic))
     {
         this.lblBllProducer.Text = PageHelper.QueryUser(this, base.UserCode);
         this.lblPrintDate.Text   = System.DateTime.Now.ToShortDateString();
         BudPreReimburseModify byId = this.budModifySer.GetById(this.Ic);
         if (byId.CostType == "P")
         {
             this.lblPrjName.Text = this.GetPrjName(byId.PrjId);
             this.lblPrjCode.Text = this.GetPrjCode(byId.PrjId);
         }
         else
         {
             this.lblPrjNameTitle.Text = "部门名称";
             this.lblPrjCodeTitle.Text = "部门全称";
             this.lblPrjName.Text      = this.GetDepName(byId.PrjId);
             this.lblPrjCode.Text      = this.GetDepFullName(byId.PrjId);
         }
         this.lblName.Text      = byId.Name;
         this.lblCode.Text      = byId.Code;
         this.lblInputDate.Text = byId.ApplyDate.ToString("yyyy-M-dd");
         this.lblInputUser.Text = byId.RptUser;
     }
 }
    protected void SaveDiary()
    {
        this.ViewState["ApplyId"] = this.hfldModifyId.Value;
        if (string.IsNullOrEmpty(this.id))
        {
            BudPreReimburseModify budPreReimburseModify = new BudPreReimburseModify();
            budPreReimburseModify.Id        = this.ViewState["guid"].ToString();
            budPreReimburseModify.PrjId     = base.Request["prjId"];
            budPreReimburseModify.Name      = this.txtName.Text.Trim();
            budPreReimburseModify.ApplyDate = Convert.ToDateTime(this.txtInputDate.Text);
            budPreReimburseModify.RptUser   = this.txtInputUser.Text.Trim();
            budPreReimburseModify.Code      = this.txtIndireCode.Text.Trim();
            budPreReimburseModify.CostType  = this.costType;
            budPreReimburseModify.FlowState = -1;
            budPreReimburseModify.InputDate = DateTime.Now;
            budPreReimburseModify.ApplyId   = this.hfldModifyId.Value;
            this.budModifySer.Add(budPreReimburseModify);
            return;
        }
        BudPreReimburseModify byId = this.budModifySer.GetById(this.id);

        if (byId != null)
        {
            byId.PrjId     = base.Request["prjId"];
            byId.Name      = this.txtName.Text.Trim();
            byId.ApplyDate = Convert.ToDateTime(this.txtInputDate.Text);
            byId.RptUser   = this.txtInputUser.Text.Trim();
            byId.Code      = this.txtIndireCode.Text.Trim();
            if (byId.ApplyId != null)
            {
                byId.ApplyId = this.hfldModifyId.Value;
            }
            this.budModifySer.Update(byId);
        }
    }
 protected void btnDel_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(this.hfldPurchaseChecked.Value);
     foreach (string current in listFromJson)
     {
         BudPreReimburseModify byId = this.budModifySer.GetById(current);
         if (byId != null)
         {
             this.budModifySer.Delete(byId);
         }
         else
         {
             base.RegisterScript("找不到要删除的组织机构预报销变更对象");
         }
     }
     this.BindGV();
 }
 protected void SaveEditData()
 {
     if (this.gvDiaryDetails.EditIndex != -1)
     {
         int         editIndex   = this.gvDiaryDetails.EditIndex;
         GridViewRow gridViewRow = this.gvDiaryDetails.Rows[editIndex];
         List <BudPreReimburseModifyDetail> list = this.ViewState["details"] as List <BudPreReimburseModifyDetail>;
         BudPreReimburseModifyDetail        budPreReimburseModifyDetail = list[gridViewRow.RowIndex];
         BudPreReimburseModify budPreReimburseModify = new BudPreReimburseModify();
         this.costType = budPreReimburseModify.CostType;
         TextBox textBox = gridViewRow.Cells[2].FindControl("txtgvName") as TextBox;
         if (textBox != null)
         {
             budPreReimburseModifyDetail.Name = textBox.Text.Trim();
         }
         DropDownList dropDownList = gridViewRow.Cells[3].FindControl("ddlCBSCode") as DropDownList;
         if (dropDownList != null)
         {
             budPreReimburseModifyDetail.CBSCode = dropDownList.SelectedValue;
         }
         TextBox textBox2 = gridViewRow.Cells[4].FindControl("txtBeginAmount") as TextBox;
         if (textBox2 != null)
         {
             budPreReimburseModifyDetail.BeginCost = decimal.Parse(textBox2.Text.Trim());
         }
         TextBox textBox3 = gridViewRow.Cells[5].FindControl("txtAfterAmount") as TextBox;
         if (textBox3 != null)
         {
             budPreReimburseModifyDetail.AfterCost = decimal.Parse(textBox3.Text.Trim());
         }
         TextBox textBox4 = gridViewRow.Cells[6].FindControl("txtModifyReason") as TextBox;
         if (textBox4 != null)
         {
             budPreReimburseModifyDetail.ModifyReason = textBox4.Text.Trim();
         }
         TextBox textBox5 = gridViewRow.Cells[7].FindControl("txtgvNote") as TextBox;
         if (textBox5 != null)
         {
             budPreReimburseModifyDetail.Note = textBox5.Text.Trim();
         }
         this.ViewState["details"] = list;
     }
 }
    protected void InitEditPage()
    {
        BudPreReimburseModify byId = this.budModifySer.GetById(this.id);

        this.txtName.Text       = byId.Name;
        this.txtInputDate.Text  = byId.InputDate.ToString("yyyy-M-dd");
        this.txtInputUser.Text  = byId.RptUser;
        this.txtIndireCode.Text = byId.Code;
        this.hfldModifyId.Value = byId.ApplyId;
        BudPreReimburseApply byId2 = this.budApplySer.GetById(byId.ApplyId);

        if (byId2 != null)
        {
            this.txtIndireCode.Text = byId.Code;
        }
        this.costType             = byId.CostType;
        this.ViewState["guid"]    = base.Request["id"];
        this.ViewState["details"] = this.GetModifyDetails(this.id);
        this.BindDetails();
    }