Exemplo n.º 1
0
        public ActionResult Parameter()
        {
            List <PathologyParameter> CategoryList = new List <PathologyParameter>();
            Property p  = new Property();
            DataSet  ds = new DataSet();

            p.OnTable = "FetchPathologyParameter";

            ds = dl.FetchPathologyParameter_sp(p);

            List <SelectListItem> Categoryinventory = new List <SelectListItem>();

            Categoryinventory.Add(new SelectListItem {
                Text = "Select", Value = ""
            });
            foreach (DataRow dr in ds.Tables[1].Rows)
            {
                Categoryinventory.Add(new SelectListItem {
                    Text = dr["UnitName"].ToString(), Value = dr["UnitId"].ToString()
                });
            }
            ViewBag.Categoryinventory = new SelectList(Categoryinventory, "Value", "Text");


            try
            {
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    PathologyParameter m = new PathologyParameter();

                    m.PId         = item["PId"].ToString();
                    m.PName       = item["PName"].ToString();
                    m.RefRange    = item["RefRange"].ToString();
                    m.Description = item["Description"].ToString();
                    m.UnitId      = item["UnitId"].ToString();
                    m.UnitName    = item["UnitName"].ToString();
                    m.AddedBy     = item["AddedBy"].ToString();
                    m.IsActive    = item["IsActive"].ToString();
                    CategoryList.Add(m);
                }
                ViewBag.CategoryList = CategoryList;
            }
            catch (Exception e)
            {
            }
            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Parameter(PathologyParameter c)
        {
            HttpCookie rxgoAdminCookie = Request.Cookies["rxgoAdmin"];
            string     AddedBy         = rxgoAdminCookie.Values["Hid"];

            c.AddedBy = AddedBy;
            try
            {
                if (dl.InsertPathologyParameter_Sp(c) > 0)
                {
                    TempData["MSG"] = "Data Saved Successfully";
                }
            }
            catch (Exception ex)
            {
                TempData["MSG"] = "Something went wrong.";
                return(Redirect("/Bed/PathologyParameter"));
            }
            TempData["MSG"] = "Data Saved Successfully.";
            return(Redirect("/Bed/PathologyParameter"));
        }