Example #1
0
        public bool RemoveAllShiftMapping(ShiftMappingRemoveDTO objRemoveShiftMapping)
        {
            bool       res    = false;
            SqlCommand sqlcmd = new SqlCommand("spDeleteShiftMapping");

            sqlcmd.Parameters.AddWithValue("@Active", objRemoveShiftMapping.Active);
            sqlcmd.CommandType = CommandType.StoredProcedure;
            int result = new DbLayer().ExecuteNonQuery(sqlcmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
        public HttpResponseMessage RemoveShiftMappingById(ShiftMappingRemoveDTO objRemoveShiftMapping)
        {
            HttpResponseMessage message;

            try
            {
                //  ShiftMappingDataAccessLayer dal = new ShiftMappingDataAccessLayer();
                var dynObj = new { result = _Shift.RemoveShiftMapping(objRemoveShiftMapping) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Something wrong,try Again!" });
                ErrorLog.CreateErrorMessage(ex, "ShiftMapping", "RemoveShiftMappingById");
            }
            return(message);
        }