/// <summary> /// Modify /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void BtnSubmit_Click(object sender, EventArgs e) { #region Validation if (string.IsNullOrEmpty(PlateTitle.Text.Trim())) { WriteBackScript("alert('���������ⲻ��Ϊ��!')"); return; } if (PlateDescripttion.Text.Length > 500) { WriteBackScript("alert('�������������Ȳ��ܳ���500�ַ�!')"); return; } #endregion int id = int.Parse(Request.QueryString["plateID"]); LabMS.BLL.PostPlate pp = new LabMS.BLL.PostPlate(); LabMS.Model.PostPlate ppInfo = pp.GetModel(id); if (ppInfo == null) { WriteBackScript("alert('��ǰ����Ѿ�����һ����ɾ��!');window.returnValue=true;window.close();"); return; } ppInfo.Name = PlateTitle.Text; ppInfo.Description = PlateDescripttion.Text; pp.Update(ppInfo); WriteBackScript("alert('�ijɹ�!');window.returnValue=true;window.close();"); }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("BKGL"); strPageUserType.Add("mana"); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["plateID"])) { int id = 0; if (!int.TryParse(Request.QueryString["plateID"], out id)) { throw new Exception("�������ʵ�ҳ�治����!"); } LabMS.BLL.PostPlate pp = new LabMS.BLL.PostPlate(); LabMS.Model.PostPlate ppInfo = pp.GetModel(id); if (ppInfo == null) { throw new Exception("�������ʵ�ҳ�治����!"); } PlateTitle.Text = ppInfo.Name; PlateDescripttion.Text = ppInfo.Description; } else { throw new Exception("�������ʵ�ҳ�治����!"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["plateID"])) { int id = 0; if (!int.TryParse(Request.QueryString["plateID"], out id)) { throw new Exception("你所访问的页面不存在!"); } LabMS.BLL.PostPlate pp = new LabMS.BLL.PostPlate(); LabMS.Model.PostPlate ppInfo = pp.GetModel(id); if (ppInfo == null) { throw new Exception("你所访问的页面不存在!"); } PlateName.Text = ppInfo.Name; } else { throw new Exception("你所访问的页面不存在!"); } } }