protected void btnDel_Click(object sender, EventArgs e) { if (grid1.SelectedRowIndexArray != null && grid1.SelectedRowIndexArray.Length > 0) { string strSelectID = "0"; for (int i = 0, count = grid1.SelectedRowIndexArray.Length; i < count; i++) { int rowIndex = grid1.SelectedRowIndexArray[i]; foreach (object key in grid1.DataKeys[rowIndex]) { strSelectID = key.ToString(); } } #region 除逻辑 zlzw.BLL.JobCategoryListBLL jobCategoryListBLL = new zlzw.BLL.JobCategoryListBLL(); zlzw.Model.JobCategoryListModal jobCategoryListModal = jobCategoryListBLL.GetModel(int.Parse(Get_JobCategoryID(strSelectID))); jobCategoryListModal.IsEnable = 0; jobCategoryListBLL.Update(jobCategoryListModal); JobCategoryList_BindGrid(); #endregion } else { return; } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { if (Request.QueryString["Type"] == "1") { //编辑保存 zlzw.Model.JobCategoryListModal jobCategoryListModal = new zlzw.Model.JobCategoryListModal(); jobCategoryListModal.JobCategoryName = txbJobCategoryName.Text; jobCategoryListModal.JobCategoryGUID = new Guid(ViewState["JobCategoryGUID"].ToString()); jobCategoryListModal.IsEnable = 1; if (ckbIsHot.Checked) { jobCategoryListModal.IsHot = 1; } else { jobCategoryListModal.IsHot = 0; } jobCategoryListModal.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString()); jobCategoryListModal.JobCategoryID = int.Parse(Get_JobCategoryID(Request.QueryString["value"])); zlzw.BLL.JobCategoryListBLL jobCategoryListBLL = new zlzw.BLL.JobCategoryListBLL(); jobCategoryListBLL.Update(jobCategoryListModal); } else { //添加保存 zlzw.Model.JobCategoryListModal jobCategoryListModal = new zlzw.Model.JobCategoryListModal(); jobCategoryListModal.JobCategoryName = txbJobCategoryName.Text; jobCategoryListModal.JobCategoryGUID = Guid.NewGuid(); jobCategoryListModal.IsEnable = 1; if (ckbIsHot.Checked) { jobCategoryListModal.IsHot = 1; } else { jobCategoryListModal.IsHot = 0; } jobCategoryListModal.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); zlzw.BLL.JobCategoryListBLL jobCategoryListBLL = new zlzw.BLL.JobCategoryListBLL(); jobCategoryListBLL.Add(jobCategoryListModal); } // 2. Close this window and Refresh parent window PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); }