private void AddParameter(HttpContext ctx)
        {
            var entity = new CiParameterEntity {
                DeleteMark = 0
            };

            entity = GetPageEntity(entity);
            try
            {
                int returnValue = RDIFrameworkService.Instance.ParameterService.SetParameter(Utils.UserInfo, entity.CategoryKey, entity.ParameterId, entity.ParameterCode, entity.ParameterContent, entity.AllowEdit ?? 0, entity.AllowDelete ?? 0);

                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 = "0", Message = ex.Message
                }.ToString());
            }
        }
示例#2
0
 /// <summary>
 /// 加载窗体
 /// </summary>
 public override void FormOnLoad()
 {
     this.parameterEntity = RDIFrameworkService.Instance.ParameterService.GetEntity(UserInfo, this.EntityId);
     // 显示内容
     this.ShowEntity();
     // 焦点定位
     this.ActiveControl = this.txtCategoryKey;
     this.txtCategoryKey.SelectAll();
     this.txtCategoryKey.Focus();
 }
 private CiParameterEntity GetPageEntity(CiParameterEntity entity)
 {
     entity.CategoryKey      = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("CategoryKey"));
     entity.ParameterId      = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("ParameterId"));
     entity.ParameterCode    = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("ParameterCode"));
     entity.ParameterContent = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("ParameterContent"));
     entity.Enabled          = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("Enabled")) == "on" ? 1 : 0;
     entity.AllowEdit        = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("AllowEdit")) == "on" ? 1 : 0;
     entity.AllowDelete      = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("AllowDelete")) == "on" ? 1 : 0;
     entity.Description      = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("Description"));
     return(entity);
 }
示例#4
0
 /// <summary>
 /// 读取屏幕数据
 /// </summary>
 /// <returns>参数实体</returns>
 private CiParameterEntity GetObject()
 {
     enitty = new CiParameterEntity
     {
         CategoryKey      = this.txtCategoryKey.Text,
         ParameterId      = this.txtParameterId.Text,
         ParameterCode    = this.txtParameterCode.Text,
         ParameterContent = this.txtParameterContent.Text,
         Enabled          = this.chkEnabled.Checked ? 1 : 0,
         AllowEdit        = this.chkAllowEdit.Checked ? 1 : 0,
         AllowDelete      = this.chkAllowDelete.Checked ? 1 : 0,
         Description      = this.txtDescription.Text,
     };
     return(enitty);
 }