public int getTotalRecords(ProposalSeachCriteria _criteria, string _userID) { SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); using (SqlConnection connection = sqlConnection.GetConnection()) { return(ProposalDataLayer.GetInstance().getTotalRecords(connection, _criteria, _userID)); } }
public List <ProposalInfo> getAllProposal(int pageSize, int pageIndex, ProposalSeachCriteria _criteria, string _userID) { SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); using (SqlConnection connection = sqlConnection.GetConnection()) { return(ProposalDataLayer.GetInstance().getProposal(connection, _criteria, _userID)); } }
public List <ProposalInfo> getProposal(ProposalSeachCriteria _criteria, string _userID) { SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); using (SqlConnection connection = sqlConnection.GetConnection()) { List <ProposalInfo> ListProposal = ProposalDataLayer.GetInstance().getProposalByID(connection, _criteria, _userID); return(ListProposal); } }
public ListResponeMessage <ProposalInfo> GetList(int pageSize = 10, int pageIndex = 0) { ProposalSeachCriteria _criteria = new ProposalSeachCriteria(); _criteria.pageIndex = 0; _criteria.pageSize = 10; _criteria.FromDate = Helpers.Utils.StartOfDate(DateTime.Now); _criteria.ToDate = Helpers.Utils.EndOfDate(DateTime.Now); return(GetListWithCondition(_criteria)); }
public ListResponeMessage <ProposalInfo> GetListExceedReserve([FromQuery] ProposalSeachCriteria criteria) { ListResponeMessage <ProposalInfo> ret = new ListResponeMessage <ProposalInfo>(); try { string _userID = GetUserId(); ret.isSuccess = true; ret.data = ProposalService.GetInstance().GetAllExceedReserveProposal();//thống kê các đề xuất đã dự trù ret.totalRecords = ProposalService.GetInstance().getTotalRecords(criteria, _userID); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "005"; ret.err.msgString = ex.ToString(); } return(ret); }
public ListResponeMessage <ProposalsByDepartment> GetListByDepartment([FromQuery] ProposalSeachCriteria criteria) { ListResponeMessage <ProposalsByDepartment> ret = new ListResponeMessage <ProposalsByDepartment>(); try { string _userID = GetUserId(); ret.isSuccess = true; ret.data = ProposalService.GetInstance().GetByDepartment();//thống kê các đề xuất theo phòng ret.totalRecords = ProposalService.GetInstance().getTotalRecords(criteria, _userID); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "005"; ret.err.msgString = ex.ToString(); } return(ret); }
public ListResponeMessage <ProposalInfo> GetList([FromQuery] ProposalSeachCriteria criteria, [FromQuery] string reportType) { ListResponeMessage <ProposalInfo> ret = new ListResponeMessage <ProposalInfo>(); try { string user = GetUserId(); ret.isSuccess = true; ret.data = ProposalService.GetInstance().GetAllOutdateProposal(user);//thống kê các đề xuất quá hạn ret.totalRecords = ProposalService.GetInstance().getTotalRecords(criteria, user); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "005"; ret.err.msgString = ex.ToString(); } return(ret); }
public ListResponeMessage <ProposalInfo> GetListWithCondition([FromQuery] ProposalSeachCriteria _criteria) { ListResponeMessage <ProposalInfo> ret = new ListResponeMessage <ProposalInfo>(); try { string _userID = GetUserId(); ret.isSuccess = true; ret.data = ProposalService.GetInstance().getAllProposal(_criteria.pageSize, _criteria.pageIndex, _criteria, _userID); ret.totalRecords = ProposalService.GetInstance().getTotalRecords(_criteria, _userID); } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error !!!"; ret.err.msgString = ex.ToString(); } return(ret); }
public ActionMessage editProposal(int id, ProposalInfo _Proposal, string _userU) { ActionMessage ret = new ActionMessage(); SqlConnectionFactory sqlConnection = new SqlConnectionFactory(); UserLogInfo info = new UserLogInfo(); info.Action = "Update"; info.Description = "ngày " + _Proposal.DateIn + " khoa/phòng chịu trách nhiệm ID " + _Proposal.CurDepartmentID + " code " + _Proposal.ProposalCode + " khoa phòng đề xuất ID " + _Proposal.DepartmentID + " trạng thái " + _Proposal.Status; info.Feature = TableFile.Proposal.ToString(); info.Time = DateTime.Now; info.UserName = _userU; info.UserID = 1; UserService.GetInstance().TrackUserAction(info); using (SqlConnection connection = sqlConnection.GetConnection()) { ProposalSeachCriteria _criteria = new ProposalSeachCriteria(); _criteria.ProposalID = id.ToString(); var chkProposalInfo = getProposal(_criteria, ""); if (chkProposalInfo.Count > 0) { try { ProposalDataLayer.GetInstance().UpdateProposal(connection, id, _Proposal, _userU); ret.isSuccess = true; } catch (Exception ex) { ret.isSuccess = false; ret.err.msgCode = "Internal Error"; ret.err.msgString = ex.Message; } } } return(ret); }