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.DefaultPostListBLL defaultPostListBLL = new zlzw.BLL.DefaultPostListBLL(); zlzw.Model.DefaultPostListModal defaultPostListModal = defaultPostListBLL.GetModel(int.Parse(strSelectID)); defaultPostListModal.IsEnable = 0; defaultPostListBLL.Update(defaultPostListModal); PostList_BindGrid(); #endregion } else { return; } }
private void Load_JobInfo(string strID) { try { zlzw.BLL.DefaultPostListBLL defaultPostListBLL = new zlzw.BLL.DefaultPostListBLL(); zlzw.Model.DefaultPostListModal defaultPostListModal = defaultPostListBLL.GetModel(int.Parse(strID)); labEnterpriseTitle.Text = defaultPostListModal.EnterpriseName; //企业名称 labPublisDate.Text = DateTime.Parse(defaultPostListModal.PublishDate.ToString()).ToString("yyyy年MM月dd日"); labWorkAdd.Text = defaultPostListModal.WorkAdd; //工作地点 labRecruitmentNumber.Text = defaultPostListModal.RecruitmentNumber + " 人"; labPostInfo.Text = defaultPostListModal.PostInfo; //招聘信息 labPostDemand.Text = defaultPostListModal.PostDemand; //岗位要求 labTreatmentInfo.Text = defaultPostListModal.TreatmentInfo; //待遇相关 if (defaultPostListModal.OtherInfo != "") { labOtherInfo.Visible = true; labOtherInfo.Text = defaultPostListModal.OtherInfo; } else { labOtherInfo.Visible = false; } } catch (Exception exp) { Response.Redirect("default.aspx"); } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { if (Request.QueryString["Type"] == "1") { //编辑保存 zlzw.Model.DefaultPostListModal defaultPostListModal = new zlzw.Model.DefaultPostListModal(); defaultPostListModal.EnterpriseName = txbEnterpriseName.Text; //企业名称 defaultPostListModal.DictionaryListID = int.Parse(drpRegion.SelectedValue); //所属区域ID defaultPostListModal.WorkAdd = txbWorkAdd.Text; //工作地点 defaultPostListModal.PostInfo = txbPostInfo.Text; //招聘职位 defaultPostListModal.RecruitmentNumber = txbRecruitmentNumber.Text; //招聘人数 defaultPostListModal.PostDemand = txbPostDemand.Text; //岗位要求 defaultPostListModal.TreatmentInfo = txbTreatmentInfo.Text; //待遇相关 defaultPostListModal.OtherInfo = txbOtherInfo.Text; //备注信息 defaultPostListModal.IsEnable = 1; if (ckbIsHot.Checked) { defaultPostListModal.IsHot = 1; } else { defaultPostListModal.IsHot = 0; } defaultPostListModal.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString()); defaultPostListModal.EnterpriseGUID = new Guid(ViewState["EnterpriseGUID"].ToString()); defaultPostListModal.EnterpriseID = int.Parse(Request.QueryString["value"]); zlzw.BLL.DefaultPostListBLL defaultPostListBLL = new zlzw.BLL.DefaultPostListBLL(); defaultPostListBLL.Update(defaultPostListModal); } else { //添加保存 zlzw.Model.DefaultPostListModal defaultPostListModal = new zlzw.Model.DefaultPostListModal(); defaultPostListModal.EnterpriseName = txbEnterpriseName.Text; //企业名称 defaultPostListModal.DictionaryListID = int.Parse(drpRegion.SelectedValue); //所属区域ID defaultPostListModal.WorkAdd = txbWorkAdd.Text; //工作地点 defaultPostListModal.PostInfo = txbPostInfo.Text; //招聘职位 defaultPostListModal.RecruitmentNumber = txbRecruitmentNumber.Text; //招聘人数 defaultPostListModal.PostDemand = txbPostDemand.Text; //岗位要求 defaultPostListModal.TreatmentInfo = txbTreatmentInfo.Text; //待遇相关 defaultPostListModal.OtherInfo = txbOtherInfo.Text; //备注信息 defaultPostListModal.IsEnable = 1; if (ckbIsHot.Checked) { defaultPostListModal.IsHot = 1; } else { defaultPostListModal.IsHot = 0; } defaultPostListModal.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); defaultPostListModal.EnterpriseGUID = System.Guid.NewGuid(); zlzw.BLL.DefaultPostListBLL defaultPostListBLL = new zlzw.BLL.DefaultPostListBLL(); defaultPostListBLL.Add(defaultPostListModal); } // 2. Close this window and Refresh parent window PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); }
private void LoadData(string strType) { if (strType == "1") { string strID = Request.QueryString["value"];//操作ID zlzw.BLL.DefaultPostListBLL defaultPostListBLL = new zlzw.BLL.DefaultPostListBLL(); zlzw.Model.DefaultPostListModal defaultPostListModal = defaultPostListBLL.GetModel(int.Parse(strID)); txbEnterpriseName.Text = defaultPostListModal.EnterpriseName; //企业名称 drpRegion.SelectedValue = defaultPostListModal.DictionaryListID.ToString(); //所属区域ID txbWorkAdd.Text = defaultPostListModal.WorkAdd; //工作地点 txbPostInfo.Text = defaultPostListModal.PostInfo; //招聘职位 txbRecruitmentNumber.Text = defaultPostListModal.RecruitmentNumber; //招聘人数 txbPostDemand.Text = defaultPostListModal.PostDemand; //岗位要求 txbTreatmentInfo.Text = defaultPostListModal.TreatmentInfo; //待遇相关 txbOtherInfo.Text = defaultPostListModal.OtherInfo; //备注信息 if (defaultPostListModal.IsHot == 1) { ckbIsHot.Checked = true; } else { ckbIsHot.Checked = false; } ViewState["PublishDate"] = defaultPostListModal.PublishDate.ToString(); ViewState["EnterpriseGUID"] = defaultPostListModal.EnterpriseGUID.ToString(); ToolbarText2.Text = "编辑一个职位信息"; } btnClose.OnClientClick = ActiveWindow.GetConfirmHideReference(); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(zlzw.Model.DefaultPostListModal model) { int rowsAffected = 0; SqlParameter[] parameters = { new SqlParameter("@EnterpriseID", SqlDbType.Int, 4), new SqlParameter("@DictionaryListID", SqlDbType.Int, 4), new SqlParameter("@EnterpriseGUID", SqlDbType.UniqueIdentifier, 16), new SqlParameter("@EnterpriseName", SqlDbType.NVarChar, 50), new SqlParameter("@WorkAdd", SqlDbType.NVarChar, 200), new SqlParameter("@RecruitmentNumber", SqlDbType.NVarChar, 50), new SqlParameter("@PostInfo", SqlDbType.NVarChar, 200), new SqlParameter("@PostDemand", SqlDbType.NVarChar), new SqlParameter("@TreatmentInfo", SqlDbType.NVarChar), new SqlParameter("@OtherInfo", SqlDbType.NVarChar), new SqlParameter("@IsEnable", SqlDbType.Int, 4), new SqlParameter("@IsHot", SqlDbType.Int, 4), new SqlParameter("@PublishDate", SqlDbType.DateTime), new SqlParameter("@Other01", SqlDbType.NVarChar, 50), new SqlParameter("@Other02", SqlDbType.NVarChar, 200) }; parameters[0].Value = model.EnterpriseID; parameters[1].Value = model.DictionaryListID; parameters[2].Value = model.EnterpriseGUID; parameters[3].Value = model.EnterpriseName; parameters[4].Value = model.WorkAdd; parameters[5].Value = model.RecruitmentNumber; parameters[6].Value = model.PostInfo; parameters[7].Value = model.PostDemand; parameters[8].Value = model.TreatmentInfo; parameters[9].Value = model.OtherInfo; parameters[10].Value = model.IsEnable; parameters[11].Value = model.IsHot; parameters[12].Value = model.PublishDate; parameters[13].Value = model.Other01; parameters[14].Value = model.Other02; DbHelperSQL.RunProcedure("DefaultPostList_Update", parameters, out rowsAffected); if (rowsAffected > 0) { return(true); } else { return(false); } }
/// <summary> /// 得到一个对象实体 /// </summary> public zlzw.Model.DefaultPostListModal GetModel(int EnterpriseID) { SqlParameter[] parameters = { new SqlParameter("@EnterpriseID", SqlDbType.Int, 4) }; parameters[0].Value = EnterpriseID; zlzw.Model.DefaultPostListModal model = new zlzw.Model.DefaultPostListModal(); DataSet ds = DbHelperSQL.RunProcedure("DefaultPostList_GetModel", parameters, "ds"); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public zlzw.Model.DefaultPostListModal DataRowToModel(DataRow row) { zlzw.Model.DefaultPostListModal model = new zlzw.Model.DefaultPostListModal(); if (row != null) { if (row["EnterpriseID"] != null && row["EnterpriseID"].ToString() != "") { model.EnterpriseID = int.Parse(row["EnterpriseID"].ToString()); } if (row["DictionaryListID"] != null && row["DictionaryListID"].ToString() != "") { model.DictionaryListID = int.Parse(row["DictionaryListID"].ToString()); } if (row["EnterpriseGUID"] != null && row["EnterpriseGUID"].ToString() != "") { model.EnterpriseGUID = new Guid(row["EnterpriseGUID"].ToString()); } if (row["EnterpriseName"] != null) { model.EnterpriseName = row["EnterpriseName"].ToString(); } if (row["WorkAdd"] != null) { model.WorkAdd = row["WorkAdd"].ToString(); } if (row["RecruitmentNumber"] != null) { model.RecruitmentNumber = row["RecruitmentNumber"].ToString(); } if (row["PostInfo"] != null) { model.PostInfo = row["PostInfo"].ToString(); } if (row["PostDemand"] != null) { model.PostDemand = row["PostDemand"].ToString(); } if (row["TreatmentInfo"] != null) { model.TreatmentInfo = row["TreatmentInfo"].ToString(); } if (row["OtherInfo"] != null) { model.OtherInfo = row["OtherInfo"].ToString(); } if (row["IsEnable"] != null && row["IsEnable"].ToString() != "") { model.IsEnable = int.Parse(row["IsEnable"].ToString()); } if (row["IsHot"] != null && row["IsHot"].ToString() != "") { model.IsHot = int.Parse(row["IsHot"].ToString()); } if (row["PublishDate"] != null && row["PublishDate"].ToString() != "") { model.PublishDate = DateTime.Parse(row["PublishDate"].ToString()); } if (row["Other01"] != null) { model.Other01 = row["Other01"].ToString(); } if (row["Other02"] != null) { model.Other02 = row["Other02"].ToString(); } } return(model); }