public void coursedata() { DataSet ds = null; Coursemaster course = new Coursemaster(); course.Action = "Selectcoursedata"; 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 DataSet coursemaster(Coursemaster obj) { DataSet ds =null; try { #region Parameters string[,] str = new string[10, 2]; str[0, 0] = "@Action"; str[0, 1] = obj.Action; str[1, 0] = "@C_Id"; str[1, 1] = obj.C_Id.ToString(); str[2, 0] = "@Trainingid"; str[2, 1] = obj.Trainingid.ToString(); str[3, 0] = "@Name"; if (obj.Name == null) { str[3, 1] = ""; } else { str[3, 1] = obj.Name; } str[4, 0] = "@Date"; if (obj.Date == null) { str[4, 1] = ""; } else { str[4, 1] = obj.Date; } str[5, 0] = "@Location"; if (obj.Location == null) { str[5, 1] = ""; } else { str[5, 1] = obj.Location; } str[6, 0] = "@Duration"; str[6, 1] = obj.Duration.ToString(); str[7, 0] = "@Price"; str[7, 1] = obj.Price.ToString(); str[8, 0] = "@Active"; str[8, 1] = obj.Active.ToString(); str[9, 0] = "@SlugName"; if (obj.SlugName == null) { str[9, 1] = ""; } else { str[9, 1] = obj.SlugName; } #endregion Database db = new Database(); ds = db.StoreprocedureExecuteDsReturned("[SP_HSRS_Course_Masters]", str); return ds; } catch (Exception) { throw; } }
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]; ViewData["Agile"] = ds.Tables[1]; ViewData["PMP"] = ds.Tables[2]; return View("~/Views/Home/Home.cshtml"); }