public List <CommentViewModel> GetCommentByProductId(Guid id) { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_CommentSelectByProductId", "@Id", id); var lst = Ultis.DataTableToList <CommentViewModel>(dtb); return(lst); }
public List <RoleDetailViewModel> GetAllAccountGroup() { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_DetailRoleSelectAll"); var lst = Ultis.DataTableToList <RoleDetailViewModel>(dtb); return(lst); }
public List <MenuViewModel> GetMenuByPId(Guid id) { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_MenuSelectByPID", "@Id", id); var lst = Ultis.DataTableToList <MenuViewModel>(dtb); return(lst); }
public List <Category> GetlAllCategories() { DataTable dtb = SqlDb_Ultis.ExeSQLToDataTable("Select * from tbl_Category"); var lst = Ultis.DataTableToList <Category>(dtb); return(lst); }
public Response <ReceivedDocumentModel> Update(int Id, ReceivedDocumentUpdateModel updateModel) { try { using (var unitOfWork = new UnitOfWork()) { var entity = unitOfWork.GetRepository <ReceivedDocument>().GetById(Id); if (entity != null) { Ultis.TransferValues(entity, updateModel); entity.LastModifiedOnDate = DateTime.Now; unitOfWork.GetRepository <ReceivedDocument>().Update(entity); if (unitOfWork.Save() >= 1) { return(GetById(entity.ReceivedDocumentId)); } return(new Response <ReceivedDocumentModel>(0, "Lưu thông tin không thành công", null)); } return(new Response <ReceivedDocumentModel>(0, "Tài liệu không tồn tại", null)); } } catch (Exception ex) { return(new Response <ReceivedDocumentModel>(-1, ex.ToString(), null)); } }
public List <MenuViewModel> GetAllMenu() { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_MenuSelectAll"); var lst = Ultis.DataTableToList <MenuViewModel>(dtb); return(lst); }
public List <ProductAttributeValueViewModel> GetAllProductAttributeValue() { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Product_Attribute_ValueSelectAll"); var lst = Ultis.DataTableToList <ProductAttributeValueViewModel>(dtb); return(lst); }
public List <ProductAttributeValueViewModel> GetProductAttributeValueByProId(Guid Id) { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Product_Attribute_ValueSelectByProId", "@Id", Id); var lst = Ultis.DataTableToList <ProductAttributeValueViewModel>(dtb); return(lst); }
public List <OrderViewModel> GetOrderByAccount(string id) { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_OrderSelectByAccount", "@Id", id); var lst = Ultis.DataTableToList <OrderViewModel>(dtb); return(lst); }
public List <OrderViewModel> GetAllOrder() { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_OrderSelectAll"); var lst = Ultis.DataTableToList <OrderViewModel>(dtb); return(lst); }
public List <ProductAttributeViewModel> GetAllProducAttributebySP(Guid masanpham) { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("LoadAttr", "@Id", masanpham); var lst = Ultis.DataTableToList <ProductAttributeViewModel>(dtb); return(lst); }
public List <AccountViewModel> GetAllAccount() { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_AccountSelectAll"); var lst = Ultis.DataTableToList <AccountViewModel>(dtb); return(lst); }
public List <ProductGroupViewModel> GetAllProductGroup() { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_ProductGroupSelectAll"); var lst = Ultis.DataTableToList <ProductGroupViewModel>(dtb); return(lst); }
public Response <DirectoryModel> Update(int Id, DirectoryUpdateModel updateModel) { try { using (var unitOfWork = new UnitOfWork()) { var dir = unitOfWork.GetRepository <Directory>().GetById(Id); if (dir != null) { Ultis.TransferValues(dir, updateModel); dir.Name = updateModel.Name; dir.ParentId = updateModel.ParentId; dir.LastModifiedByUserId = updateModel.LastModifiedByUserId; dir.LastModifiedOnDate = DateTime.Now; unitOfWork.GetRepository <Directory>().Update(dir); if (unitOfWork.Save() >= 1) { return(GetById(dir.DirectoryId)); } return(new Response <DirectoryModel>(0, "Lưu thông tin không thành công!", null)); } else { return(new Response <DirectoryModel>(0, "Không tìm thấy thư mục", null)); } } } catch (Exception ex) { return(new Response <DirectoryModel>(-1, ex.ToString(), null)); } }
public Response <DocumentPerformModel> Update(int Id, DocumentPerformUpdateModel updateModel) { try { using (var unitOfWork = new UnitOfWork()) { var entity = unitOfWork.GetRepository <DocumentPerform>().GetById(Id); if (entity != null) { Ultis.TransferValues(entity, updateModel); entity.UpdatedOnDate = DateTime.Now; unitOfWork.GetRepository <DocumentPerform>().Update(entity); if (unitOfWork.Save() >= 1) { return(GetById(entity.PerformId)); } return(new Response <DocumentPerformModel>(0, "Saving data not successful!", null)); } return(new Response <DocumentPerformModel>(0, "Id is not valid", null)); } } catch (Exception ex) { return(new Response <DocumentPerformModel>(-1, ex.ToString(), null)); } }
public List <OrderDetailViewModel> GetOrderDetailByOrder(Guid id) { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_OrderDetailSelectByOrder", "@Id", id); var lst = Ultis.DataTableToList <OrderDetailViewModel>(dtb); return(lst); }
public Response <BusinessPartnerModel> Update(int Id, BusinessPartnerUpdateModel updateModel) { try { using (var unitOfWork = new UnitOfWork()) { var dir = unitOfWork.GetRepository <BusinessPartner>().GetById(Id); if (dir != null) { Ultis.TransferValues(dir, updateModel); unitOfWork.GetRepository <BusinessPartner>().Update(dir); if (unitOfWork.Save() >= 1) { return(GetById(dir.PartnerId)); } return(new Response <BusinessPartnerModel>(0, "Lưu thông tin không thành công!", null)); } else { return(new Response <BusinessPartnerModel>(0, "Không tìm thấy phòng ban", null)); } } } catch (Exception ex) { return(new Response <BusinessPartnerModel>(-1, ex.ToString(), null)); } }
public Response <DocumentPerformResponseModel> CreateResponse(DocumentPerformResponseModel createModel) { try { using (var unitOfWork = new UnitOfWork()) { var existed = unitOfWork.GetRepository <QH_DocumentPerform_User>().Get(d => d.DocumentPerformId == createModel.DocumentPerformId && d.UserId == createModel.UserId); if (existed != null) { return(new Response <DocumentPerformResponseModel>(0, "Bạn đã thống nhất rồi!", null)); } QH_DocumentPerform_User entity = new QH_DocumentPerform_User(); Ultis.TransferValues(entity, createModel); unitOfWork.GetRepository <QH_DocumentPerform_User>().Add(entity); //update status //turn off notif var notif = unitOfWork.GetRepository <TaskMessage>().Get(c => c.UserId == createModel.UserId && c.RelatedId == createModel.DocumentPerformId); if (notif != null) { notif.Status = 1; unitOfWork.GetRepository <TaskMessage>().Update(notif); } if (unitOfWork.Save() >= 1) { return(GetResponse(createModel.UserId, createModel.DocumentPerformId)); } return(new Response <DocumentPerformResponseModel>(0, "", null)); } } catch (Exception ex) { return(new Response <DocumentPerformResponseModel>(-1, ex.ToString(), null)); } }
public void BeforeAnimation(ref BookData Data) { string str = "/PageFlip;component/Images/HomeMenuPage/home_02.jpg"; Data.TurnTypeManager = TurnType.NoTurn; Data._previousPageLeftPart = null; Data._previousPageRightPart = null; Data._currentPageLeftPage = null; Data._currentPageRightPage = null; Data._nextPageLeftPart = null; Data._nextPageRightPart = null; Data.PreNextPageLeftPart = null; Data.PreNextPageRightPart = null; string xaml = @" <Button xmlns='http://schemas.microsoft.com/client/2007' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' > <Image Source='{0}'></Image> </Button> "; xaml = string.Format(xaml, str);//Data.FirstCoverImageSource); Button bt = (Button)Ultis.LoadXamlFromString(xaml); bt.Click += new RoutedEventHandler(bt_Click); Data._currentPageRightPage = bt; }
public Response <InternalDocumentModel> Update(int Id, InternalDocumentUpdateModel userModel) { try { using (var unitOfWork = new UnitOfWork()) { var entity = unitOfWork.GetRepository <InternalDocument>().GetById(Id); if (entity != null) { Ultis.TransferValues(entity, userModel); unitOfWork.GetRepository <InternalDocument>().Update(entity); if (unitOfWork.Save() >= 1) { return(GetById(entity.InternalDocumentId)); } return(new Response <InternalDocumentModel>(0, "Lưu thông tin không thành công", null)); } return(new Response <InternalDocumentModel>(0, "Tài liệu không tồn tại", null)); } } catch (Exception ex) { return(new Response <InternalDocumentModel>(-1, ex.ToString(), null)); } }
public List <NewsViewModel> GetAllNews() { DataTable dtb = SqlDb_Ultis.ExeStoredToDataTable("Tbl_NewsSelectAll"); var lst = Ultis.DataTableToList <NewsViewModel>(dtb); return(lst); }
public Response <DocumentModel> Update(int Id, DocumentUpdateModel updateModel) { try { using (var unitOfWork = new UnitOfWork()) { var doc = unitOfWork.GetRepository <Document>().GetById(Id); if (doc != null) { Ultis.TransferValues(doc, updateModel); unitOfWork.GetRepository <Document>().Update(doc); if (unitOfWork.Save() >= 1) { return(GetById(doc.DocumentId)); } return(new Response <DocumentModel>(0, "Lưu thông tin không thành công!", null)); } else { return(new Response <DocumentModel>(0, "Không tìm thấy tài liệu", null)); } } } catch (Exception ex) { return(new Response <DocumentModel>(-1, ex.ToString(), null)); } }
public IList <AnswerEntities> GetAllAnswer() { var answers = _unit.AnswerGenericType.GetAll().ToList(); if (answers.Any()) { return(Ultis.MapList <Answer, AnswerEntities>(answers)); } return(null); }
public ChoicesEntites GetChoicesById(Guid id) { var choices = _unit.ChoiceGenericType.GetByID(id); if (choices != null) { return(Ultis.MapObject <Choice, ChoicesEntites>(choices));; } return(null); }
public IList <ChoicesEntites> GetAllChoices() { var choices = _unit.ChoiceGenericType.GetAll().ToList(); if (choices.Any()) { return(Ultis.MapList <Choice, ChoicesEntites>(choices)); } return(null); }
public IList <QuestionTypeEntities> GettAllQuestionType() { var questiontype = _unit.QuestionTypeGenericType.GetAll().ToList(); if (questiontype.Any()) { return(Ultis.MapList <QuestionType, QuestionTypeEntities>(questiontype)); } return(null); }
public QuestionTypeEntities GetQuestionTypeById(Guid id) { var questiontype = _unit.QuestionTypeGenericType.GetByID(id); if (questiontype != null) { return(Ultis.MapObject <QuestionType, QuestionTypeEntities>(questiontype)); } return(null); }
public AccountGroupEntities GetAccountGroupById(string id) { var accgr = _unit.AccountGroupGenericType.GetByID(id); if (accgr != null) { return(Ultis.MapObject <AccountGroup, AccountGroupEntities>(accgr)); } return(null); }
public IList <AccountGroupEntities> GetAllAccountGroup() { var accgr = _unit.AccountGroupGenericType.GetAll().ToList(); if (accgr.Any()) { return(Ultis.MapList <AccountGroup, AccountGroupEntities>(accgr)); } return(null); }
public AnswerEntities GetAnswerById(Guid id) { var answers = _unit.AnswerGenericType.GetByID(id); if (answers != null) { return(Ultis.MapObject <Answer, AnswerEntities>(answers)); } return(null); }