public IHttpActionResult Get(int id) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; DTO.ClientMng.DataContainer data = bll.GetEditData(id, ControllerContext.GetAuthUserId(), out notification); //foreach (var item in data.Client.ClientContracts) //{ // if (!string.IsNullOrEmpty(item.ContractFileURL)) // { // item.ContractFileURL = System.Configuration.ConfigurationManager.AppSettings["ServiceUrl"] + System.Configuration.ConfigurationManager.AppSettings["FileUrl"] + item.ContractFileURL; // } //} return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.DataContainer>() { Data = data, Message = notification })); }
public IHttpActionResult GetDataClientAdditionalCondition() { BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; DTO.ClientMng.DataContainer dataResult = bll.GetDataClientAdditionalCondition(ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.DataContainer>() { Data = dataResult, Message = notification })); }
public IHttpActionResult GetBreakdownSearchFilterData() { BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; DTO.ClientMng.Overview.Breakdown.SupportDataDTO dataResult = bll.BreakdownGetSearchFilter(ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.Overview.Breakdown.SupportDataDTO>() { Data = dataResult, Message = notification })); }
public IHttpActionResult Delta3ExportExcel(int clientId, string season) { Library.DTO.Notification notification; BLL.ClientMng bll = new BLL.ClientMng(); string dataFileName = bll.Detal3ExportExcel(clientId, season, out notification); return(Ok(new Library.DTO.ReturnData <string>() { Data = dataFileName, Message = notification })); }
public IHttpActionResult ExportExcelClient(DTO.Search searchInput) { Library.DTO.Notification notification; BLL.ClientMng bll = new BLL.ClientMng(); string dataFileName = bll.ExportExcelClient(ControllerContext.GetAuthUserId(), searchInput.Filters, out notification); return(Ok(new Library.DTO.ReturnData <string>() { Data = dataFileName, Message = notification })); }
public IHttpActionResult GetSearchFilter() { BLL.ClientMng bll = new BLL.ClientMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; DTO.ClientMng.SearchFilterData data = bll.GetSearchFilter(out notification); if (notification.Type == Library.DTO.NotificationType.Error) { return(InternalServerError(new Exception(notification.Message))); } return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.SearchFilterData>() { Data = data, Message = notification, TotalRows = 0 })); }
public IHttpActionResult GetPlaningPurchasingPrice(int id) { BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; List <DTO.ClientMng.PlaningPurchasingPriceDTO> Data = bll.GetPlaningPurchasingPrice(ControllerContext.GetAuthUserId(), id, out notification); if (notification.Type != Library.DTO.NotificationType.Success) { return(InternalServerError(new Exception(notification.Message))); } return(Ok(new Library.DTO.ReturnData <List <DTO.ClientMng.PlaningPurchasingPriceDTO> >() { Data = Data, Message = notification })); }
public IHttpActionResult GetClientEstimatedAdditionalCost(int id) { Library.DTO.Notification notification; BLL.ClientMng bll = new BLL.ClientMng(); Module.Framework.BLL fwBLL = new Module.Framework.BLL(); if (!fwBLL.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } object data = bll.GetClientEstimatedAdditionalCost(id, out notification); return(Ok(new Library.DTO.ReturnData <object>() { Data = data, Message = notification })); }
public IHttpActionResult QuickSearchPIByLoadingPlan(int id, string season, int lpid) { Library.DTO.Notification notification; BLL.ClientMng bll = new BLL.ClientMng(); Module.Framework.BLL fwBLL = new Module.Framework.BLL(); if (!fwBLL.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } object data = bll.QuickSearchPI_ByLoadingPlan(lpid, id, season, out notification); return(Ok(new Library.DTO.ReturnData <object>() { Data = data, Message = notification })); }
public IHttpActionResult SaveGIC(int id, List <DTO.ClientMng.ClientContactHistory> dtoItem) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; bll.SaveGIC(id, dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <List <DTO.ClientMng.ClientContactHistory> >() { Data = dtoItem, Message = notification })); }
public IHttpActionResult GetClientOverview(int id) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; DTO.ClientMng.ClientOverview data = bll.GetClientOverview(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.ClientOverview>() { Data = data, Message = notification })); }
public IHttpActionResult getOfferMarginDetail(int id, string season, int status, int clientID) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; List <DTO.ClientMng.Overview.Offer.OfferMarginDetailDTO> data = bll.GetOfferMarginDetail(id, season, status, clientID, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <List <DTO.ClientMng.Overview.Offer.OfferMarginDetailDTO> >() { Data = data, Message = notification })); }
public IHttpActionResult GetBreakdownWithFilter(DTO.Search searchInput) { // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); //if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanRead)) //{ // return InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED)); //} BLL.ClientMng bll = new BLL.ClientMng(); Library.DTO.Notification notification; int totalRows = 0; DTO.ClientMng.Overview.Breakdown.SearchFormDTO searchResult = bll.BreakdownGetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification); return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.Overview.Breakdown.SearchFormDTO>() { Data = searchResult, Message = notification, TotalRows = totalRows })); }
public IHttpActionResult UpdateOfferPotentialStatus(List <DTO.ClientMng.Overview.Offer.OfferMarginDTO> dtoItems) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), "OfferMng", Library.DTO.ModuleAction.CanUpdate)) { // edit case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } // continue processing BLL.ClientMng bll = new BLL.ClientMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); bool result = bll.UpdateOfferPotentialStatus(ControllerContext.GetAuthUserId(), dtoItems, out notification); return(Ok(new Library.DTO.ReturnData <bool>() { Data = result, Message = notification })); }
public IHttpActionResult SetActiveStatus(int id, int st) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (id > 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate)) { // edit case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } // continue processing BLL.ClientMng bll = new BLL.ClientMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); bool result = bll.SetActivateStatus(ControllerContext.GetAuthUserId(), id, st == 1 ? true : false, out notification); return(Ok(new Library.DTO.ReturnData <bool>() { Data = result, Message = notification })); }
public IHttpActionResult Update(int id, DTO.ClientMng.Client dtoItem) { Library.DTO.Notification notification; // authentication Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (id > 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate)) { // edit case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } else if (id == 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate)) { // create new case return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } // validation if (!Helper.CommonHelper.ValidateDTO <DTO.ClientMng.Client>(dtoItem, out notification)) { return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.Client>() { Data = dtoItem, Message = notification })); } // continue processing BLL.ClientMng bll = new BLL.ClientMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); bll.UpdateData(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.ClientMng.Client>() { Data = dtoItem, Message = notification })); }