Esempio n. 1
0
 public List<requisition> getPendingRequisitionEmployee(User u)
 {
     var t = (from a in luse.requisitions
              where a.userId == u.UserId && a.status.Trim() == "Pending"
              select a).ToList();
     return t;
 }
Esempio n. 2
0
 public List<requisition> getPreRequisition(User u)
 {
     var t = (from x in luse.requisitions
              where x.status == "Approved"
              select x).ToList();
     return t;
 }
Esempio n. 3
0
 public List<requisition> getPendingRequisition(User u)
 {
     var t = (from x in luse.requisitions
              where x.status == "Pending"
              select x).ToList();
     return t;
 }
Esempio n. 4
0
 public List<collectionPoint> getCollectionPointTime(User u)
 {
     var t = (from x in luse.collectionPoints
              select x
         ).ToList();
     return t;
 }
Esempio n. 5
0
 public List<user> getAllEmployee(User u)
 {
     var t = (from x in luse.users
              where x.departmentId == u.DepartmentId
              select x).ToList();
     return t;
 }
Esempio n. 6
0
        public void mailNotificationCollectionPoint(User u, string collectionP, string deptid)
        {
            var t = (from x in luse.users
                     where x.roleId == 4 || x.departmentId == u.DepartmentId
                     select x).ToList();
            var r = (from x in luse.users
                     from y in luse.departments
                     where x.userId == u.UserId && x.departmentId == y.departmentId
                     select y.deptName
                    ).First().Trim();

            string name = u.Name;
            string from = "*****@*****.**";
            string to = "*****@*****.**";

            string content = "<strong>Delegate Information: <strong> <br> Dear All,<br>" + "Our Collection Point has been changed as " + collectionP + ". FYI." + "<br><br> Regards," + u.Name;
            MailMessage messge = new MailMessage(from, to);
            foreach (user u2 in t)
            {
                messge.To.Add(u2.email);
            }
            messge.Body = content;
            messge.Subject = "Notification: Collection Point changed for Department " + r; //change and use session
            messge.IsBodyHtml = true;
            messge.Priority = MailPriority.High;

            SmtpClient client = new SmtpClient();
            client.Host = "smtp.live.com";
            client.Credentials = new NetworkCredential("*****@*****.**", "ibm1990324");
            client.EnableSsl = true;
            client.Send(messge);
            messge.Attachments.Dispose();
        }
Esempio n. 7
0
        public void mailNotification(string dt0, string dt1, User u,string newname)
        {
            var t = (from x in luse.users
                     where x.roleId == 4 || x.departmentId == u.DepartmentId
                     select x).ToList();
            var r = (from x in luse.users
                     from y in luse.departments
                     where x.userId == u.UserId && x.departmentId == y.departmentId
                     select y.deptName
                    ).First().Trim();

            string startDate = dt0;
            string endDate = dt1;
            string name = u.Name;
            string from = "*****@*****.**";
            string to = "*****@*****.**";

            string content = "<strong>Delegate Information: <strong> <br> Dear All,<br>" + newname + ", will take my responsibility to approve requisition from our department between" + dt0 + " and " + dt1 + "<br><br> Regards," + u.Name;
            MailMessage messge = new MailMessage(from, to);
             foreach (user u2 in t)
            {
                messge.To.Add(u2.email);
            }
            messge.Body = content;
            messge.Subject = "Notification: Delegation changed of " +r; //change and use session
            messge.IsBodyHtml = true;
            messge.Priority = MailPriority.High;

            SmtpClient client = new SmtpClient();
            client.Host = "smtp.live.com";
            client.Credentials = new NetworkCredential("*****@*****.**", "ibm1990324");
            client.EnableSsl = true;
            client.Send(messge);
            messge.Attachments.Dispose();
        }
Esempio n. 8
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     u = (User)Session["UserEntity"];
     sclist2 = (List<ShoppingItem>)Session["sclist"];
     rnrc.addRequisitionController(u, sclist2);
     Label1.Text = "add success";
 }
Esempio n. 9
0
 public List<requisition> getAllRequisitionEmployee(User u)
 {
     var t = (from a in luse.requisitions
              where a.userId == u.UserId
              select a).ToList();
     return t;
 }
Esempio n. 10
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     u = (User)Session["UserEntity"];
     sclist2 = (List<ShoppingItem>)Session["sclist"];
     rnrc.addRequisitionController(u, sclist2);
     Label1.Text = "Requisition has been created successfuly.";
     Button1.Enabled = false;
 }
 public void getdisbusementDetails(User u, int p)
 {
     Label1.Text = "Disbursement List ID: " + Request.Params["did"];
     contacName.Text = "Contact Person: " + vpdc.getDetailDisbursementList(u,p).First().ContacName;
     address.Text = "Collection Point: " + vpdc.getDetailDisbursementList(u,p).First().Address;
     time.Text = "Collection Time: " + vpdc.getDetailDisbursementList(u,p).First().Time;
     Labelflag.Text = "Collection Date: " + vpdc.getDetailDisbursementList(u, p).First().CollectionDate.ToShortDateString();
     GridView1.DataSource = vpdc.getDetailDisbursementList(u,p);
     GridView1.DataBind();
 }
