public ActionResult AddAOS(VirtualCampus.Models.AOSSubCatModel model)
        {
            VC_Areaofstudy n = new VC_Areaofstudy();
            n.Areaofstudy = model.Areaofstudy.ToString();
            n.Areaofstudy_Category_Id = model.Areaofstudy_Category_Id;

            n.Created_TS = DateTime.Now;
            n.Updated_TS = DateTime.Now;
            obj.AddToVC_Areaofstudy(n);
            obj.SaveChanges();

            return RedirectToAction("ViewAOSCategory");
        }
        public ActionResult AddNewUser(VirtualCampus.Models.AddNewUser model)
        {
            MailMessage msg = new MailMessage();
                string ActivationUrl ;
                string emailId = string.Empty;
                string privilage = string.Empty;

                msg = new MailMessage();
                SmtpClient smtp = new SmtpClient();

                emailId = model.EmailId.Trim();
                privilage = model.Privilage.ToString();
                Int32 workspace = Convert.ToInt32(model.Workspace);

                //sender email address
                msg.From = new MailAddress("*****@*****.**");

                //Receiver email address
                msg.To.Add(emailId);
                msg.Subject = "Confirmation email for account activation";
                //For testing replace the local host path with your lost host path and while making online replace with your website domain name
                // ActivationUrl = Server.HtmlEncode("http://*****:*****@ronak-buildwell.com", "escan123");
                //smtp.Port = 3535;
                //smtp.Host = "smtpout.secureserver.net";
                //smtp.EnableSsl = false;

                smtp.Credentials = new NetworkCredential("*****@*****.**", "9824396591");
                smtp.Port = 587;
                smtp.Host = "smtp.gmail.com";
                smtp.EnableSsl = true;
                smtp.Send(msg);
                JavaScript("alert('Your mail has been sent.');");

            Response.Write("Emamil was sent");

            return RedirectToAction("AddNewUser");
        }
        public ActionResult AddAOSCategory(VirtualCampus.Models.AOSCategoryModel model)
        {
            try
            {
                VC_Areaofstudy_Category a = new VC_Areaofstudy_Category();
                a.Category_Name = model.category_Name;
                a.Created_TS = DateTime.Now;
                a.Updated_TS = DateTime.Now;

                obj.AddToVC_Areaofstudy_Category(a);
                obj.SaveChanges();

            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewAOSCategory", "Manage");
        }
        public ActionResult EditNewsSubCat(int k, int j, VirtualCampus.Models.EditNewsSubCategoryModel model)
        {
            try
            {
                VC_News_Link n = obj.VC_News_Link.Where(m => m.News_Id == k).First();

                n.News_Link = model.NewsLink.ToString();
                n.News_Description_Name = model.News_Description_Name.ToString();
                obj.SaveChanges();
            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewNews", "Manage", new { k = j });
        }
        public ActionResult EditNewscategory(int k, VirtualCampus.Models.NewsCategoryModel model)
        {
            try
            {
                VC_News_Category n = obj.VC_News_Category.Where(m => m.NewsCategory_Id == k).First();

                n.CategoryName = model.CategoryName.ToString();
                obj.SaveChanges();
            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewNewsCategory", "Manage");
        }
        public ActionResult EditIntSubCat(int k, int j, VirtualCampus.Models.InterestSubCatModel model)
        {
            try
            {
                VC_Interest_Link n = obj.VC_Interest_Link.Where(m => m.Interest_Id == k).First();

                n.Interest_Link = model.Interest.ToString();
                n.Interest_Description_Name = model.Interest_Description_Name.ToString();
                obj.SaveChanges();
            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewInterest", "Manage", new { k = j });
        }
        public ActionResult EditAOSCategory(int k, VirtualCampus.Models.AOSCategoryModel model)
        {
            try
            {
                VC_Areaofstudy_Category a = obj.VC_Areaofstudy_Category.Where(m => m.Areaofstudy_Category_Id == k).First();
                a.Category_Name = model.category_Name.ToString();
                obj.SaveChanges();
            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewAOSCategory", "Manage");
        }
        public ActionResult SaveStudent(VirtualCampus.Models.StudentModel model)
        {
            VC_Student studentobj = new VC_Student();

            studentobj.User_Id = Convert.ToInt32(model.User_Id);
            studentobj.Student_Name = model.Student_Name.ToString();
            studentobj.Student_Department = model.Student_Department.ToString();
            studentobj.Student_College = model.Student_College.ToString();
            studentobj.Student_Gender = model.Student_Gender.ToString();
            studentobj.Student_EnrollYear = Convert.ToInt32(model.Student_EnrollYear);
            studentobj.Student_LibraryId = Convert.ToInt32(model.Student_LibraryId);
            studentobj.Student_EnrollmentNo = Convert.ToInt32(model.Student_EnrollmentNo);
            studentobj.Student_EmailId = model.Student_EmailId.ToString();
            studentobj.Student_ContactNo = Convert.ToInt32(model.Student_ContactNo);
            studentobj.Student_Birthdate = Convert.ToDateTime(model.Student_Birthdate);
            studentobj.Student_Hometown = model.Student_Hometown.ToString();
            studentobj.Student_Security_Que = model.Student_Security_Ques.ToString();
            studentobj.Student_Security_Ans = model.Student_Security_Ans.ToString();
            studentobj.Created_TS = DateTime.Now;
            studentobj.Updated_TS = DateTime.Now;

            dbobj.AddToVC_Student(studentobj);
            dbobj.SaveChanges();

            return RedirectToAction("index");
        }
 public object DeleteNewsSubCat(int k, VirtualCampus.Models.NewsSubCategoryModel model)
 {
     VC_News_Link n = obj.VC_News_Link.Where(m => m.News_Id == k).First();
     obj.DeleteObject(n);
     obj.SaveChanges();
     return RedirectToAction("ViewNewsCategory");
 }
Example #10
0
        public object DeleteNewsCategory(int k, VirtualCampus.Models.NewsCategoryModel model)
        {
            VC_News_Category n = obj.VC_News_Category.Where(m => m.NewsCategory_Id == k).First();
            //var q = (from m in obj.VC_News_Category where m.NewsCategory_Id == k select m);

            obj.DeleteObject(n);
            obj.SaveChanges();
            return RedirectToAction("ViewNewsCategory");
        }
Example #11
0
        public object DeleteInterestCategory(int id, VirtualCampus.Models.InterestCategoryModel model)
        {
            VC_Interest_Category n = obj.VC_Interest_Category.Where(m => m.InterestCategory_Id == id).First();
            //var q = (from m in obj.VC_News_Category where m.NewsCategory_Id == k select m);

            obj.DeleteObject(n);
            obj.SaveChanges();
            return RedirectToAction("ViewInterestCategory", "Manage");
        }
Example #12
0
        public ActionResult AddNewsSubCat(VirtualCampus.Models.NewsSubCategoryModel model)
        {
            VC_News_Link n = new VC_News_Link();
            n.News_Link = model.NewsLink.ToString();
            n.NewsCategory_Id = model.NewsCategory_Id;
            n.News_Description_Name = model.News_Description_Name.ToString();
            n.Created_TS = DateTime.Now;
            n.Updated_TS = DateTime.Now;
            obj.AddToVC_News_Link(n);
            obj.SaveChanges();
            //return View();

            /* list = new List<SelectListItem>();
             list.Add(new SelectListItem { Text = "-Please select-", Value = "Selects items" });
             var cat = (from m in obj.VC_News_Category select m).ToArray();
             for (int i = 0; i < cat.Length; i++)
             {
                 list.Add(new SelectListItem
                 {
                     Text = cat[i].CategoryName,
                     Value = cat[i].NewsCategory_Id.ToString(),
                     Selected = (cat[i].NewsCategory_Id == 0)
                 });
             }
             ViewData["cat"] = list; */
            //return View();

            return RedirectToAction("ViewNewsCategory");
        }
Example #13
0
        public ActionResult AddNews(VirtualCampus.Models.NewsCategoryModel model)
        {
            try
            {
                VC_News_Category n = new VC_News_Category();
                n.Created_TS = DateTime.Now;
                n.Updated_TS = DateTime.Now;
                n.CategoryName = model.CategoryName.ToString();
                obj.AddToVC_News_Category(n);
                obj.SaveChanges();
            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewNewsCategory", "Manage");
        }
Example #14
0
        public ActionResult AddIntSubCat(VirtualCampus.Models.InterestSubCatModel model)
        {
            VC_Interest_Link n = new VC_Interest_Link();
            n.Interest_Link = model.Interest.ToString();
            n.InterestCategory_Id = model.InterestCategory_Id;
            n.Interest_Description_Name = model.Interest_Description_Name.ToString();
            n.Created_TS = DateTime.Now;
            n.Updated_TS = DateTime.Now;
            obj.AddToVC_Interest_Link(n);
            obj.SaveChanges();

            return RedirectToAction("ViewInterestCategory");
        }
Example #15
0
        public ActionResult AddInterestCategory(VirtualCampus.Models.InterestCategoryModel model)
        {
            try
            {
                VC_Interest_Category interest = new VC_Interest_Category();
                interest.Category_Name = model.Category_Name;
                interest.Created_TS = DateTime.Now;
                interest.Updated_TS = DateTime.Now;
                obj.AddToVC_Interest_Category(interest);
                obj.SaveChanges();

            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewInterestCategory", "Manage");
        }
Example #16
0
        public ActionResult EditAOS(int k, int j, VirtualCampus.Models.AOSSubCatModel model)
        {
            try
            {
                VC_Areaofstudy n = obj.VC_Areaofstudy.Where(m => m.Areaofstudy_Id == k).First();

                n.Areaofstudy = model.Areaofstudy.ToString();

                obj.SaveChanges();
            }
            catch
            {
                return View();
            }

            return RedirectToAction("ViewAOS", "Manage", new { k = j });
        }
 public ActionResult AddApplication(string k,VirtualCampus.Models.Application model)
 {
     VC_Application app = new VC_Application();
     Int16 userid = Convert.ToInt16(HttpContext.Session["userid"]);
     var workspaceuser = (from m in dbobj.VC_WorkspaceUser where m.User_Id == userid select m).FirstOrDefault();
     var workspacedetails = (from m in dbobj.VC_Workspace where m.Workspace_Name == k select m).FirstOrDefault();
     app.Workspace_Id = workspacedetails.Workspace_Id;
     app.WorkspaceUser_Id = workspaceuser.WorkspaceUser_Id;
     app.Application_Name = model.Application_Name.ToString();
     app.TextLabel_1 = model.TextLabel_1.ToString();
     if (model.TextLabel_2 != null)
     {
         app.TextLabel_2 = model.TextLabel_2.ToString();
     }
     else {
         app.TextLabel_2 = "empty";
     }
     if (model.TextLabel_3 != null)
     {
         app.TextLabel_3 = model.TextLabel_3.ToString();
     }
     else
     {
         app.TextLabel_3 = "empty";
     }
     if (model.TextLabel_4 != null)
     {
         app.TextLabel_4 = model.TextLabel_4.ToString();
     }
     else
     {
         app.TextLabel_4 = "empty";
     }
     if (model.TextLabel_5 != null)
     {
         app.TextLabel_5 = model.TextLabel_5.ToString();
     }
     else
     {
         app.TextLabel_5 = "empty";
     }
     if (model.TextArea_1 != null)
     {
         app.TextArea_1 = model.TextArea_1.ToString();
     }
     else
     {
         app.TextArea_1 = "empty";
     }
     if (model.TextArea_2 != null)
     {
         app.TextArea_2 = model.TextArea_2.ToString();
     }
     else
     {
         app.TextArea_2 = "empty";
     }
     if (model.TextArea_3 != null)
     {
         app.TextArea_3 = model.TextArea_3.ToString();
     }
     else
     {
         app.TextArea_3 = "empty";
     }
     if (model.DateLabel_1 != null)
     {
         app.DateLabel_1 = model.DateLabel_1.ToString();
     }
     else {
         app.DateLabel_1 = "empty";
     }
     app.Created_TS = DateTime.Now;
     app.Updated_TS = DateTime.Now;
     dbobj.AddToVC_Application(app);
     dbobj.SaveChanges();
     return RedirectToAction("Index", "Workspace", new { k = k});
 }
Example #18
0
 public ActionResult SaveRegisterStaff(VirtualCampus.Models.StaffModel model)
 {
     VC_Staff staffobj = new VC_Staff();
     staffobj.User_Id = Convert.ToInt32(model.User_Id);
     staffobj.Staff_Name = model.Staff_Name.ToString();
     staffobj.Staff_Gender = model.Staff_Gender.ToString();
     staffobj.Staff_College = model.Staff_College.ToString();
     staffobj.Staff_Department = model.Staff_Department.ToString();
     staffobj.Staff_Designation = model.Staff_Designation.ToString();
     staffobj.Staff_LibraryId = Convert.ToInt32(model.Staff_LibraryId);
     staffobj.Staff_ContactNo = Convert.ToInt32(model.Staff_ContactNo);
     staffobj.Staff_EmailId = model.Staff_EmailId.ToString();
     staffobj.Staff_Birthdate = Convert.ToDateTime(model.Staff_BirthDate);
     staffobj.Staff_Security_Que = model.Staff_Security_Ques.ToString();
     staffobj.Staff_Security_Ans = model.Staff_Security_Ans.ToString();
     staffobj.Created_TS = DateTime.Now;
     staffobj.Updated_TS = DateTime.Now;
     dbobj.AddToVC_Staff(staffobj);
     dbobj.SaveChanges();
     return RedirectToAction("index");
 }