protected void btnSave_Click(object sender, EventArgs e) { JobOfferSources objJobOfferSources = new JobOfferSources(); objJobOfferSources.JobOfferSourceDesc = txtJobOfferSourceDesc.Text; objJobOfferSources.Status = 1; if (!string.IsNullOrEmpty(hfJobOfferSourceID.Value.ToString())) { objJobOfferSources.UpdatedBy = UserAuthentication.GetUserId(this.Page); objJobOfferSources.UpdatedDate = DateTime.Now; objJobOfferSources.JobOfferSourceID = Convert.ToInt32(hfJobOfferSourceID.Value); objJobOfferSources.JobOfferSourceDesc = txtJobOfferSourceDesc.Text; JobOfferSourcesBO.UpdateJobOfferSources(objJobOfferSources); } else { objJobOfferSources.CreatedBy = UserAuthentication.GetUserId(this.Page); objJobOfferSources.CreatedDate = DateTime.Now; JobOfferSourcesBO.InsertJobOfferSources(objJobOfferSources); } txtJobOfferSourceDesc.Text = string.Empty; hfJobOfferSourceID.Value = string.Empty; loadJobOfferSource(); }
public int InsertJobOfferSources(JobOfferSources objJobOfferSources) { objJobOfferSources.JobOfferSourceID = 1; BeginTransaction(); try { objJobOfferSources.JobOfferSourceID = Insert(objJobOfferSources); CommitTransaction(); } catch (Exception ex) { RollBackTransaction(); objJobOfferSources.JobOfferSourceID = -1; } return objJobOfferSources.JobOfferSourceID; }
public int DeleteJobOfferSources(JobOfferSources objJobOfferSources) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "Status" }; rowsaffected = Update(objJobOfferSources, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
protected void gvJobOfferSource_RowCommand(object sender, GridViewCommandEventArgs e) { hfJobOfferSourceID.Value = e.CommandArgument.ToString(); JobOfferSources objJobOfferSources = new JobOfferSources(); if (e.CommandName.Equals("cmdEdit")) { objJobOfferSources = JobOfferSourcesBO.GetJobOfferSources(Convert.ToInt32(e.CommandArgument)); txtJobOfferSourceDesc.Text = objJobOfferSources.JobOfferSourceDesc; } else if (e.CommandName.Equals("cmdDelete")) { int JobOfferSourceID = Convert.ToInt32(e.CommandArgument); objJobOfferSources.JobOfferSourceID = JobOfferSourceID; objJobOfferSources.Status = 0; JobOfferSourcesBO.DeleteJobOfferSources(objJobOfferSources); loadJobOfferSource(); } }
public static int DeleteJobOfferSources(JobOfferSources objJobOfferSources) { return new JobOfferSourcesDAO().DeleteJobOfferSources(objJobOfferSources); }
public static int UpdateJobOfferSources(JobOfferSources objJobOfferSources) { return new JobOfferSourcesDAO().UpdateJobOfferSources(objJobOfferSources); }
public static JobOfferSources GetJobOfferSources(int JobOfferSourceID) { JobOfferSources objJobOfferSources = new JobOfferSources(); return (JobOfferSources)(new JobOfferSourcesDAO().FillDTO(objJobOfferSources, "JobOfferSourceID=" + JobOfferSourceID)); }
public static int InsertJobOfferSources(JobOfferSources objJobOfferSources) { return new JobOfferSourcesDAO().InsertJobOfferSources(objJobOfferSources); }