public ActionResult DeleteConfirmed(int id)
        {
            Role_Table role_Table = db.Role_Table.Find(id);

            db.Role_Table.Remove(role_Table);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "role_id,role_name")] Role_Table role_Table)
 {
     if (ModelState.IsValid)
     {
         db.Entry(role_Table).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(role_Table));
 }
Exemple #3
0
        protected NovelRoleBase CreateRole(int irole_Name)
        {
            var           scene = SceneManagerComponent.Instance.GetScene <GameScene>();
            NovelRoleBase nrb   = GameObjectUtility.CreateGameObject(Role_Table.GetRowById(irole_Name).assetid, scene.Go_Mainscene).GetComponent <NovelRoleBase>();

            if (!m_dict_roles.ContainsKey(irole_Name))
            {
                m_dict_roles.Add(irole_Name, nrb);
            }
            return(nrb);
        }
        public ActionResult Create([Bind(Include = "role_id,role_name")] Role_Table role_Table)
        {
            if (ModelState.IsValid)
            {
                db.Role_Table.Add(role_Table);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(role_Table));
        }
Exemple #5
0
 public ActionResult ManageRole(Role_Table role)                                           //new object of Role_Table are passed to post function ManageRole
 {
     role.RoleCreatedBy   = Session["user"].ToString();
     role.RoleUpdatedBy   = Session["user"].ToString();
     role.RoleCreatedDate = DateTime.Now;
     role.RoleUpdateDate  = DateTime.Now;
     role.RoleIsDeleted   = false;
     db.Role_Table.Add(role);                                                               //Adding values to Role_Table
     db.SaveChanges();
     return(RedirectToAction("ManageRole"));
 }
        // GET: Role_Table/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Role_Table role_Table = db.Role_Table.Find(id);

            if (role_Table == null)
            {
                return(HttpNotFound());
            }
            return(View(role_Table));
        }
Exemple #7
0
        public JsonResult RoleDelete(int RoleId)
        {
            ShoppingCartDbEntities db   = new ShoppingCartDbEntities();
            Role_Table             role = db.Role_Table.Find(RoleId);                             //Details of patricular role to be deleted is obtained using it's id

            role.RoleIsDeleted = true;



            db.SaveChanges();                                                                       //Db is updated
            bool result      = true;
            var  redirectUrl = new UrlHelper(Request.RequestContext).Action("ManageRole", "Admin"); //passing url to which control to be navigated is stored in a variable

            return(Json(new { result, Url = redirectUrl }, JsonRequestBehavior.AllowGet));
        }
Exemple #8
0
        public JsonResult RoleEdit(int RoleId, string RoleName, string RoleDescription)      //updated values are passed as parameters of post function through ajax method
        {
            ShoppingCartDbEntities db   = new ShoppingCartDbEntities();
            Role_Table             role = db.Role_Table.Find(RoleId);                         //Details of patricular role is obtained using it's id

            role.RoleName       = RoleName;                                                   /*Rest of values are updated*/
            role.RoleDesc       = RoleDescription;
            role.RoleUpdatedBy  = Session["user"].ToString();
            role.RoleIsDeleted  = false;
            role.RoleUpdateDate = DateTime.Now;
            db.SaveChanges();                                                                                                                        //Db is updated
            var redirectUrl = new UrlHelper(Request.RequestContext).Action("ManageRole", "Admin");                                                   //passing url to which control to be navigated is stored in a variable

            return(Json(new { RoleId = RoleId, RoleName = RoleName, RoleDesc = RoleDescription, Url = redirectUrl }, JsonRequestBehavior.AllowGet)); //Values updated and url is returned back to ajax success function
        }
        public ActionResult login(string user, string password)
        {
            User_Table obj = db.User_Table.Where(x => x.UserName == user).FirstOrDefault();

            if (obj != null)
            {
                Role_Table robj = db.Role_Table.Where(x => x.RoleId == obj.Roleid).FirstOrDefault();
                if (obj.Password == password)
                {
                    if (obj.UserIsDeleted == false)
                    {
                        if (robj.RoleName == "Super_Admin")
                        {
                            Session["user"] = obj.UserName;
                            return(RedirectToAction("Homepage", "Admin"));
                        }
                        else if (robj.RoleName == "Seller")
                        {
                            Session["user"] = obj.UserName;
                            return(RedirectToAction("Index", "Seller"));
                        }
                        else if (robj.RoleName == "Courier_Service")
                        {
                            Session["user"] = obj.UserName;
                            Session["name"] = obj.FirstName;
                            return(RedirectToAction("Service_Home", "Service"));
                        }
                        else if (robj.RoleName == "Buyer")
                        {
                            Session["user"] = obj.UserName;
                            Session["name"] = obj.FirstName;

                            string name    = obj.UserName;
                            int    id      = db.User_Table.Where(x => x.UserName == name).Select(x => x.UserId).FirstOrDefault();
                            var    oder_id = db.Order_Table.Where(x => x.Userid == id & x.OrderStatus == 0 & x.OrderIsDeleted == false).Select(x => x.OrderId).FirstOrDefault();
                            int    count   = db.OrderDetail_Table.Where(x => x.Orderid == oder_id).Count();
                            Session["count"] = count;
                            return(RedirectToAction("loader", "User"));
                        }
                        else
                        {
                            return(RedirectToAction("errror"));
                        }
                    }
                    else
                    {
                        TempData["message3"] = "Not an Autharized User";
                        return(RedirectToAction("login", "User"));
                    }
                }
                else
                {
                    TempData["message2"] = "Password Dont Match";
                    return(RedirectToAction("login", "User"));
                }
            }
            else
            {
                TempData["message1"] = "User Does Not Exist";
                return(RedirectToAction("login", "User"));
            }
            return(View());
        }
