Ejemplo n.º 1
0
        private void btnSave()
        {
            IList <string> entStrList = RequestData.GetList <string>("data");

            if (entStrList != null && entStrList.Count > 0)
            {
                IList <SysApproveConfig> ents = entStrList.Select(tent => JsonHelper.GetObject <SysApproveConfig>(tent) as SysApproveConfig).ToList();

                foreach (SysApproveConfig ent in ents)
                {
                    if (ent != null)
                    {
                        SysApproveConfig tent = ent;

                        if (String.IsNullOrEmpty(tent.Id))
                        {
                            tent.CreateId   = UserInfo.UserID;
                            tent.CreateName = UserInfo.Name;
                        }
                        else
                        {
                            tent = DataHelper.MergeData(SysApproveConfig.Find(tent.Id), tent);
                        }

                        tent.DoSave();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SysApproveConfig ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <SysApproveConfig>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    DoBatchDelete();
                }
                else if (RequestActionString == "batchsave")
                {
                    btnSave();
                }
                else
                {
                    DoSelect();
                }
                break;
            }
        }
Ejemplo n.º 3
0
        private void DoBatchDelete()
        {
            IList <object> idList = RequestData.GetList <object>("IdList");

            if (idList != null && idList.Count > 0)
            {
                SysApproveConfig.DoBatchDelete(idList.ToArray());
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 查询
 /// </summary>
 private void DoSelect()
 {
     ents = SysApproveConfig.FindAll(SearchCriterion);
     this.PageState.Add("SysApproveConfigList", ents);
 }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            op         = RequestData.Get <string>("op");
            id         = RequestData.Get <string>("id");
            type       = RequestData.Get <string>("type");
            JsonString = RequestData.Get <string>("JsonString");
            if (!string.IsNullOrEmpty(id))
            {
                ent = EmpInsurance.Find(id);
            }
            switch (RequestActionString)
            {
            case "update":
                if (!string.IsNullOrEmpty(JsonString))
                {
                    ent = JsonHelper.GetObject <EmpInsurance>(JsonString);
                }
                if (string.IsNullOrEmpty(ent.Id))
                {
                    ent.CreateId   = UserInfo.UserID;
                    ent.CreateName = UserInfo.Name;
                    ent.CreateTime = DateTime.Now;
                    ent.DoCreate();
                }
                else
                {
                    ent.DoUpdate();
                }
                ent.State = "待提交";
                PageState.Add("Id", ent.Id);
                break;

            case "submit":
                if (!string.IsNullOrEmpty(JsonString))
                {
                    ent = JsonHelper.GetObject <EmpInsurance>(JsonString);
                }
                ent.ApplyTime = DateTime.Now;    //申请时间在提交审批的时候赋值
                if (string.IsNullOrEmpty(ent.Id))
                {
                    ent.CreateId   = UserInfo.UserID;
                    ent.CreateName = UserInfo.Name;
                    ent.CreateTime = DateTime.Now;
                    ent.DoCreate();
                }
                IList <SysApproveConfig> sacEnts = SysApproveConfig.FindAll();
                if (sacEnts.Count > 0)
                {
                    ent.ApproveUserId = sacEnts[0].ChildWelfareId;
                    ent.ApproveName   = sacEnts[0].ChildWelfareName;
                }
                ent.State = "已提交";
                ent.DoUpdate();
                PageState.Add("Id", ent.Id);
                break;

            case "GetWorkNo":
                string     UserID = RequestData.Get("UserID") + "";
                ComUtility Ut     = new ComUtility();
                PageState.Add("WorkNo", Ut.GetWorkNo(UserID));
                break;

            default:
                DoSelect();
                break;
            }
        }