Пример #1
0
        public static void getAllDepts()
        {
            List <Object> olist2 = RequisitionDAO.getAllDepInvolved();

            foreach (Object o in olist2)
            {
                Console.WriteLine(o.ToString().Substring(12, 4));
                depList.Add(o.ToString().Substring(12, 4));
            }
        }
        public static void submitRejected(string reqListNumber, string comment)
        {
            RequisitionDAO.changeReqListStatusRejected(reqListNumber, comment);

            Employee e             = RequisitionDAO.getEmp(reqListNumber);
            string   receiverEmail = e.Email;
            string   depCode       = e.DepartmentCode;
            Employee head          = EmployeeDAO.getDepHeadEmployee(depCode);
            string   senderEmail   = head.Email;

            MailMessage m = new MailMessage(senderEmail, receiverEmail);

            m.Subject = "";
            m.Body    = "Your request has been rejected";
            SmtpClient c = new SmtpClient("lynx.iss.nus.edu.sg");

            c.Send(m);
            RequisitionDAO.changeReqListStatusApproved(reqListNumber);
        }
        public static void submitApproval(string reqListNumber, string mobileORweb)
        {
            if (mobileORweb == "web")
            {
                RequisitionDAO.changeReqListStatusApproved(reqListNumber);
            }

            else if (mobileORweb == "mobile")
            {
                Employee e             = RequisitionDAO.getEmp(reqListNumber);
                string   receiverEmail = e.Email;
                string   depCode       = e.DepartmentCode;
                Employee head          = EmployeeDAO.getDepHeadEmployee(depCode);
                string   senderEmail   = head.Email;

                MailMessage m = new MailMessage(senderEmail, receiverEmail);
                m.Subject = "";
                m.Body    = "Your request has been approved";
                SmtpClient c = new SmtpClient("lynx.iss.nus.edu.sg");
                c.Send(m);
                RequisitionDAO.changeReqListStatusApproved(reqListNumber);
            }
            //RequisitionDAO.changeReqListStatusApproved(reqListNumber);
        }
 public static string getApprovedByWho(string depName)
 {
     return(RequisitionDAO.getApprovedBy(depName));
 }
Пример #5
0
 public static void submitCart(string empNum)
 {
     RequisitionDAO.createRequisitionDetails(empNum);
     CartDAO.deleteEmployeeCart(empNum);
 }
 public static void submitRejected(string reqListNumber)
 {
     RequisitionDAO.changeReqListStatusRejected(reqListNumber, "rejected from mobile");
 }
 public static List <RequisitionDetail> reqDetailsW(string reqListNumber) //for WCF
 {
     return(RequisitionDAO.getDetialsOfListW(reqListNumber));
 }
        /** added by nitin for wcf
         * */
        public static List <RequisitionList> getAllPendingReq(string empNum) /// for WCF
        {
            string s = EmployeeDAO.getDepCodetOfEmp(empNum);

            return(RequisitionDAO.getAllPendingReqDataW(s));
        }
 public static List <Object> pupulateDetails(string reqListNumber)
 {
     return(RequisitionDAO.getDetialsOfList(reqListNumber));
 }
        public static List <Object> populateAllPendingReq(string empNum)
        {
            string s = EmployeeDAO.getDepCodetOfEmp(empNum);

            return(RequisitionDAO.getAllPendingReqData(s));
        }
Пример #11
0
        public static void generateDisbursementList()
        {
            Dictionary <string, List <ConsolidatedRequisitionListDetail> > consolidatedDictionary = new Dictionary <string, List <ConsolidatedRequisitionListDetail> >();
            List <string> dlist = new List <string>();
            List <ConsolidatedRequisitionList> el;

            el = ConsolidatedRequisitionListEFFacade.getAllDepInvolved();
            foreach (ConsolidatedRequisitionList e in el)
            {
                dlist.Add(e.DepartmentCode);
            }


            List <string> deplist = RequisitionDAO.getAllReqDepartments();

            if (deplist.Count() != 0)
            {
                for (int p = 0; p < deplist.Count(); p++)
                {
                    if (dlist.Contains(deplist[p]))
                    {
                        ConsolidatedRequisitionList cl = ConsolidatedRequisitionListEFFacade.getOpenListForDept(deplist[p]);
                        int           listid           = cl.ConsolidatedListID;
                        List <string> itemlist         = ConsolidatedRequisitionListEFFacade.getAllItemsOfList(listid);
                        List <Object> olist1           = RequisitionDAO.getAllApprovedOfDep(deplist[p]);

                        for (int i = 0; i < olist1.Count(); i++)
                        {
                            string itmeNum;
                            itmeNum = olist1[i].ToString().Substring(15, 4);
                            if (itemlist.Contains(itmeNum))
                            {
                                ConsolidatedRequisitionListEFFacade.addRequestedQtyForItem(listid, itmeNum, Convert.ToInt32(olist1[i].ToString().Substring(32, ((olist1[i].ToString().Length) - 34))));
                            }

                            else
                            {
                                ConsolidatedRequisitionListEFFacade.addDetailToList(listid, itmeNum, Convert.ToInt32(olist1[i].ToString().Substring(32, ((olist1[i].ToString().Length) - 34))), (RequisitionDAO.getTheFirstDatetDate(deplist[p])), 0);
                            }
                        }
                    }
                    if (dlist.Contains(deplist[p]) == false)
                    {
                        List <Object> olist = RequisitionDAO.getAllApprovedDetails(deplist[p]);
                        List <ConsolidatedRequisitionListDetail> crl = new List <ConsolidatedRequisitionListDetail>();
                        for (int i = 0; i < olist.Count(); i++)
                        {
                            ConsolidatedRequisitionListDetail c = new ConsolidatedRequisitionListDetail();
                            c.ItemNumber        = olist[i].ToString().Substring(15, 4);
                            c.QuantityRequested = Convert.ToInt32(olist[i].ToString().Substring(32, ((olist[i].ToString().Length) - 34)));
                            c.DateRequest       = RequisitionDAO.getTheFirstDatetDate(deplist[p]);
                            c.ActualQuantity    = 0;
                            crl.Add(c);
                        }
                        consolidatedDictionary.Add(deplist[p], crl);
                    }
                }
                ConsolidatedRequisitionListEFFacade.createNewConsolidatedRequisitionList(consolidatedDictionary);
                RequisitionDAO.changeApprovedToClosed();
            }
        }