public bool RemoveServiceMaster(ServiceMasterRemoveDTO objServiceMater)
        {
            bool       res    = false;
            SqlCommand sqlcmd = new SqlCommand("spDeleteServices");

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

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Exemplo n.º 2
0
        public HttpResponseMessage RemoveServiceMaster(ServiceMasterRemoveDTO objServiceMaster)
        {
            HttpResponseMessage message;

            try
            {
                //   ServiceMasterDataAccessLayer dal = new ServiceMasterDataAccessLayer();
                var dynObj = new { result = _Service.RemoveServiceMaster(objServiceMaster) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Something wrong,try Again!" });
                ErrorLog.CreateErrorMessage(ex, "ServiceMaster", "RemoveServiceMaster");
            }
            return(message);
        }