protected void btnSaveRefresh_Click(object sender, EventArgs e) { if (Request.QueryString["Type"] == "1") { //编辑保存 zlzw.Model.JobEnterpriseServiceModel jobEnterpriseServiceModel = new zlzw.Model.JobEnterpriseServiceModel(); jobEnterpriseServiceModel.EnterpriseKey = drpEnterpriseKey.SelectedValue;//所属企业GUID jobEnterpriseServiceModel.EnterpriseName = Get_EnterpriseName(drpEnterpriseKey.SelectedValue); jobEnterpriseServiceModel.JobPositionPublishAllowCount = int.Parse(txbJobPositionPublishAllowCount.Text);//允许企业发布的职位个数 jobEnterpriseServiceModel.JobPositionPublishUsedCount = int.Parse(txbJobPositionPublishUsedCount.Text);//企业已经发布的职位个数 jobEnterpriseServiceModel.EnterpriseServiceCurrentContractStartDate = DateTime.Parse(txbEnterpriseServiceCurrentContractStartDate.Text);//允许企业发布职位的开始日期 jobEnterpriseServiceModel.EnterpriseServiceCurrentContractEndDate = DateTime.Parse(txbEnterpriseServiceCurrentContractEndDate.Text);//禁止企业发布职位的开始日期 jobEnterpriseServiceModel.ResumeDownAllowCount = int.Parse(txbResumeDownAllowCount.Text);//允许查看简历数 jobEnterpriseServiceModel.ResumeDownUsedCount = int.Parse(txbResumeDownUsedCount.Text);//已查看简历数 jobEnterpriseServiceModel.CanUsable = 1; jobEnterpriseServiceModel.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString()); jobEnterpriseServiceModel.EnterpriseServiceGuid = new Guid(ViewState["EnterpriseServiceGuid"].ToString()); zlzw.BLL.JobEnterpriseServiceBLL jobEnterpriseServiceBLL = new zlzw.BLL.JobEnterpriseServiceBLL(); jobEnterpriseServiceModel.EnterpriseServiceID = int.Parse(Get_ID(jobEnterpriseServiceBLL, Request.QueryString["value"])); jobEnterpriseServiceBLL.Update(jobEnterpriseServiceModel); } else { //添加保存 zlzw.Model.JobEnterpriseServiceModel jobEnterpriseServiceModel = new zlzw.Model.JobEnterpriseServiceModel(); jobEnterpriseServiceModel.EnterpriseKey = drpEnterpriseKey.SelectedValue;//所属企业GUID jobEnterpriseServiceModel.EnterpriseName = Get_EnterpriseName(drpEnterpriseKey.SelectedValue); jobEnterpriseServiceModel.JobPositionPublishAllowCount = int.Parse(txbJobPositionPublishAllowCount.Text);//允许企业发布的职位个数 jobEnterpriseServiceModel.JobPositionPublishUsedCount = int.Parse(txbJobPositionPublishUsedCount.Text);//企业已经发布的职位个数 jobEnterpriseServiceModel.EnterpriseServiceCurrentContractStartDate = DateTime.Parse(txbEnterpriseServiceCurrentContractStartDate.Text);//允许企业发布职位的开始日期 jobEnterpriseServiceModel.EnterpriseServiceCurrentContractEndDate = DateTime.Parse(txbEnterpriseServiceCurrentContractEndDate.Text);//禁止企业发布职位的开始日期 jobEnterpriseServiceModel.ResumeDownAllowCount = int.Parse(txbResumeDownAllowCount.Text);//允许查看简历数 jobEnterpriseServiceModel.ResumeDownUsedCount = int.Parse(txbResumeDownUsedCount.Text);//已查看简历数 jobEnterpriseServiceModel.CanUsable = 1; jobEnterpriseServiceModel.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); zlzw.BLL.JobEnterpriseServiceBLL jobEnterpriseServiceBLL = new zlzw.BLL.JobEnterpriseServiceBLL(); jobEnterpriseServiceBLL.Add(jobEnterpriseServiceModel); } // 2. Close this window and Refresh parent window PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); }
/// <summary> /// 得到一个对象实体 /// </summary> public zlzw.Model.JobEnterpriseServiceModel DataRowToModel(DataRow row) { zlzw.Model.JobEnterpriseServiceModel model=new zlzw.Model.JobEnterpriseServiceModel(); if (row != null) { if(row["EnterpriseServiceID"]!=null && row["EnterpriseServiceID"].ToString()!="") { model.EnterpriseServiceID=int.Parse(row["EnterpriseServiceID"].ToString()); } if(row["EnterpriseServiceGuid"]!=null && row["EnterpriseServiceGuid"].ToString()!="") { model.EnterpriseServiceGuid= new Guid(row["EnterpriseServiceGuid"].ToString()); } if(row["EnterpriseServiceStatus"]!=null && row["EnterpriseServiceStatus"].ToString()!="") { model.EnterpriseServiceStatus=int.Parse(row["EnterpriseServiceStatus"].ToString()); } if(row["EnterpriseName"]!=null) { model.EnterpriseName=row["EnterpriseName"].ToString(); } if(row["EnterpriseKey"]!=null) { model.EnterpriseKey=row["EnterpriseKey"].ToString(); } if(row["JobPositionPublishAllowCount"]!=null && row["JobPositionPublishAllowCount"].ToString()!="") { model.JobPositionPublishAllowCount=int.Parse(row["JobPositionPublishAllowCount"].ToString()); } if(row["JobPositionPublishUsedCount"]!=null && row["JobPositionPublishUsedCount"].ToString()!="") { model.JobPositionPublishUsedCount=int.Parse(row["JobPositionPublishUsedCount"].ToString()); } if(row["EnterpriseServiceCurrentContractKey"]!=null) { model.EnterpriseServiceCurrentContractKey=row["EnterpriseServiceCurrentContractKey"].ToString(); } if(row["EnterpriseServiceCurrentContractStartDate"]!=null && row["EnterpriseServiceCurrentContractStartDate"].ToString()!="") { model.EnterpriseServiceCurrentContractStartDate=DateTime.Parse(row["EnterpriseServiceCurrentContractStartDate"].ToString()); } if(row["EnterpriseServiceCurrentContractEndDate"]!=null && row["EnterpriseServiceCurrentContractEndDate"].ToString()!="") { model.EnterpriseServiceCurrentContractEndDate=DateTime.Parse(row["EnterpriseServiceCurrentContractEndDate"].ToString()); } if(row["ResumeDownAllowCount"]!=null && row["ResumeDownAllowCount"].ToString()!="") { model.ResumeDownAllowCount=int.Parse(row["ResumeDownAllowCount"].ToString()); } if(row["ResumeDownUsedCount"]!=null && row["ResumeDownUsedCount"].ToString()!="") { model.ResumeDownUsedCount=int.Parse(row["ResumeDownUsedCount"].ToString()); } if(row["CanUsable"]!=null && row["CanUsable"].ToString()!="") { model.CanUsable=int.Parse(row["CanUsable"].ToString()); } if(row["PublishDate"]!=null && row["PublishDate"].ToString()!="") { model.PublishDate=DateTime.Parse(row["PublishDate"].ToString()); } if(row["PropertyNames"]!=null) { model.PropertyNames=row["PropertyNames"].ToString(); } if(row["PropertyValues"]!=null) { model.PropertyValues=row["PropertyValues"].ToString(); } } return model; }
/// <summary> /// 得到一个对象实体 /// </summary> public zlzw.Model.JobEnterpriseServiceModel GetModel(int EnterpriseServiceID) { SqlParameter[] parameters = { new SqlParameter("@EnterpriseServiceID", SqlDbType.Int,4) }; parameters[0].Value = EnterpriseServiceID; zlzw.Model.JobEnterpriseServiceModel model=new zlzw.Model.JobEnterpriseServiceModel(); DataSet ds= DbHelperSQL.RunProcedure("JobEnterpriseService_GetModel",parameters,"ds"); if(ds.Tables[0].Rows.Count>0) { return DataRowToModel(ds.Tables[0].Rows[0]); } else { return null; } }