Exemple #10
0
        public override void OnEnter(ProcedureOwner procedureOwner)
        {
            foreach (GameFrameworkModule module in GameMainEntry.GameFrameworkModules)
            {
                DebugHandler.Log(module.GetType().Name + module.Priority);
            }

            ///////////////////加载所有模块
            /////////////////////////

            //////////////////////////////////////////////////////////////////////////
            var          tm        = TableManagerComponent.Instance.TableManager;
            Dialog_Table dialog_tb = new Dialog_Table();

            dialog_tb.Name    = typeof(Dialog_Table).Name;//"Dialog_Table";
            dialog_tb.AssetId = 2000;
            dialog_tb.IsLoad  = false;
            tm.AddTable(dialog_tb);

            ////////////////////////////////////////////////////////////////////////// 加载ui Table
            // var tm = TableManagerComponent.Instance.TableManager;
            UI_Table ui_tb = new UI_Table();

            ui_tb.Name    = typeof(UI_Table).Name;//"UI_Table";
            ui_tb.AssetId = 2001;
            ui_tb.IsLoad  = false;
            tm.AddTable(ui_tb);
            //////////////////////////////////////////////////////////////////////////

            Text_Table text_tb = new Text_Table();

            text_tb.Name    = typeof(Text_Table).Name;
            text_tb.AssetId = 2002;
            text_tb.IsLoad  = false;
            tm.AddTable(text_tb);


            Role_Expression_Table express_tb = new Role_Expression_Table();

            express_tb.Name    = typeof(Role_Expression_Table).Name;//"Dialog_Table";
            express_tb.AssetId = 2003;
            express_tb.IsLoad  = false;
            tm.AddTable(express_tb);


            Role_Table role_tb = new Role_Table();

            role_tb.Name    = typeof(Role_Table).Name;
            role_tb.AssetId = 2004;
            role_tb.IsLoad  = false;
            tm.AddTable(role_tb);

            Item_Pack_Table item_Pack_Table = new Item_Pack_Table();

            item_Pack_Table.Name    = typeof(Item_Pack_Table).Name;
            item_Pack_Table.AssetId = 2005;
            item_Pack_Table.IsLoad  = false;
            tm.AddTable(item_Pack_Table);

            CircleOfFriend_Table circleoffriend_Table = new CircleOfFriend_Table();

            circleoffriend_Table.Name    = typeof(CircleOfFriend_Table).Name;
            circleoffriend_Table.AssetId = 2006;
            circleoffriend_Table.IsLoad  = false;
            tm.AddTable(circleoffriend_Table);
            //////////////////////////////////////////////////////////////////////////
            //////////////////////////////////////////////////////////////////////////

            TableManagerComponent.Instance.LoadAllTable();

            var pd_mg       = GameMainEntry.GetModule <ProcedureManager>();
            var pd_MainMenu = new Procedure_MainMenu();

            pd_mg.ProcedureFsm.CreateFsmState(pd_MainMenu);
            ChangeState <Procedure_MainMenu>(procedureOwner);
            //////////////////////////////////////////////////////////////////////////
            var pd_game = new Procedure_Game();

            pd_mg.ProcedureFsm.CreateFsmState(pd_game);

            /*
             * var sq = DOTween.Sequence();
             * sq.PrependInterval(0.5f);
             * sq.AppendCallback(()
             *  =>
             * {
             *  DebugHandler.Log("finish Callback");
             *
             *  var pd_mg = GameMainEntry.GetModule<ProcedureManager>();
             *  var pd_MainMenu = new Procedure_MainMenu();
             *  pd_mg.ProcedureFsm.CreateFsmState(pd_MainMenu);
             *  ChangeState<Procedure_MainMenu>(procedureOwner);
             *  //////////////////////////////////////////////////////////////////////////
             *  var pd_game = new Procedure_Game();
             *  pd_mg.ProcedureFsm.CreateFsmState(pd_game);
             * });*/
        }