Esempio n. 1
0
 public ActionResult PostQuestion(MultiModel obj)
 {
     if (Session["id"] != null)
     {
         List <LangTable> list = db.LangTables.ToList();
         ViewBag.langList = new SelectList(list, "LangId", "LangName");
         QuestionTable tableModel = new QuestionTable();
         tableModel.UserId = (int)Session["id"];
         if (obj.QuestionModel.LangId != null)
         {
             tableModel.LangId = (int)obj.QuestionModel.LangId;
         }
         tableModel.QuestionTitle = obj.QuestionModel.QuestionTitle;
         tableModel.QuestionDesc  = obj.QuestionModel.QuestionDesc;
         db.QuestionTables.Add(tableModel);
         db.SaveChanges();
         ModelState.Clear();
         Response.Write("<script>alert('Your question has been successfully posted')</script>");
     }
     else
     {
         Response.Write("<script>alert('You must log in to post question')</script>");
         return(RedirectToAction("Index"));
     }
     return(View(obj));
 }
Esempio n. 2
0
        public ActionResult ProfilDuzenle(FormCollection form)
        {
            notDBEntities2 db       = new notDBEntities2();
            MultiModel     mm       = new MultiModel();
            int            sID      = Convert.ToInt32(Session["UID"]);//kullanıcı ID
            var            userInfo = db.user.Where(d => d.Id == sID).FirstOrDefault();

            if (userInfo.user_pw == form["sifreNow"])
            {
                userInfo.user_pw         = form["sifre"];
                userInfo.user_universite = form["universite"];
                userInfo.user_bolum      = form["bolum"];
                userInfo.user_adsoyad    = form["adsoyad"];
                db.Entry(userInfo).State = EntityState.Modified;
                db.SaveChanges();
                ViewBag.Message = "Bilgileriniz Güncellendi";
            }
            else
            {
                ViewBag.Message = "Doldurduğunuz alanları kontrol ediniz.";
            }
            mm.User       = db.user.Where(x => x.Id == sID).FirstOrDefault();
            mm.Universite = db.universite;
            mm.Bolumler   = db.bolumler;
            return(View(mm));
        }
Esempio n. 3
0
        public ActionResult NotGoster()
        {
            string         id    = Request.QueryString["ID"];
            int            urlID = Convert.ToInt32(id);             //albumID
            int            sID   = Convert.ToInt32(Session["UID"]); //kullanıcı ID
            notDBEntities2 db    = new notDBEntities2();
            MultiModel     mm    = new MultiModel();
            //goruntulenme artış
            var kontrol = db.notAlbum.Where(d => d.albumID == urlID).Select(x => new
            {
                yukleyenU = x.yukleyenID
            }).FirstOrDefault();

            if (kontrol.yukleyenU.ToString() != sID.ToString())
            {
                var viewArtis = db.notAlbum.Where(d => d.albumID == urlID).FirstOrDefault();
                viewArtis.goruntulenme++;
                db.Entry(viewArtis).State = EntityState.Modified;
                db.SaveChanges();
            }
            //görüntülenme artış - bitiş
            mm.NotAlbum = db.notAlbum.Where(d => d.albumID == urlID).ToList();
            mm.NotResim = db.notResim.Where(d => d.albumID == urlID).ToList();
            return(View(mm));
        }
Esempio n. 4
0
        public ActionResult List()
        {
            var responseResult = PostStandardWithSameControllerAction <List <ArticleCategory> >(this);
            var viewModel      = new MultiModel <List <ArticleCategory> >(responseResult.IsSuccess, responseResult.PageIndex, responseResult.PageSize, (int)responseResult.TotalNums, responseResult.Entity);

            return(View(viewModel));
        }
        public async Task <IActionResult> Login(MultiModel multimodel)
        {
            ViewBag.Category = _context.Categories.Where(x => x.Name != "HomePage").OrderBy(x => x.Name).ToList();
            if (ModelState.IsValid)
            {
                ApplicationUser appUser = await userManager.FindByEmailAsync(multimodel.login.Email);

                if (appUser != null)
                {
                    await signInManager.SignOutAsync();

                    Microsoft.AspNetCore.Identity.SignInResult result = await signInManager.PasswordSignInAsync(appUser, multimodel.login.Password, false, false);

                    if (result.Succeeded)
                    {
                        if (User.IsInRole("Administrator") || User.IsInRole("Editor"))
                        {
                            return(RedirectToAction("Dashboard", "Admin"));
                        }
                        else
                        {
                            return(RedirectToAction("Index", "Home"));
                        }
                    }
                }

                ModelState.AddModelError(nameof(multimodel.login.Email), "Login Failed: Invalid Email or password");
            }
            return(View(multimodel.login));
        }
Esempio n. 6
0
        public IActionResult Index()
        {
            MultiModel multiModel = new MultiModel();

            multiModel.userData    = getUsersData();
            multiModel.usersImages = getUsersImages();
            return(View(multiModel));
        }
