Example #1
0
        public HttpResponseMessage AddProjectTimeEstimation(AddendumDomainModel model)
        {
            HttpResponseMessage httpResponse = new HttpResponseMessage();

            try
            {
                var objRes = ProjectRepository.AddProjectTimeEstimation(model);
                if (objRes == null)
                {
                    httpResponse = Request.CreateResponse(HttpStatusCode.InternalServerError, "Error Occurred");
                }
                else
                {
                    httpResponse = Request.CreateResponse(HttpStatusCode.OK, objRes);
                }
                return(httpResponse);
            }
            catch (Exception ex)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)
                {
                    Content      = new StringContent("An error occurred, please try again or contact the administrator."),
                    ReasonPhrase = "An error occurred, please try again or contact the administrator.",
                    StatusCode   = HttpStatusCode.InternalServerError
                });
            }
        }
 public ResponseDomainModel AddProjectTimeEstimation(AddendumDomainModel model)
 {
     try
     {
         ResponseDomainModel objRes = new ResponseDomainModel();
         int ProjectTimeEstimation  = objHelper.ExecuteScalar("AddProjectTimeEstimation", new
         {
             @ProjectId           = model.ProjectId,
             EstimateHours        = model.EstimateHours,
             AssignHours          = model.AssignHours,
             UploadDocument       = model.UploadDocument,
             DeveloperCodingHours = model.DeveloperCodingHours,
             WebServiceHours      = model.WebServiceHours,
             DesignHours          = model.DesignHours,
             QAHours     = model.QAHours,
             IsApprove   = model.IsApprove,
             HourlyRate  = model.HourlyRate,
             CreatedDate = model.CreatedDate
         });
         if (ProjectTimeEstimation > 0)
         {
             objRes.isSuccess = true;
             objRes.response  = "Project Time Estimation saved successfully";
         }
         else
         {
             objRes.isSuccess = false;
             objRes.response  = "Something went wrong, please try again.";
         }
         return(objRes);
     }
     catch (Exception ex)
     {
         ErrorLog.LogError(ex);
         return(null);
     }
 }