Esempio n. 12
0
 public void changeCollectionPoint(User u, string collectionP)
 {
     var t = (from x in luse.departments
              where x.departmentId == u.DepartmentId
        select x).First();
     var y = (from r in luse.collectionPoints
              where r.address == collectionP
              select r).First();
     t.collectionPointId = y.collectionPointId;
     luse.SaveChanges();
 }
Esempio n. 13
0
 public List<realmessage> getAllmessage(User u)
 {
     var msg = (from x in luse.requisitions
                where x.status_dept == "Pending" && x.departmentId == u.DepartmentId
                select new realmessage
                {
                    MSG1 = x.requisitionId,
                    Msgdatetime = x.requestDate,
                    Status = x.status
                }
                ).ToList();
              return msg;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            u = (User)Session["UserEntity"];
            if (vpdc.getHisDisbursementList(u).Count() == 0)
            {
                Label1.Text = "There is no history disbursement list..";

            }
            else
            {
                GridView1.DataSource = vpdc.getHisDisbursementList(u);

                GridView1.DataBind();
            }
        }
Esempio n. 15
0
        public void confirmOperation(DataTable Data,User u)
        {
            for (int i = 0; i < Data.Rows.Count; i++)
            {

                String category = Data.Rows[i].ItemArray[0].ToString();
                String description = Data.Rows[i].ItemArray[1].ToString();
                int amount = Convert.ToInt32(Data.Rows[i].ItemArray[2]);
                String unit = Data.Rows[i].ItemArray[3].ToString();
                String type = Data.Rows[i].ItemArray[4].ToString();
                String remark = Data.Rows[i].ItemArray[5].ToString();
                DateTime reportdate = DateTime.Now;
                addToDiscrepancyTable(description, reportdate, remark, u.UserId, 50, amount, type);
            }
        }
Esempio n. 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            u = (User)Session["UserEntity"];
            //var N = from a in lu.requisitions
            //        where a.userId == u.UserId && a.status.Trim() == "Pending"
            //        select new
            //        {

            //            RequisitionDate = a.requestDate,
            //            Status = a.status,
            //            Rid = a.requisitionId

            //        };
            GridView1.DataSource = vcrc.PendingPastRequisition(u);
            GridView1.DataBind();
        }
Esempio n. 17
0
        public void confirmOperation2(List<discrepancyDetailEntityMobile> ddem, User u)
        {
            for (int i = 0; i < ddem.Count; i++)
            {

                String category = ddem[i].categoryName;
                String description = ddem[i].description;
                int amount = ddem[i].balance;
                String unit = ddem[i].unit;
                String type = ddem[i].type;
                String remark = ddem[i].Remark;
                DateTime reportdate = DateTime.Now;
                addToDiscrepancyTable(description, reportdate, remark, u.UserId, 50, amount, type);

            }
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            u = (User)Session["UserEntity"];
            if (vprc.getPreRequisition(u).Count() == 0)
            {
                head.Text = "There is no Current Requsition at this moment.";
                //RejectBtn.Visible = false;
                //ApproveBtn.Visible = false;
            }

            else
            {
                GridView2.DataSource = vprc.getPreRequisition(u);
                GridView2.DataBind();

            }
        }
Esempio n. 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     u = (User)Session["UserEntity"];
     if (cdlc.getDisbursementList(u).Count() == 0)
     {
         Label1.Text = "Current Disbursementlist has not been generated yet..";
         confirmBtn.Visible = false;
     }
     else
     {
         Label1.Text = "Current Week Disbursement List";
         contacName.Text = "Contact Person: " + cdlc.getDisbursementList(u).First().ContacName;
         address.Text ="Collection Point: " + cdlc.getDisbursementList(u).First().Address;
         time.Text ="Collection Time: " + cdlc.getDisbursementList(u).First().Time;
         colldate.Text = "Collection Date: " + cdlc.getDisbursementList(u).First().CollectionDate.ToShortDateString();
         GridView1.DataSource = cdlc.getDisbursementList(u);
     GridView1.DataBind();
     }
 }
Esempio n. 20
0
 public void addRequisition(User u, List<ShoppingItem> sclist)
 {
     requisition re = new requisition();
     re.departmentId = u.DepartmentId;
     re.userId = u.UserId;
     re.rejectReason = null;
     re.status_dept = "Pending";
     re.requestDate = DateTime.Now;
     luse.requisitions.Add(re);
     luse.SaveChanges();
     for (int i = 0; i < sclist.Count; i++) {
         requsiiton_item reItem = new requsiiton_item();
         reItem.requisitionId = re.requisitionId;
         reItem.itemId = sclist[i].ItemId;
         reItem.requestQty = sclist[i].Amount;
         luse.requsiiton_item.Add(reItem);
         luse.SaveChanges();
     }
     checkItemAvailable(re.requisitionId);
 }
