Beispiel #1
0
        public HttpResponseMessage RemoveContractDetail(ContractDetailsRemoveDTO objContract)
        {
            HttpResponseMessage message;

            try
            {
                // ContractDetailsDataAccessLayer dal = new ContractDetailsDataAccessLayer();
                var dynObj = new { result = _obj.RemoveContractDetail(objContract) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = " Something wrong,try Again!" });
                ErrorLog.CreateErrorMessage(ex, "ContractDetails", "RemoveContractDetail");
            }
            return(message);
        }
Beispiel #2
0
        public bool RemoveContractDetail(ContractDetailsRemoveDTO objContract)
        {
            bool       res    = false;
            SqlCommand sqlcmd = new SqlCommand("spDeleteContractDetail");

            sqlcmd.CommandType = CommandType.StoredProcedure;
            sqlcmd.Parameters.AddWithValue("@ContractId", objContract.ContractId);
            sqlcmd.Parameters.AddWithValue("@Designation", objContract.Designation);
            sqlcmd.Parameters.AddWithValue("@Active", objContract.Active);
            sqlcmd.Parameters.AddWithValue("@ActionBy", objContract.ActionBy);
            int result = _unitOfWork.DbLayer.ExecuteNonQuery(sqlcmd);

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