public void coursedata() { DataSet ds = null; Coursemaster course = new Coursemaster(); course.Action = "Select"; ds = course.coursemaster(course); ViewData["AllcouData"] = ds.Tables[0]; }
// // GET: /Bookonline/ public ActionResult Index(String seName, string location, String ObType, String price) { ViewBag.Type = ObType; if (ObType == "Course") { DataSet ds = null; Coursemaster course = new Coursemaster(); course.Action = "Selectonslug"; course.SlugName = seName; course.Location = location; ds = course.coursemaster(course); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { ViewBag.CName = ds.Tables[0].Rows[0]["Name"].ToString(); ViewBag.Location = ds.Tables[0].Rows[0]["Location"].ToString(); ViewBag.Date = ds.Tables[0].Rows[0]["Date"].ToString(); String pri = ds.Tables[0].Rows[0]["Price"].ToString(); ViewBag.Fee = pri; double gst1 = (Convert.ToDouble(pri) * 10 / 100); ViewBag.gst = gst1.ToString("0.00"); double total1 = Convert.ToDouble(pri) + gst1; ViewBag.total = total1.ToString("0.00"); } } else if (ObType == "Online") { DataSet ds = null; OnlineCourseMaster course = new OnlineCourseMaster(); course.Action = "Selectonslug"; course.Slug_Name = seName; ds = course.OnlineCourseMasters(course); if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { ViewBag.CName = ds.Tables[0].Rows[0]["Name"].ToString(); String pri = ds.Tables[0].Rows[0]["price"].ToString(); ViewBag.Fee = pri; double gst1 = (Convert.ToDouble(pri) * 10 / 100); ViewBag.gst = gst1.ToString("0.00"); double total1 = Convert.ToDouble(pri) + gst1; ViewBag.total = total1.ToString("0.00"); } } else { ViewBag.CName = seName; ViewBag.Fee = price; double gst = (Convert.ToDouble(price) * 10 / 100); ViewBag.gst = gst; double total = Convert.ToDouble(price) + gst; ViewBag.total = total; } return View("~/Views/Home/Bookonline.cshtml"); }
public ActionResult Index(Coursemaster model, string submit) { if (submit == "Submit" || submit == null) { master.Action = "Insert"; master.Trainingid = model.Trainingid; master.Name = model.Name; master.SlugName = model.Name.Replace("®", "").Replace("&", "").Replace(" ", "").ToLower() + model.Duration + DateTime.Now.ToShortDateString().Replace("/", ""); master.Location = model.Location; master.Duration = model.Duration; master.Date = model.Date; master.Price = model.Price; DataSet ds = master.coursemaster(master); TempData["message"] = ds.Tables[0].Rows[0][0].ToString(); } else { master.Action = "Update"; master.C_Id = model.C_Id; master.Trainingid = model.Trainingid; master.Name = model.Name; master.SlugName = model.Name.Replace("®", "").Replace("&", "").Replace(" ", "").ToLower() + model.Duration + DateTime.Now.ToShortDateString().Replace("/", ""); master.Location = model.Location; master.Duration = model.Duration; master.Date = model.Date; master.Price = model.Price; DataSet ds = master.coursemaster(master); TempData["message"] = ds.Tables[0].Rows[0][0].ToString(); } return RedirectToAction("Index", "Coursemaster"); }
// // GET: /Home/ public ActionResult Index() { DataSet ds = null; Coursemaster course = new Coursemaster(); course.Action = "Select"; ds = course.coursemaster(course); ViewData["AllcouData"] = ds.Tables[0]; return View("~/Views/Home/Home.cshtml"); }