예제 #1
0
        /// <summary>
        /// 修改主表单
        /// </summary>
        /// <param name="ctx"></param>
        private void EditMainForm(HttpContext ctx)
        {
            try
            {
                var    returnValue           = -1;
                var    vUser                 = Utils.UserInfo;
                string id                    = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("keyId"));
                MainUserControlEntity entity = null;
                if (!string.IsNullOrEmpty(id))
                {
                    var dtTemp = RDIFrameworkService.Instance.WorkFlowUserControlService.GetMainUserControl(Utils.UserInfo, id);
                    if (dtTemp != null && dtTemp.Rows.Count > 0)
                    {
                        entity = BaseEntity.Create <MainUserControlEntity>(dtTemp);
                        entity = this.GetPageMainUserControlEntity(entity);
                    }
                }
                returnValue = RDIFrameworkService.Instance.WorkFlowUserControlService.UpdateMainUserCtrl(vUser, entity);

                ctx.Response.Write(returnValue > 0
                    ? new JsonMessage {
                    Success = true, Data = "1", Message = "修改成功!"
                }.ToString()
                    : new JsonMessage {
                    Success = false, Data = "0", Message = "修改失败"
                }.ToString());
            }
            catch (Exception ex)
            {
                ctx.Response.Write(new JsonMessage {
                    Success = false, Data = "-1", Message = "操作失败!" + ex.Message
                }.ToString());
            }
        }
예제 #2
0
 private MainUserControlEntity GetPageMainUserControlEntity(MainUserControlEntity entity)
 {
     entity.FullName    = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("FullName"));
     entity.Description = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("Description"));
     entity.Enabled     = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("Enabled")) == "on" ? 1 : 0;
     return(entity);
 }
예제 #3
0
        /// <summary>
        /// 增加主表单
        /// </summary>
        /// <param name="ctx"></param>
        private void AddMainForm(HttpContext ctx)
        {
            var entity = new MainUserControlEntity();
            var vUser  = Utils.UserInfo;

            entity            = this.GetPageMainUserControlEntity(entity);
            entity.Id         = BusinessLogic.NewGuid();
            entity.DeleteMark = 0;

            try
            {
                var statusMessage = RDIFrameworkService.Instance.WorkFlowUserControlService.InsertMainUserCtrl(vUser, entity);
                ctx.Response.Write(!string.IsNullOrEmpty(statusMessage)
                    ? new JsonMessage {
                    Success = true, Data = "1", Message = statusMessage
                }.ToString()
                    : new JsonMessage {
                    Success = false, Data = "0", Message = statusMessage
                }.ToString());
            }
            catch (Exception ex)
            {
                ctx.Response.Write(new JsonMessage {
                    Success = false, Data = "-1", Message = "增加失败!" + ex.Message
                }.ToString());
            }
        }
 public void UpdateMainUserControlNode()
 {
     try
     {
         var mainUserctrl = new MainUserControlEntity
         {
             Id          = NodeId,
             FullName    = Text,
             Description = Description
         };
         RDIFrameworkService.Instance.WorkFlowUserControlService.UpdateMainUserCtrl(SystemInfo.UserInfo, mainUserctrl);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }