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.JobListBLL jobListBLL = new zlzw.BLL.JobListBLL(); zlzw.Model.JobListModel jobListModal = jobListBLL.GetModel(int.Parse(strSelectID)); jobListModal.IsEnable = 0; jobListBLL.Update(jobListModal); JobList_BindGrid(); #endregion } else { return; } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { if (Request.QueryString["Type"] == "1") { //编辑保存 zlzw.Model.JobListModel jobListModal = new zlzw.Model.JobListModel(); jobListModal.JobName = txbJobName.Text; jobListModal.JobTypeID = int.Parse(drpJobType.SelectedValue); if (ckbIsHot.Checked) { jobListModal.IsHot = 1; } else { jobListModal.IsHot = 0; } if (ckbIsEnable.Checked) { jobListModal.IsEnable = 1; } else { jobListModal.IsEnable = 0; } jobListModal.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString()); jobListModal.JobID = int.Parse(Request.QueryString["value"]); zlzw.BLL.JobListBLL jobListBLL = new zlzw.BLL.JobListBLL(); jobListBLL.Update(jobListModal); } else { //添加保存 zlzw.Model.JobListModel jobListModal = new zlzw.Model.JobListModel(); jobListModal.JobName = txbJobName.Text; jobListModal.JobTypeID = int.Parse(drpJobType.SelectedValue); jobListModal.IsEnable = 1; if (ckbIsHot.Checked) { jobListModal.IsHot = 1; } else { jobListModal.IsHot = 0; } jobListModal.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); zlzw.BLL.JobListBLL jobListBLL = new zlzw.BLL.JobListBLL(); jobListBLL.Add(jobListModal); } // 2. Close this window and Refresh parent window PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); }