Ejemplo n.º 1
0
 /// <summary>
 /// 页面初始化
 /// </summary>
 private void PageInit()
 {
     txtCreatePerson.ReadOnly = true;
     txtCreateDate.Attributes.Add("onfocus", "new WdatePicker(this,'%Y-%M-%D',true)");
     if (string.IsNullOrEmpty(Request["id"]) && Model == null)
     {
         Model = new FactoringDataMaster()
         {
             DocState = DocumentState.Edit
         };
         hidIsNew.Value  = "True";
         hidIsEdit.Value = "True";
     }
     else
     {
         string masterId  = string.IsNullOrEmpty(Request["id"]) ? "1thVqInvX9KR74bWUvsqP0" : Request["id"];
         string pageState = Request["pageState"];
         Model = service.GetFactoringDataById(masterId);
         if (Model == null)
         {
             // 没有获取到数据
             hidIsDeleted.Value = "True";
             Model = new FactoringDataMaster();
             return;
         }
         hidIsNew.Value = "False";
         InitModel();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加主表记录
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 protected void btn_Add_Master_Click(object sender, EventArgs args)
 {
     if (hid_operateState.Value == "Edit")
     {
         var model = service.GetFactoringDataById(hid_edit_id.Value);
         model.Descript         = txtDescrip.Text;
         model.LastModifyDate   = DateTime.Now;
         model.HandlePersonName = txtHandler.Text;
         service.Update(model);
         var item = ListData.Where(a => a.Id == hid_edit_id.Value).FirstOrDefault();
         item.Descript         = txtDescrip.Text;
         item.HandlePersonName = txtHandler.Text;
     }
     else
     {
         var model = new FactoringDataMaster();
         var user  = Session[PublicClass.sUserInfoID] as SessionInfo;
         model.Descript         = txtDescrip.Text;
         model.LastModifyDate   = DateTime.Now;
         model.HandlePersonName = txtHandler.Text;
         //model.Id = Guid.NewGuid().ToString();
         model.Code             = txtCode.Text;
         model.CreateDate       = DateTime.Now;
         model.CreateYear       = DateTime.Now.Year;
         model.CreateMonth      = DateTime.Now.Month;
         model.CreatePerson     = user.CurrentPersinInfo;
         model.CreatePersonName = user.CurrentPerson.Name;
         model.OperOrgInfo      = user.CurrentOrgInfo;
         model.OperOrgInfoName  = user.CurrentOrgInfo.Name;
         model.DocState         = DocumentState.Edit;
         model.Temp1            = CommonHelper.stateDescripe[Convert.ToInt32(DocumentState.Edit)];
         AddMaster(model);
     }
 }
Ejemplo n.º 3
0
    protected void btn_Add_Master_Click(object sender, EventArgs args)
    {
        if (hid_operateState.Value == "Edit")
        {
            var model = service.GetFactoringDataById(hid_edit_id.Value);
            model.Code             = txtCode.Text;
            model.Descript         = txtDescrip.Text;
            model.LastModifyDate   = DateTime.Now;
            model.HandlePersonName = txtHandler.Text;
            service.Update(model);
        }
        else
        {
            var model = new FactoringDataMaster();
            var user  = Session[PublicClass.sUserInfoID] as SessionInfo;
            model.Descript         = txtDescrip.Text;
            model.LastModifyDate   = DateTime.Now;
            model.HandlePersonName = txtHandler.Text;
            model.Code             = txtCode.Text;
            model.CreateDate       = DateTime.Now;
            model.CreateYear       = DateTime.Now.Year;
            model.CreateMonth      = DateTime.Now.Month;
            model.CreatePerson     = user.CurrentPersinInfo;
            model.OperOrgInfo      = user.CurrentOrgInfo;

            service.Save(model);
        }
    }
Ejemplo n.º 4
0
 /// <summary>
 /// 新增主表记录
 /// </summary>
 /// <param name="model"></param>
 private void AddMaster(FactoringDataMaster model)
 {
     NewMasterList.Add(model);
     ViewState["NewMasterList"] = NewMasterList;
 }