Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            JobOfferedTypes objJobOfferedTypes = new JobOfferedTypes();
            objJobOfferedTypes.JobOfferTypeDesc = txtJobOfferedTypeDesc.Text;
            objJobOfferedTypes.Status = 1;

            if (!string.IsNullOrEmpty(hfJobOfferedTypeID.Value.ToString()))
            {
                objJobOfferedTypes.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objJobOfferedTypes.UpdatedDate = DateTime.Now;
                objJobOfferedTypes.JobOfferedTypeID = Convert.ToInt32(hfJobOfferedTypeID.Value);
                objJobOfferedTypes.JobOfferTypeDesc = txtJobOfferedTypeDesc.Text;
                JobOfferedTypesBO.UpdateJobOfferedTypes(objJobOfferedTypes);

            }
            else
            {
                objJobOfferedTypes.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objJobOfferedTypes.CreatedDate = DateTime.Now;
                JobOfferedTypesBO.InsertJobOfferedTypes(objJobOfferedTypes);
            }
            
            txtJobOfferedTypeDesc.Text = string.Empty;
            loadJobOfferType();

        }
        // GET api/jobofferedtype
        public IEnumerable<JobOfferedTypes> Get()
        {

            List<JobOfferedTypes> listJobOfferedType = new List<JobOfferedTypes>();
            DataView dvJobOfferedType = JobOfferedTypesBO.GetJobOfferedTypeIDForSync();
            foreach (DataRowView drvJobOfferedType in dvJobOfferedType)
            {
                JobOfferedTypes jobOfferType = new JobOfferedTypes();
                listJobOfferedType.Add(JobOfferedTypesBO.GetJobOfferedTypes(Convert.ToInt32(drvJobOfferedType["JobOfferedTypeID"])));
            }
            return listJobOfferedType;
        }
Ejemplo n.º 3
0
        public int InsertJobOfferedTypes(JobOfferedTypes objJobOfferedTypes)
        {
            objJobOfferedTypes.JobOfferedTypeID = 1;
            BeginTransaction();

            try
            {
                objJobOfferedTypes.JobOfferedTypeID = Insert(objJobOfferedTypes);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objJobOfferedTypes.JobOfferedTypeID = -1;
            }

            return objJobOfferedTypes.JobOfferedTypeID;
        }
Ejemplo n.º 4
0
        public int DeleteJobOfferedTypes(JobOfferedTypes objJobOfferedTypes)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objJobOfferedTypes, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
Ejemplo n.º 5
0
        protected void gvJobOfferType_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            hfJobOfferedTypeID.Value = e.CommandArgument.ToString();
            JobOfferedTypes objJobOfferedTypes = new JobOfferedTypes();

            if (e.CommandName.Equals("cmdEdit"))
            {
                objJobOfferedTypes = JobOfferedTypesBO.GetJobOfferedTypes(Convert.ToInt32(e.CommandArgument));
                txtJobOfferedTypeDesc.Text = objJobOfferedTypes.JobOfferTypeDesc;
            }
            else if (e.CommandName.Equals("cmdDelete"))
            {
                int JobOfferTypeID = Convert.ToInt32(e.CommandArgument);
                objJobOfferedTypes.JobOfferedTypeID = JobOfferTypeID;
                objJobOfferedTypes.Status = 0;
                JobOfferedTypesBO.DeleteJobOfferedTypes(objJobOfferedTypes);
                loadJobOfferType();
            }
        }
        // POST api/jobofferedtype
        public JobOfferedTypes Post(JobOfferedTypes jobOfferedType)
        {
            if (jobOfferedType.GUID > 0)
            {
                jobOfferedType.JobOfferedTypeID = jobOfferedType.GUID;
                int rowResult = JobOfferedTypesBO.UpdateJobOfferedTypes(jobOfferedType);

                //Return Back to The Client               
                return jobOfferedType;
            }
            else
            {
              
                int rowResult = JobOfferedTypesBO.InsertJobOfferedTypes(jobOfferedType);

                //Return Back to The Client               
                return jobOfferedType;
            }
        }
Ejemplo n.º 7
0
 public static int DeleteJobOfferedTypes(JobOfferedTypes objJobOfferedTypes)
 {
     return new JobOfferedTypesDAO().DeleteJobOfferedTypes(objJobOfferedTypes);
 }
Ejemplo n.º 8
0
 public static int UpdateJobOfferedTypes(JobOfferedTypes objJobOfferedTypes)
 {
     return new JobOfferedTypesDAO().UpdateJobOfferedTypes(objJobOfferedTypes);
 }
Ejemplo n.º 9
0
 public static JobOfferedTypes GetJobOfferedTypes(int JobOfferTypeID)
 {
     JobOfferedTypes objJobOfferedTypes = new JobOfferedTypes();
     return (JobOfferedTypes)(new JobOfferedTypesDAO().FillDTO(objJobOfferedTypes, "JobOfferedTypeID=" + JobOfferTypeID));
 }
Ejemplo n.º 10
0
 public static int InsertJobOfferedTypes(JobOfferedTypes objJobOfferedTypes)
 {
     return new JobOfferedTypesDAO().InsertJobOfferedTypes(objJobOfferedTypes);
 }