protected void btDelete_Click(object sender, EventArgs e) { ArrayList pkArray = null; WHAreaBLL bll = null; try { bll = BLLFactory.CreateBLL <WHAreaBLL>(); pkArray = GvHelper.GetPKValueByChk(this.GvList, 0, "cbxSelect", 0); foreach (object key in pkArray) { bll.DeleteWHArea(new WHArea { ID = key.ToString() }); } this.BindData(); } catch (Exception ex) { throw ex; } }
private void BindData() { WHAreaBLL bll = null; DataPage dp = new DataPage(); WHArea condition = new WHArea(); string whID = Request.QueryString["whID"]; try { bll = BLLFactory.CreateBLL <WHAreaBLL>(); this.hiWHID.Value = whID; condition.Code = this.Code.Text.Trim(); condition.WHID = whID; condition.Description = this.Description.Text.Trim(); PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <WHArea> list = dp.Result as List <WHArea>; this.GvList.DataSource = list; this.GvList.DataBind(); for (int i = 0; i < this.GvList.Rows.Count; i++) { string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["ID"].ToString()); (this.GvList.Rows[i].Cells[5].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
public void ProcessRequest(HttpContext context) { context.Response.ContentEncoding = Encoding.UTF8; context.Response.ContentType = "application/json"; string whID = context.Request.QueryString["whID"]; List <WHArea> list = new WHAreaBLL().GetList(whID); context.Response.Write(LAF.Common.Serialization.JsonConvertHelper.GetSerializes(list)); }
private void BindData() { string id = Request.QueryString["id"]; WHAreaBLL bll = null; WHArea info = new WHArea(); string whID = Request.QueryString["whID"]; try { if (string.IsNullOrEmpty(whID) == false) { this.Warehourse.Enabled = false; } else { this.Warehourse.Enabled = true; } bll = BLLFactory.CreateBLL <WHAreaBLL>(); if (string.IsNullOrEmpty(id) == false) { info.ID = id; info = bll.Get(info); UIBindHelper.BindForm(this.Page, info); this.Warehourse.SelectedValue = info.WHID; this.hiID.Value = info.ID; this.HiCREATEUSER.Value = info.CREATEUSER; this.HiCREATETIME.Value = info.CREATETIME.ToString(); this.Warehourse.Enabled = false; } else { info = new WHArea(); this.Warehourse.SelectedValue = whID; } } catch (Exception ex) { throw ex; } }
protected void btSave_Click(object sender, EventArgs e) { WHArea info = new WHArea(); WHAreaBLL bll = null; DataResult <int> result = null; try { UIBindHelper.BindModelByControls(this.Page, info); bll = BLLFactory.CreateBLL <WHAreaBLL>(); info.WHID = this.Warehourse.SelectedValue; if (this.hiID.Value == "") { result = bll.Insert(info); } else { info.CREATEUSER = this.HiCREATEUSER.Value; info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value); info.ID = this.hiID.Value; result = bll.Update(info); } if (string.IsNullOrEmpty(result.Msg) == false) { ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','" + result.Msg + "')", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true); } } catch (Exception ex) { throw ex; } }