Exemplo n.º 1
0
        public bool UpdateConsumeContractDetails(ContractConsumeUpdateDTO objContract)
        {
            bool       res    = false;
            SqlCommand SqlCmd = new SqlCommand("spUpdateConsumableRequirement");

            SqlCmd.CommandType = CommandType.StoredProcedure;
            SqlCmd.Parameters.AddWithValue("@Id", objContract.Id);
            SqlCmd.Parameters.AddWithValue("@ContractId", objContract.ContractId);
            SqlCmd.Parameters.AddWithValue("@SuppliedByCustomer", objContract.SuppliedByCustomer);
            SqlCmd.Parameters.AddWithValue("@PF", objContract.PF);
            SqlCmd.Parameters.AddWithValue("@ESIC", objContract.ESIC);
            SqlCmd.Parameters.AddWithValue("@Uniform", objContract.Uniform);
            SqlCmd.Parameters.AddWithValue("@LeaveWithWages", objContract.LeaveWithWages);
            SqlCmd.Parameters.AddWithValue("@Bonus", objContract.Bonus);
            SqlCmd.Parameters.AddWithValue("@Conveyance", objContract.Conveyance);
            SqlCmd.Parameters.AddWithValue("@Gratuity", objContract.Gratuity);
            SqlCmd.Parameters.AddWithValue("@ContractAmount", objContract.ContractAmount);
            SqlCmd.Parameters.AddWithValue("@ServiceTax", objContract.ServiceTax);
            SqlCmd.Parameters.AddWithValue("@ServiceCharge", objContract.ServiceCharge);
            SqlCmd.Parameters.AddWithValue("@TotalAmount", objContract.TotalAmount);
            SqlCmd.Parameters.AddWithValue("@Remarks", objContract.Remarks);
            SqlCmd.Parameters.AddWithValue("@Active", objContract.Active);
            SqlCmd.Parameters.AddWithValue("@ModifiedBy", objContract.ModifiedBy);
            int result = _unitOfWork.DbLayer.ExecuteNonQuery(SqlCmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Exemplo n.º 2
0
        public HttpResponseMessage UpdateConsumeRequirement(ContractConsumeUpdateDTO contract)
        {
            HttpResponseMessage message;

            try
            {
                // ContractDetailsDataAccessLayer dal = new ContractDetailsDataAccessLayer();
                var dynObj = new { result = _obj.UpdateConsumeContractDetails(contract) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });

                ErrorLog.CreateErrorMessage(ex, "ContractDetails", "CreateContractDetail");
            }
            return(message);
        }