Esempio n. 7
0
 public ActionResult Index(MultiModel obj)
 {
     if (ModelState.IsValid == true)
     {
         db.procRegister(obj.UserModel.Name, obj.UserModel.Email, obj.UserModel.Password,
                         DateTime.Now.ToString("yyyy-MM-dd"));
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult GetAllChildren(FormCollection form)
        {
            SalesForcVIewModel obj          = new SalesForcVIewModel();
            List <string>      selectedList = new List <string>();

            obj.StateModel = new List <Parent>();
            obj.StateModel = GetAllParrent();
            int level = 3;
            ///
            var value = Request.Form["SalesForce.StateModel"] ?? Request.Form["StateModel"];

            selectedList.Add(form["dd1"]);
            selectedList.Add(form["dd2"]);
            selectedList.Add(form["dd3"]);
            if (!string.IsNullOrEmpty(value))
            {
                level = 2;
            }
            var value1 = Request.Form["ddlcity"];

            if (!string.IsNullOrEmpty(Request.Form["dd2"]))
            {
                level = 3;
            }
            string strDDLValue = value.ToString();
            //strDDLValue = "MB-RSM-BTB";

            var lstEmp = db.sp_GetAllChildrenForParent(strDDLValue, level).Select(i => new MT_SellOut
            {
                Day             = i.Day,
                SalesOrg        = i.SalesOrg,
                CustomerCode    = i.CustomerCode,
                SalesRouteCode  = i.SalesRouteCode,
                ID              = i.ID,
                Name            = i.Name,
                Store           = i.Store,
                Target          = i.Target,
                Perform         = i.Perform,
                Rate            = i.Rate,
                LineID          = i.LineID,
                SalesForceLevel = i.SalesForceLevel,
                ParentCode      = i.ParentCode,
                SalesForceCode  = i.SalesForceCode
            }
                                                                                  ).OrderBy(x => x.LineID)
                         .ToList();;
            DataTable  Dt    = ExcelPackageExtensions.ToDataTable(lstEmp);
            MultiModel model = new MultiModel
            {
                Dt           = Dt,
                SalesForce   = obj,
                SelectedList = selectedList
            };

            return(View(model));
        }
Esempio n. 9
0
        public ActionResult HizliAra()
        {
            notDBEntities2 db     = new notDBEntities2();
            string         kelime = Request.QueryString["kelime"];
            MultiModel     mm     = new MultiModel();

            mm.NotAlbum = db.notAlbum.Where(d => d.albumDersAdi.Contains(kelime) || d.albumHoca.Contains(kelime)).ToList();
            mm.NotResim = db.notResim;
            return(View(mm));
        }
Esempio n. 10
0
        public ActionResult Index()
        {
            MultiModel     mm = new MultiModel();
            notDBEntities2 db = new notDBEntities2();

            mm.NotAlbum = db.notAlbum.Take(8).OrderByDescending(d => d.yuklemeTarih).ToList();
            mm.NotResim = db.notResim.ToList();

            return(View(mm));
        }
Esempio n. 11
0
        public ActionResult Notlarim()
        {
            notDBEntities2 db  = new notDBEntities2();
            MultiModel     mm  = new MultiModel();
            int            UID = Convert.ToInt32(Session["UID"]);

            mm.NotAlbum = db.notAlbum.Where(d => d.yukleyenID == UID).OrderByDescending(d => d.yuklemeTarih).ToList();
            mm.NotResim = db.notResim.ToList();
            return(View(mm));
        }
Esempio n. 12
0
        public ActionResult BaskaNotlar()
        {
            MultiModel     mm = new MultiModel();
            notDBEntities2 db = new notDBEntities2();

            mm.Bolumler   = db.bolumler;
            mm.Universite = db.universite;
            mm.NotAlbum   = db.notAlbum.Take(3).OrderBy(x => x.yuklemeTarih);
            mm.NotResim   = db.notResim;
            return(View(mm));
        }
Esempio n. 13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Controller"/> class.
        /// </summary>
        public Controller(IClientNotifier notifier)
        {
            this.model    = new MultiModel(this);
            this.notifier = notifier;

            //initialize the dictionary
            this.commandSet = new Dictionary <string, ICommand>();
            this.commandSet.Add("start", new StartCommand(model));
            this.commandSet.Add("list", new ListCommand(model));
            this.commandSet.Add("join", new JoinCommand(model));
            this.commandSet.Add("play", new PlayCommand(model));
            this.commandSet.Add("close", new CloseCommand(model));
        }
Esempio n. 14
0
        public IActionResult Index()
        {
            var model = new MultiModel();

            model.LastBook        = (from b in _context.Books orderby b.BookID descending select b).Take(6).ToList();
            model.MoreViewerBook  = (from b in _context.Books orderby b descending select b).Take(6).ToList();
            model.ScientificBooks = (from b in _context.Books where b.BookGroupID == 7 orderby b descending select b)
                                    .Take(6).ToList();

            model.Users = (from u in _userManager.Users orderby u.Id descending select u).Take(10).ToList();


            ViewBag.imagePath = "/upload/normalImage/";
            return(View(model));
        }
Esempio n. 15
0
        public ActionResult BaskaNotlar(FormCollection formData)
        {
            MultiModel     mm          = new MultiModel();
            notDBEntities2 db          = new notDBEntities2();
            string         aUniversite = formData["universite"];
            string         aBolum      = formData["bolum"];
            string         aHoca       = formData["dersHoca"];
            string         aDers       = formData["dersAd"];

            mm.NotAlbum = db.notAlbum.Where(d => (d.yukleyenBolum.Contains(aBolum) && d.yukleyenUni.Contains(aUniversite)) ||
                                            (d.albumDersAdi.Contains(aDers) || d.albumHoca.Contains(aHoca))).ToList();
            mm.NotResim   = db.notResim;
            mm.Universite = db.universite;
            mm.Bolumler   = db.bolumler;
            return(View(mm));
        }
Esempio n. 16
0
        public ActionResult LayoutBilgi()
        {
            MultiModel     mm = new MultiModel();
            notDBEntities2 db = new notDBEntities2();
            //görüntülenme ve indirme sayıları
            int id     = Convert.ToInt32(Session["UID"]);
            var viewCo = 0;

            viewCo = Convert.ToInt32(db.notAlbum.Where(d => d.yukleyenID == id).Sum(d => d.goruntulenme));
            var eklenenNotlar = db.user.Where(d => d.Id == id).Select(x => new
            {
                notS = x.eklenenNotSayisi
            }).FirstOrDefault();

            mm.addedNote = eklenenNotlar.notS.ToString();
            mm.ViewCount = viewCo.ToString();
            //görüntülenme indirme sayıları - bitiş
            return(PartialView(mm));
        }
Esempio n. 17
0
        public ActionResult Login(MultiModel obj)
        {
            UserRegisteration user =
                db.UserRegisterations.FirstOrDefault(
                    x => String.Compare(x.Email, obj.Login.Username, StringComparison.Ordinal) == 0);

            if (user != null)
            {
                if (String.Compare(user.Password, obj.Login.Password, StringComparison.Ordinal) == 0)
                {
                    Session["date"]  = user.RegisterDate;
                    Session["name"]  = user.Name;
                    Session["email"] = user.Email;
                    Session["id"]    = user.UserId;
                    System.Web.Security.FormsAuthentication.SetAuthCookie(obj.Login.Username, false);
                }
            }
            return(RedirectToAction("Index"));
        }
Esempio n. 18
0
        public ActionResult StateManage(SearchExpertListInput input)
        {
            CheckPermission(GetLoginInfo().User.Id, CurrentUrl);

            if (input.PageIndex == 0)
            {
                input.PageIndex = 1;
            }

            if (input.PageSize == 0)
            {
                input.PageSize = 10;
            }

            var parameters = ModelHelper.GetPropertyDictionary <SearchExpertListInput>(input);
            var result     = PostStandardWithSameControllerAction <List <SearchUserListWithStateOutput> >(this, parameters);
            var model      = new MultiModel <List <SearchUserListWithStateOutput> >(result.IsSuccess, input.PageIndex, input.PageSize, (int)result.TotalNums, result.Entity);

            return(View(model));
        }
Esempio n. 19
0
        public ActionResult FarmBookList(FarmBookListInput input)
        {
            CheckPermission(GetLoginInfo().User.Id, CurrentUrl);
            if (input.PageIndex == 0)
            {
                input.PageIndex = 1;
                input.PageSize  = 10;
            }

            var parameter = ModelHelper.GetPropertyDictionary <FarmBookListInput>(input);
            var result    = PostStandardWithSameControllerAction <FarmBookListOutput>(this, parameter);

            if (result.IsSuccess)
            {
                var model = new MultiModel <FarmBookListOutput>(result.IsSuccess, input.PageIndex, input.PageSize, (int)result.TotalNums, result.Entity);
                return(View(model));
            }

            return(View());
        }
Esempio n. 20
0
        public ActionResult ProfilDuzenle()
        {
            string         id       = Request.QueryString["ID"];
            int            urlID    = Convert.ToInt32(id);             //albumID
            int            sID      = Convert.ToInt32(Session["UID"]); //kullanıcı ID
            notDBEntities2 db       = new notDBEntities2();
            MultiModel     mm       = new MultiModel();
            var            userInfo = db.user.Where(d => d.Id == sID).FirstOrDefault();

            if (sID == urlID)
            {
                mm.User       = userInfo;
                mm.Universite = db.universite;
                mm.Bolumler   = db.bolumler;
                return(View(mm));
            }
            else
            {
                RedirectToAction("Index", "App");
            }
            ViewBag.Message = "";
            return(View());
        }
Esempio n. 21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CloseCommand"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public CloseCommand(MultiModel model) : base(model)
 {
 }
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlayCommand"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public PlayCommand(MultiModel model) : base(model)
 {
 }
Esempio n. 23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerCommand"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public ServerCommand(MultiModel model)
 {
     _model = model;
 }
Esempio n. 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JoinCommand" /> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public JoinCommand(MultiModel model) : base(model)
 {
 }
Esempio n. 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StartCommand"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public StartCommand(MultiModel model) : base(model)
 {
 }
Esempio n. 26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ListCommand" /> class.
 /// </summary>
 /// <param name="model">The model.</param>
 public ListCommand(MultiModel model) : base(model)
 {
 }