Exemplo n.º 1
0
        public ActionResult StatusUpdate(Processed_Application p, string Command)
        {
            if (Command == "Status")
            {
                int id   = int.Parse(Request.Form["txtid"].ToString());
                var data = db.Processed_Applications.Where(x => x.applicationid == id).SingleOrDefault();
                ModelState.AddModelError("", data.comments);
                //Request.Form["txtid"] = data.comments;
                return(View());
            }

            if (Command == "Update")
            {
                int    id      = int.Parse(Request.Form["txtid"].ToString());
                var    data    = db.Processed_Applications.Where(x => x.applicationid == id).SingleOrDefault();
                string comment = Request.Form["txtcomment"].ToString();
                data.comments        = comment;
                data.date_of_resolve = DateTime.Now;

                var status = (from t in db.Applications
                              join b in db.Branches on t.branch_id equals b.branch_id
                              where t.Id == id
                              select b.contact_person).SingleOrDefault();

                data.resolvedby = status;

                var res = db.SaveChanges();
                if (res > 0)
                {
                    ModelState.AddModelError("", "Status Updated");
                }
                return(View());
            }
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Status(Processed_Application pa)
        {
            int    id   = int.Parse(Request.Form["txtid"].ToString());
            var    data = db.Processed_Applications.Where(x => x.applicationid == id).SingleOrDefault();
            string st   = data.comments;
            string pt   = data.resolvedby;

            if (st == "Submitted, But Not Yet Procesed")
            {
                ModelState.AddModelError("", st + " Check Later.");
            }
            else
            {
                ModelState.AddModelError("", st + " " + "Please Contact" + " " + pt);
            }



            return(View());
        }
Exemplo n.º 3
0
        public ActionResult InsertApplication(Application ap, Processed_Application pa)
        {
            ap.branch_id = int.Parse(Request.Form["ddlbranch"].ToString());
            ap.classid   = int.Parse(Request.Form["ddlclassid"].ToString());
            ap.name      = Request.Form["txtname"].ToString();
            ap.address   = Request.Form["txtaddress"].ToString();
            ap.age       = int.Parse(Request.Form["txtage"].ToString());
            ap.dob       = DateTime.Parse(Request.Form["txtdob"].ToString());

            pa.comments = "Submitted, But Not Yet Procesed";
            db.Applications.Add(ap);
            db.Processed_Applications.Add(pa);
            var res = db.SaveChanges();

            if (res > 0)
            {
                ModelState.AddModelError("", "Data Inserted");
                ModelState.AddModelError("", "Your Application has been submitted. Your Application id = " + ap.Id);
            }

            return(View());
        }