Esempio n. 21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //User userbean = (User)Session["UserEntity"];
            //head.Text = "Hello," + userbean.Name;

            u = (User)Session["UserEntity"];
            if (vrc.getPendingRequisition(u).Count() == 0)
            {
                flag.Text = "There is no Current Requsition at this moment.";
                //RejectBtn.Visible = false;
                //ApproveBtn.Visible = false;
            }

            else
            {
                GridView1.DataSource = vrc.getPendingRequisition(u);
                GridView1.DataBind();

            }
        }
Esempio n. 22
0
        public void confirmDisbursement(User u)
        {
            try
                            {
                                var data = (from x in cntx.items
                                            from y in cntx.disbursements
                                            from z in cntx.disbursement_item
                                            where y.disbursementId == z.disbursementId && x.itemId == z.itemId && y.status == "WaitingCollection" && y.departmentId == u.DepartmentId
                                            select y).ToList();

                                foreach(disbursement x2 in data){
                                var update = (from x in cntx.disbursements
                                              where x.disbursementId == x2.disbursementId
                                              select x).FirstOrDefault();
                                update.status = "Completed";
                                }
                                cntx.SaveChanges();
                            }
                                catch (Exception e)
                                {
                            }
        }
Esempio n. 23
0
 public void getAllEmployee(User u)
 {
     GridEmp.DataSource = dac.getAllEmployee(u);
     GridEmp.DataBind();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Object o = pdController.getCategory();
                dropdownlist_category.DataSource = o;
                dropdownlist_category.DataBind();
            }

            u = (User)Session["UserEntity"];

            if (ViewState["Data"] != null)
            {
                GridViewBind(this.Gv1, ViewState["Data"] as DataTable);
            }
            else
            {

                Data.Columns.Add("Cposition");
                Data.Columns.Add("UserName");
                Data.Columns.Add("JanCount");
                Data.Columns.Add("Count");
                Data.Columns.Add("FebCount");
                Data.Columns.Add("remark");

                GridViewBind(this.Gv1, Data);
                ViewState["Data"] = Data;
            }

            Data = ViewState["Data"] as DataTable;
            if (Data.Rows.Count > 0)
            {
                for (int i = 0; i < Data.Rows.Count; i++)
                {
                    //这里应该存一个唯一键 来记录索引
                    //添加这个索引是为了后面删除和更新很方便的找到
                    ht.Add(i + 1, i);
                }
            }
        }
 public List<DisbursementList> getHisDisbursementList(User u)
 {
     return df.getHisDisbursementList(u);
 }
 public List<DisbursementList> getDetailDisbursementList(User u, int p)
 {
     return df.getHisDetailDisbursementList(u,p);
 }
 public void confirmRceive(User u)
 {
     df.confirmDisbursement(u);
 }
 public List<user> getAllEmployee(User u)
 {
     return uf.getAllEmployee(u);
 }
Esempio n. 29
0
 //
 public void formorder(User u)
 {
     var n = from a in ctx.items
             where (a.balance < a.reorderlevel) && (a.status == "stockout")
             from c in ctx.item_supplier
             where a.itemId == c.itemId
             from b in ctx.suppliers
             where b.supplierId == c.supplierId && (c.priority == 1)
             select b;
     var d = from a in ctx.items
             where (a.balance < a.reorderlevel) && (a.status == "stockout")
             from c in ctx.item_supplier
             where a.itemId == c.itemId
             from b in ctx.suppliers
             where b.supplierId == c.supplierId && (c.priority == 1)
             select c;
     List<supplier> s = n.ToList();
     List<item_supplier> ls = d.ToList();
     foreach (supplier x in s)
     {
         purchase po = new purchase();
         po.supplierId = x.supplierId;
         po.purchaseDate = DateTime.Today.Date;
         po.userId = u.UserId;
         po.expectedDeliveryDate = DateTime.Today.Date.AddDays(14);
         po.status = "waiting";
         ctx.purchases.Add(po);
         ctx.SaveChanges();
         foreach (item_supplier i in ls)
         {
             if (i.supplierId == x.supplierId)
             {
                 var y = from a in ctx.items
                         where a.itemId == i.itemId
                         select a;
                 item item = y.SingleOrDefault();
                 item.status = "ordering";
                 purchase_item pitem = new purchase_item();
                 pitem.purchaseId = po.purchaserId;
                 pitem.itemId = i.itemId.Value;
                 pitem.requestQty = item.reorderlevel;
                 pitem.supplierid = po.supplierId;
                 ctx.purchase_item.Add(pitem);
                 ctx.SaveChanges();
             }
         }
     }
 }
 public List<requisition> AllPastRequisition(User u)
 {
     return refacade.getAllRequisitionEmployee(u);
 }