Ejemplo n.º 1
0
        public HttpResponseMessage UpdateCompanyHoliday(CompanyHolidayUpdateDTO objLeave)
        {
            HttpResponseMessage message;

            try
            {
                // CompanyHolidayDataAccessLayer dal = new CompanyHolidayDataAccessLayer();
                var dynObj = new { result = _companyServices.UpdateCompanyHoliday(objLeave) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Somthing wrong,try Again!" });
                ErrorLog.CreateErrorMessage(ex, "Leave", "UpdateCompanyHoliday");
            }
            return(message);
        }
Ejemplo n.º 2
0
        public bool UpdateCompanyHoliday(CompanyHolidayUpdateDTO Leave)
        {
            bool       res    = false;
            SqlCommand SqlCmd = new SqlCommand("spUpdateCompanyHoliday");

            SqlCmd.CommandType = CommandType.StoredProcedure;
            SqlCmd.Parameters.AddWithValue("@Id", Leave.Id);
            SqlCmd.Parameters.AddWithValue("@CompanyId", Leave.CompanyId);
            SqlCmd.Parameters.AddWithValue("@EmployeeType", Leave.EmployeeType);
            SqlCmd.Parameters.AddWithValue("@Date", Leave.Date);
            SqlCmd.Parameters.AddWithValue("@Description", Leave.Description);
            SqlCmd.Parameters.AddWithValue("@ModifiedBy", Leave.ModifiedBy);
            SqlCmd.Parameters.AddWithValue("@Active", Leave.Active);
            int result = new DbLayer().ExecuteNonQuery(SqlCmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }