public List <VesselModel> Get(VesselModel filter) { PagerModel pager = new PagerModel(0, Int32.MaxValue - 1, "", ""); VesselDA vesselDA = new VesselDA(); return(vesselDA.Get(pager, filter)); }
public RequestResult <VesselModel> InsUpd(VesselModel model) { bool isAdd = model.VesselId == null; ImagesServices ImageServ = new ImagesServices(); FileServices FileServ = new FileServices(); VesselDA vesselDA = new VesselDA(); RequestResult <VesselModel> resp = new RequestResult <VesselModel>() { Status = Status.Success }; TransactionOptions scopeOptions = new TransactionOptions(); //scopeOptions.IsolationLevel = IsolationLevel.ReadCommitted; using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, scopeOptions)) { try { resp = vesselDA.InsUpd(model); if (model.Image.FileContent != null && model.Image.FileContent.Length > 0) { Stream ProcessedImage = ImageServ.ResizeProfileImage(model.Image.FileContent); ProcessedImage.Position = 0; var FileNameExtension = ".jpg"; model.Image.FileName = "vesselimage-" + model.VesselId + FileNameExtension; var path = "vessels/" + model.VesselId + "/images/"; model.Image.ContentType = "image/jpeg"; model.Image.Path = path; model.Image.FileContent = ProcessedImage; FileServ.SaveFile(model.Image); if (isAdd) { resp = vesselDA.InsUpd(model); } } ts.Complete(); } catch (Exception ex) { ts.Dispose(); resp = new RequestResult <VesselModel>() { Status = Status.Error, Message = ex.Message }; Elmah.ErrorSignal.FromCurrentContext().Raise(ex); throw ex; } } return(resp); }
public RequestResult <VesselCostModel> InsUpdCost(VesselCostModel model) { VesselDA vesselDA = new VesselDA(); RequestResult <VesselCostModel> resp = new RequestResult <VesselCostModel>() { Status = Status.Success }; return(vesselDA.InsUpdCost(model)); }
public RequestResult <VesselSpecificInfoModel> InsUpdSpecificInfo(VesselSpecificInfoModel model) { VesselDA vesselDA = new VesselDA(); RequestResult <VesselSpecificInfoModel> resp = new RequestResult <VesselSpecificInfoModel>() { Status = Status.Success }; return(vesselDA.InsUpdSpecificInfo(model)); }
public VesselModel GetFirst(VesselModel filter) { VesselDA vesselDA = new VesselDA(); PagerModel pager = new PagerModel(0, 1, "", ""); VesselModel resp = Get(pager, filter).FirstOrDefault(); if (resp != null) { resp.Suitability = vesselDA.GetSuitability((int)resp.VesselId); } return(resp); }
public List <VesselModel> Get(PagerModel pager, VesselModel filter) { VesselDA vesselDA = new VesselDA(); return(vesselDA.Get(pager, filter)); }
public List <VesselModel> VesselAvailableProject(int CompanyId, int ProjectId, int OfferId) { VesselDA da = new VesselDA(); return(da.VesselAvailableProject(CompanyId, ProjectId, OfferId)); }
public VesselCostModel GetCost(int VesselId) { VesselDA vesselDA = new VesselDA(); return(vesselDA.GetCost(VesselId)); }
public VesselSpecificInfoModel GetSpecificInfo(int VesselId) { VesselDA vesselDA = new VesselDA(); return(vesselDA.GetSpecificInfo(VesselId)); }
public int EvalAvailability(VesselAvailabilityModel model) { VesselDA vesselDA = new VesselDA(); return(vesselDA.ValAvailability(model)); }
public RequestResult <string> Eval(VesselModel model) { VesselDA vesselDA = new VesselDA(); return(vesselDA.Val(model)); }