private void btn_AddImageType_Click(object sender, System.EventArgs e) { string text = this.txt_AddImageTypeName.Text; if (text.Length == 0) { this.ShowMsg("分类名称不能为空", false); return; } if (text.Length > 20) { this.ShowMsg("分类名称长度限在20个字符以内", false); return; } bool flag = GalleryHelper.AddPhotoCategory(Globals.HtmlEncode(text)); if (flag) { this.txt_AddImageTypeName.Text = ""; this.ShowMsg("添加成功!", true); this.GetImageType(); return; } this.ShowMsg("添加失败", false); }
private void btnSaveImageType_Click(object sender, System.EventArgs e) { string text = this.AddImageTypeName.Text; if (text.Length == 0) { this.ShowMsg("分类名称不能为空", false); } else { if (text.Length > 20) { this.ShowMsg("分类名称长度限在20个字符以内", false); } else { if (GalleryHelper.AddPhotoCategory(Globals.HtmlEncode(text))) { this.ShowMsg("添加成功!", true); this.GetImageType(); } else { this.ShowMsg("添加失败", false); } } } }
public static int AddSupplier(SupplierInfo supplier) { int num = (int)new SupplierDao().Add(supplier, null); if (num > 0) { GalleryHelper.AddPhotoCategory("默认分类", num); } return(num); }
private void btnSaveImageType_Click(object sender, EventArgs e) { string text = AddImageTypeName.Text; if (text.Length > 20) { ShowMsg("分类长度限在20个字符以内", false); } else if (GalleryHelper.AddPhotoCategory(Globals.HtmlEncode(text))) { ShowMsg("添加成功!", true); GetImageType(); } else { ShowMsg("添加失败", false); } }
public void Edit(HttpContext context) { int value = base.GetIntParam(context, "id", false).Value; string parameter = base.GetParameter(context, "name", true); bool flag = true; if (value > 0) { flag = false; } if (string.IsNullOrWhiteSpace(parameter)) { throw new HidistroAshxException("分类名称不能为空"); } if (parameter.Length > 20) { throw new HidistroAshxException("分类名称长度限在20个字符以内"); } if (flag) { if (GalleryHelper.AddPhotoCategory(Globals.HtmlEncode(parameter), 0) > 0) { base.ReturnSuccessResult(context, "添加成功", 0, true); return; } throw new HidistroAshxException("操作失败"); } Dictionary <int, string> dictionary = new Dictionary <int, string>(); dictionary.Add(value, parameter); if (GalleryHelper.UpdatePhotoCategories(dictionary) > 0) { base.ReturnSuccessResult(context, "修改成功", 0, true); return; } throw new HidistroAshxException("操作失败"); }
public string InsertFolder(int supplierId) { int num = GalleryHelper.AddPhotoCategory("新建文件夹", supplierId); return("{\"status\":1,\"data\":" + num + ",\"msg\":\"\"}"); }