Пример #1
0
        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();
        }
Пример #2
0
        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;
        }
Пример #3
0
        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;

        }
Пример #4
0
        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();
            }
        }
Пример #5
0
 public static int DeleteJobOfferSources(JobOfferSources objJobOfferSources)
 {
     return new JobOfferSourcesDAO().DeleteJobOfferSources(objJobOfferSources);
 }
Пример #6
0
 public static int UpdateJobOfferSources(JobOfferSources objJobOfferSources)
 {
     return new JobOfferSourcesDAO().UpdateJobOfferSources(objJobOfferSources);
 }
Пример #7
0
 public static JobOfferSources GetJobOfferSources(int JobOfferSourceID)
 {
     JobOfferSources objJobOfferSources = new JobOfferSources();
     return (JobOfferSources)(new JobOfferSourcesDAO().FillDTO(objJobOfferSources, "JobOfferSourceID=" + JobOfferSourceID));
 }
Пример #8
0
 public static int InsertJobOfferSources(JobOfferSources objJobOfferSources)
 {
     return new JobOfferSourcesDAO().InsertJobOfferSources(objJobOfferSources);
 }