public IHttpActionResult UpdateDetailTracking(int id, int idIssue, DTO.ModelMng.ModelIssueTrack dtoItem) { Library.DTO.Notification notification; Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (id > 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanUpdate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } else if (id == 0 && !fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanCreate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } if (!Helper.CommonHelper.ValidateDTO <DTO.ModelMng.ModelIssueTrack>(dtoItem, out notification)) { return(Ok(new Library.DTO.ReturnData <DTO.ModelMng.ModelIssueTrack>() { Data = dtoItem, Message = notification })); } BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); bll.UpdateDetailTracking(id, idIssue, ref dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.ModelMng.ModelIssueTrack>() { Data = dtoItem, Message = notification })); }
public IHttpActionResult Update(int id, DTO.ModelMng.Model 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.ModelMng.Model>(dtoItem, out notification)) { return(Ok(new Library.DTO.ReturnData <DTO.ModelMng.Model>() { Data = dtoItem, Message = notification })); } // continue processing BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); bll.UpdateData(id, ref dtoItem, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.ModelMng.Model>() { Data = dtoItem, Message = notification })); }
public IHttpActionResult GetClientData(string season, string clientID, int modelID) { //authencation Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, ModuleAction.CanUpdate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; int id = 0; if (season == "null") { season = ""; } if (clientID != "null") { id = Convert.ToInt32(clientID); } List <DTO.ModelMng.ClientSaleData> data = bll.GetClientSaleData(season, id, modelID, out notification); return(Ok(new Library.DTO.ReturnData <List <DTO.ModelMng.ClientSaleData> >() { Data = data, Message = notification })); }
public IHttpActionResult GetSearchSupportData() { BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; DTO.ModelMng.SearchFilterData data = bll.GetFilterData(out notification); return(Ok(new Library.DTO.ReturnData <DTO.ModelMng.SearchFilterData>() { Data = data, Message = notification, TotalRows = 0 })); }
public IHttpActionResult QuyeryCheckList(string param) { Hashtable input = new Hashtable(); input["query"] = param; BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification = new Library.DTO.Notification(); List <DTO.ModelMng.CheckListGroupDTO> data = bll.QuyeryCheckList(ControllerContext.GetAuthUserId(), "query-check", input, out notification); return(Ok(data)); }
public IHttpActionResult ExportExcelModel(DTO.Search searchInput) { Library.DTO.Notification notification; BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); string dataFileName = bll.ExportExcelModel(searchInput.Filters, out notification); //string dataFileName = string.Empty; return(Ok(new Library.DTO.ReturnData <string>() { Data = dataFileName, Message = notification })); }
public IHttpActionResult GetDataCreateModel(int id, int sampleProductID) { 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.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); object data = bll.GetDataCreateModel(ControllerContext.GetAuthUserId(), id, sampleProductID, out Library.DTO.Notification notification); return(Ok(new Library.DTO.ReturnData <object>() { Data = data, Message = notification })); }
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.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; DTO.ModelMng.EditFormData data = bll.GetData(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <DTO.ModelMng.EditFormData>() { Data = data, Message = notification })); }
public IHttpActionResult GetAdminDashboardData() { // 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))); } Library.DTO.Notification notification = new Library.DTO.Notification(); BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); object data = bll.GetModelNoFactory(ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <object>() { Data = data, Message = notification })); }
public IHttpActionResult GetModelDefaultoptionByPreviousSeason(int id, string season) { //authencation 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.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; List <DTO.ModelMng.ModelDefaultOptionDTO> data = bll.GetDefaultOptionByPreviousSeason(ControllerContext.GetAuthUserId(), id, season, out notification); return(Ok(new Library.DTO.ReturnData <List <DTO.ModelMng.ModelDefaultOptionDTO> >() { Data = data, Message = notification })); }
public IHttpActionResult SelfCalculationPrice(int id, string season, List <DTO.ModelMng.ModelPurchasingPriceConfigurationDetailDTO> dtoItem) { Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, ModuleAction.CanUpdate)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Notification notification; object data = bll.SelfCalculationPrice(ControllerContext.GetAuthUserId(), id, season, ref dtoItem, out notification); return(Ok(new ReturnData <object>() { Data = dtoItem, Message = notification })); }
public IHttpActionResult ResetData(int id, object dtoItem) { Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, ModuleAction.CanReset)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Notification notification; object data = bll.ResetData(ControllerContext.GetAuthUserId(), id, ref dtoItem, out notification); return(Ok(new ReturnData <object>() { Data = dtoItem, Message = notification })); }
public IHttpActionResult GetModelDefaultFactoryDetail(int modelID, int factoryID) { Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanDelete)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; List <DTO.ModelMng.ModelDefaultFactoryDetail> data = bll.GetModelDefaultFactoryDetail(modelID, factoryID, out notification); return(Ok(new Library.DTO.ReturnData <List <DTO.ModelMng.ModelDefaultFactoryDetail> >() { Data = data, Message = notification })); }
public IHttpActionResult DeleteDetailTracking(int id) { Module.Framework.BLL fwBll = new Module.Framework.BLL(); if (!fwBll.CanPerformAction(ControllerContext.GetAuthUserId(), moduleCode, Library.DTO.ModuleAction.CanDelete)) { return(InternalServerError(new Exception(Properties.Resources.NOT_AUTHORIZED))); } BLL.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; bll.DeleteDetailTracking(id, ControllerContext.GetAuthUserId(), out notification); return(Ok(new Library.DTO.ReturnData <int>() { Data = id, Message = notification })); }
public IHttpActionResult Gets(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.ModelMng bll = new BLL.ModelMng(Helper.AuthHelper.GetCurrentUserFolder(ControllerContext)); Library.DTO.Notification notification; int totalRows = 0; DTO.ModelMng.SearchFormData data = bll.GetDataWithFilter(ControllerContext.GetAuthUserId(), searchInput.Filters, searchInput.PageSize, searchInput.PageIndex, searchInput.SortedBy, searchInput.SortedDirection, out totalRows, out notification); return(Ok(new Library.DTO.ReturnData <DTO.ModelMng.SearchFormData>() { Data = data, Message = notification, TotalRows = totalRows })); }