private void Delete() { try { if (string.IsNullOrEmpty(Request["keys"])) { JsonSuccess(); } string[] primaryKeyStrings = GetParameterArrayString(Request["keys"], "ErrorDescrption_", ','); bool success = false; foreach (string primaryKeyString in primaryKeyStrings) { success = BO_ErrorDescrption.DeleteByPrimaryKeyString(primaryKeyString) > 0; if (!success) { break; } } if (success) { JsonSuccess(); } else { JsonError("Delete Failure"); } } catch (Exception ex) { JsonError(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { string primaryKeyInfo = Request["id"]; if (!string.IsNullOrEmpty(primaryKeyInfo)) { UO = BO_ErrorDescrption.GetObjectByPrimaryKeyString(primaryKeyInfo); } if (UO == null) { UO = new DO_ErrorDescrption.UO_ErrorDescrption(); } if (Request.Form.Keys.Count > 0) { GetTogether.Web.WebHelper.SetValues <DO_ErrorDescrption.UO_ErrorDescrption>(UO, "ErrorDescrption_"); if (!string.IsNullOrEmpty(primaryKeyInfo)) { //Pending UO["UpdateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd"); UO["UpdateBy"] = string.Concat("WS-", Request.UserHostAddress); UO.Update(BO_ErrorDescrption.GetConditionsByPrimaryKeyString(primaryKeyInfo)); } else { //Pending UO["CreateOn", "yyyy-MM-dd"] = DateTime.Now.ToString("yyyy-MM-dd"); UO["CreateBy"] = string.Concat("WS-", Request.UserHostAddress); UO.Insert(); } Response.Redirect("ErrorDescrption.aspx"); } }
private void GetList() { Database_Output_ErrorDescrption_Result c = (Database_Output_ErrorDescrption_Result)Page.LoadControl("ErrorDescrption_Result.ascx"); DO_ErrorDescrption.UO_ErrorDescrption l = new DO_ErrorDescrption.UO_ErrorDescrption(); GetTogether.Web.WebHelper.SetValues <DO_ErrorDescrption.UO_ErrorDescrption>(l, "ErrorDescrption_"); if (string.IsNullOrEmpty(Sort)) { Sort = DO_ErrorDescrption.Columns.Code.ToString(); } PagingResult <DO_ErrorDescrption.UO_ErrorDescrption, DO_ErrorDescrption.UOList_ErrorDescrption> resultPaging = BO_ErrorDescrption.GetPagingList(l, PageIndex, PageSize, Sort, IsAsc); c.JsFunction = "ErrorDescrption_Search"; c.SetData <DO_ErrorDescrption.UO_ErrorDescrption, DO_ErrorDescrption.UOList_ErrorDescrption>(resultPaging.Result); c.Total = resultPaging.Total; c.Sort = Sort; c.PageIndex = PageIndex; c.PageSize = PageSize; c.IsAsc = IsAsc; this.Controls.Add(c); }