protected void Submit_OnClick(object sender, EventArgs e) { #region 验证 if (int.Parse(RespLabDDL.SelectedValue.Trim()) == 0) { LabMS.Common.JShelper.JSAlert(Page, "err", "实验室名称不能为空!"); return; } if (string.IsNullOrEmpty(RespName.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "岗位职责名称不能为空!"); return; } if (string.IsNullOrEmpty(RespContent.Text.Trim())) { LabMS.Common.JShelper.JSAlert(Page, "err", "职责内容不能为空!"); return; } #endregion LabMS.Model.Responsibility responsibility = new LabMS.Model.Responsibility(); LabMS.BLL.Responsibility responsibilityInfo = new LabMS.BLL.Responsibility(); int RID = 0; if (!int.TryParse(Request.QueryString["ID"], out RID)) { Common.JShelper.JSAlert(Page, "err", "参数错误!"); return; } responsibility.ID = RID; responsibility.Resp_Lab = int.Parse(RespLabDDL.SelectedValue.Trim()); responsibility.Resp_Name = RespName.Text.ToString().Trim(); responsibility.Resp_Content = RespContent.Text.ToString().Trim(); responsibilityInfo.Update(responsibility); LabMS.Common.JShelper.JSAlertAndRedirect(Page, "EditSuccess", "修改成功!", "ListResponsibility.aspx"); }
/// <summary> /// ��������б� /// </summary> public List<LabMS.Model.Responsibility> GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); List<LabMS.Model.Responsibility> modelList = new List<LabMS.Model.Responsibility>(); int rowsCount = ds.Tables[0].Rows.Count; if (rowsCount > 0) { LabMS.Model.Responsibility model; for (int n = 0; n < rowsCount; n++) { model = new LabMS.Model.Responsibility(); if(ds.Tables[0].Rows[n]["ID"].ToString()!="") { model.ID=int.Parse(ds.Tables[0].Rows[n]["ID"].ToString()); } if(ds.Tables[0].Rows[n]["Resp_Lab"].ToString()!="") { model.Resp_Lab=int.Parse(ds.Tables[0].Rows[n]["Resp_Lab"].ToString()); } model.Resp_Name=ds.Tables[0].Rows[n]["Resp_Name"].ToString(); model.Resp_Content=ds.Tables[0].Rows[n]["Resp_Content"].ToString(); model.Intro=ds.Tables[0].Rows[n]["Intro"].ToString(); model.Summary=ds.Tables[0].Rows[n]["Summary"].ToString(); modelList.Add(model); } } return modelList; }