Beispiel #1
0
        public ActionResult AdviceMaster(AdviceMaster obj, string SubmitBtn)
        {
            obj.CMD = SubmitBtn == "Save" ? "Save" : SubmitBtn == "Update" ? "Update" : "Delete";
            switch (obj.CMD)
            {
            case "Save":
                obj.hid = Convert.ToInt32(Session["hospital"].ToString());
                string[] str = obj.PerformAction();
                ViewBag.msg = str[1];
                return(RedirectToAction("AdviceDetails"));

            case "Update":
                string[] str1 = obj.PerformAction();
                ViewBag.msg = str1[2];
                return(RedirectToAction("AdviceDetails"));

            case "Delete":
                string[] str2 = obj.PerformAction();
                ViewBag.msg = str2[3];
                return(RedirectToAction("AdviceDetails"));

            default:
                return(View(obj));
            }
        }
Beispiel #2
0
 public ActionResult AdviceMasterUpdate(AdviceMaster obj, string SubmitBtn)
 {
     AdviceMaster(obj, SubmitBtn);
     if (SubmitBtn == "Delete")
     {
         return(Redirect("~/Treatment/AdviceMaster"));
     }
     return(View("AdviceMaster", obj));
 }
Beispiel #3
0
        public ViewResult AdviceDetails(AdviceMaster obj, string cmd)
        {
            DBConnection cn = new DBConnection();

            obj.CMD = "View";
            obj.hid = Convert.ToInt32(Session["hospital"].ToString());
            string  xml     = Common.ToXML(obj);
            DataSet dataset = cn.ExecuteProcedure("SP_Advice", xml);

            return(View(dataset));
        }
Beispiel #4
0
        public ViewResult AdviceMasterUpdate(int hid, int adviceid)
        {
            AdviceMaster obj = new AdviceMaster();

            if (adviceid > 0)
            {
                obj.CMD      = "Update";
                obj.adviceid = adviceid;
                obj.hid      = hid;
                obj          = obj.GetSingleAdvice(adviceid);
            }
            return(View("AdviceMaster", obj));
        }