private bool DoEdit(int _id) { bool result = false; ps_depot_category model = new ps_depot_category(); if (model.Exists(txttitle.Text.Trim(), _id)) { mym.JscriptMsg(this.Page, "您输入的地区名称已经存在,请检查!", "", "Error"); return(false); } model.GetModel(_id); model.title = txttitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.remark = txtremark.Text.Trim(); if (model.Update()) { mym.AddAdminLog("修改", "修改地区:" + txttitle.Text); //记录日志 result = true; } return(result); }
private bool DoAdd() { ps_depot_category model = new ps_depot_category(); if (model.Exists(txttitle.Text.Trim())) { mym.JscriptMsg(this.Page, "您输入的地区名称已经存在,请检查!", "", "Error"); return(false); } model.title = txttitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.remark = txtremark.Text.Trim(); if (model.Add() > 0) { mym.AddAdminLog("增加", "添加地区:" + txttitle.Text); //记录日志 return(true); } return(false); }