public ActionResult Index(OnlineCourseMaster model, string submit)
 {
     if (submit == "Submit" || submit == null)
     {
         master.Action = "Insert";
         master.Name = model.Name;
         master.Slug_Name = model.Name.Replace("®", "").Replace("&", "").Replace(" ", "").ToLower() + model.C_Price + DateTime.Now.ToShortDateString().Replace("/", "");
         master.Details = model.Details;
         master.C_Price = model.C_Price;
         DataSet ds = master.OnlineCourseMasters(master);
         TempData["message"] = ds.Tables[0].Rows[0][0].ToString();
     }
     else
     {
         master.Action = "Update";
         master.Id = model.Id;
         master.Name = model.Name;
         master.Slug_Name = model.Name.Replace("®", "").Replace("&", "").Replace(" ", "").ToLower() + model.C_Price + DateTime.Now.ToShortDateString().Replace("/", "");
         master.Details = model.Details;
         master.C_Price = model.C_Price;
         DataSet ds = master.OnlineCourseMasters(master);
         TempData["message"] = ds.Tables[0].Rows[0][0].ToString();
     }
     return RedirectToAction("Index", "OnlineCoursemaster");
 }
 public void coursedata()
 {
     DataSet ds = null;
     OnlineCourseMaster course = new OnlineCourseMaster();
     course.Action = "Select";
     ds = course.OnlineCourseMasters(course);
     ViewData["AllcouData"] = ds.Tables[0];
 }
示例#3
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");
        }
示例#4
0
        public DataSet OnlineCourseMasters(OnlineCourseMaster obj)
        {
            DataSet ds = null;
            try
            {
                #region Parameters
                string[,] str = new string[7, 2];
                str[0, 0] = "@Action";
                str[0, 1] = obj.Action;

                str[1, 0] = "@id";
                str[1, 1] = obj.Id.ToString();

                str[2, 0] = "@Name";
                if (obj.Name == null)
                {
                    str[2, 1] = "";
                }
                else
                {
                    str[2, 1] = obj.Name;
                }

                str[3, 0] = "@Details";
                if (obj.Details == null)
                {
                    str[3, 1] = "";
                }
                else
                {
                    str[3, 1] = obj.Details;
                }
                str[4, 0] = "@C_Price";
                if (obj.C_Price == null)
                {
                    str[4, 1] = "";
                }
                else
                {
                    str[4, 1] = obj.C_Price;
                }
                str[5, 0] = "@Active";
                str[5, 1] = obj.Active.ToString();

                str[6, 0] = "@slugName";
                if (obj.Slug_Name == null)
                {
                    str[6, 1] = "";
                }
                else
                {
                    str[6, 1] = obj.Slug_Name;
                }
                #endregion
                Database db = new Database();
                ds = db.StoreprocedureExecuteDsReturned("[SP_HSRS_Onlinecourse_Masters]", str);
                return ds;
            }
            catch (Exception)
            {

                throw;
            }
        }