示例#1
0
        public static void ResetPassword(int ID, string Password)
        {
            MsUser user = db.MsUsers.Single(x => x.ID == ID);

            user.Password = Password;
            db.SaveChanges();
        }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LoginSession"] == null)
     {
         Response.Redirect("../HomeView/Home.aspx");
     }
     else
     {
         String ID   = Session["LoginSession"].ToString();
         MsUser user = HomeController.FetchDataForHome(ID);
         if (user.RoleID != "RL1")
         {
             Response.Redirect("../HomeView/Home.aspx");
         }
         else
         {
             if (Request.QueryString["id"] == null)
             {
                 Response.Redirect("../HomeView/Home.aspx");
             }
             else
             {
                 if (!IsPostBack)
                 {
                     String        PaymentTypeID = Request.QueryString["id"];
                     MsPaymentType payment       = UpdatePaymentTypeController.GetPaymentType(PaymentTypeID);
                     BoxPaymentTypeName.Text = payment.PaymentTypeName;
                 }
             }
         }
     }
 }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BtnInsertProduct.Visible     = false;
            GridView1.Columns[7].Visible = false;
            GridView1.Columns[6].Visible = false;
            GridView1.Columns[5].Visible = false;
            GridView1.DataSource         = ViewProductController.FetchDataProduct();
            GridView1.DataBind();

            if (Session["LoginSession"] != null)
            {
                String ID   = Session["LoginSession"].ToString();
                MsUser user = HomeController.FetchDataForHome(ID);
                if (user.RoleID == "RL1")
                {
                    GridView1.Columns[6].Visible = true;
                    GridView1.Columns[5].Visible = true;
                    BtnInsertProduct.Visible     = true;
                    GridView1.DataSource         = ViewProductController.FetchDataProductForAdmin();
                    GridView1.DataBind();
                }
                else if (user.RoleID == "RL2")
                {
                    GridView1.Columns[7].Visible = true;
                }
            }
        }
示例#4
0
        protected void BtnToggle_Click(object sender, EventArgs e)
        {
            String ID       = IDChangeRole.Text.ToString();
            MsUser UserTemp = Repository.RepositoryMsUser.SearchUserByID(ID);

            if (UserTemp == null)
            {
                ValidatorUserID.Text = "User ID not found";
            }
            else if (UserTemp.UserID == Session["LoginSession"].ToString())
            {
                ValidatorUserID.Text = "Administrator that is logged in cannot change role and status";
            }
            else
            {
                if (UserTemp.UserStatus == "Active")
                {
                    Repository.RepositoryMsUser.UpdateStatus(ID, "Blocked");
                    Response.Redirect("ViewUser.aspx");
                }
                if (UserTemp.UserStatus == "Blocked")
                {
                    Repository.RepositoryMsUser.UpdateStatus(ID, "Active");
                    Response.Redirect("ViewUser.aspx");
                }
            }
        }
示例#5
0
        public static void UpdateStatus(String ID, String Status)
        {
            MsUser User = GetUserByID(ID);

            User.UserStatus = Status;
            db.SaveChanges();
        }
示例#6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LoginSession"] == null)
     {
         Response.Redirect("../HomeView/Home.aspx");
     }
     else
     {
         String ID   = Session["LoginSession"].ToString();
         MsUser user = HomeController.FetchDataForHome(ID);
         if (user.RoleID != "RL1")
         {
             Response.Redirect("../HomeView/Home.aspx");
         }
         else
         {
             if (Request.QueryString["id"] == null)
             {
                 Response.Redirect("../HomeView/Home.aspx");
             }
             else
             {
                 if (!IsPostBack)
                 {
                     String    ProductID = Request.QueryString["id"];
                     MsProduct product   = UpdateProductController.GetProductByID(ProductID);
                     BoxProductName.Text  = product.ProductName.ToString();
                     BoxProductPrice.Text = product.ProductPrice.ToString();
                     BoxProductStock.Text = product.ProductStock.ToString();
                 }
             }
         }
     }
 }
示例#7
0
        protected void BtnSubmitUpdateRole_Click(object sender, EventArgs e)
        {
            String ID       = IDChangeRole.Text.ToString();
            String RoleBaru = IDNewRole.Text.ToString();
            MsUser UserTemp = Repository.RepositoryMsUser.SearchUserByID(ID);

            if (UserTemp == null)
            {
                ValidatorUserID.Text = "User ID not found";
            }
            else if (UserTemp.UserID == Session["LoginSession"].ToString())
            {
                ValidatorUserID.Text = "Administrator that is logged in cannot change role and status";
            }
            else
            {
                if (RoleBaru == "Admin")
                {
                    String RoleID = "RL001";
                    Repository.RepositoryMsUser.UpdateRole(ID, RoleID);
                    Response.Redirect("ViewUser.aspx");
                }
                else if (RoleBaru == "Member")
                {
                    String RoleID = "RL003";
                    Repository.RepositoryMsUser.UpdateRole(ID, RoleID);
                    Response.Redirect("ViewUser.aspx");
                }
                else
                {
                    ValidatorUserID.Text = "Role not found";
                }
            }
        }
        protected override void Seed(DatabaseContext context)
        {
            Hakkimizda about = new Hakkimizda()
            {
                Id       = Guid.NewGuid().ToString(),
                Aciklama = "Lorem Ipsum",
                ImageUrl = "aaa"
            };
            KiralamaKosullari kk = new KiralamaKosullari()
            {
                Id = Guid.NewGuid().ToString(), Aciklama = "Lorem Ipsum"
            };
            İletisim iletisim = new İletisim()
            {
                Id = Guid.NewGuid().ToString(), Telefon1 = "Lorem Ipsum", Telefon2 = "Lorem Ipsum", Email1 = "Lorem Ipsum", Email2 = "Lorem Ipsum", Adres = "Adres"
            };
            MsUser admin = new MsUser()
            {
                Id = Guid.NewGuid().ToString(), Username = "******", Password = "******", Name = "Ad", Surname = "Soyad", Email = "*****@*****.**"
            };

            context.MsUser.Add(admin);
            context.Hakkimizda.Add(about);
            context.KiralamaKosullari.Add(kk);
            context.Iletisim.Add(iletisim);

            context.SaveChanges();
        }
示例#9
0
        public static void UpdateStatus(String ID, String Status)
        {
            MsUser User = SearchUserByID(ID);

            User.UserStatus = Status;
            TokobeEntities.SaveChanges();
        }
示例#10
0
        public static void UpdateRole(String ID, String Role)
        {
            MsUser User = SearchUserByID(ID);

            User.RoleID = Role;
            TokobeEntities.SaveChanges();
        }
示例#11
0
        public static void UpdateRole(String ID, String Role)
        {
            MsUser User = GetUserByID(ID);

            User.RoleID = Role;
            db.SaveChanges();
        }
示例#12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LoginSession"] == null)
     {
         Response.Redirect("../HomeView/Home.aspx");
     }
     else if (Request.QueryString["id"] == null)
     {
         Response.Redirect("../HomeView/Home.aspx");
     }
     else
     {
         String ID   = Session["LoginSession"].ToString();
         MsUser user = HomeController.FetchDataForHome(ID);
         if (user.RoleID != "RL2")
         {
             Response.Redirect("../HomeView/Home.aspx");
         }
         else
         {
             String        ProductID = Request.QueryString["id"];
             MsProduct     product   = AddToCartController.FetchDataByID(ProductID);
             MsProductType type      = AddToCartController.GetProductType(product.ProductTypeID);
             LabelProductName.Text  = product.ProductName.ToString();
             LabelProductStock.Text = product.ProductStock.ToString();
             LabelProductPrice.Text = product.ProductPrice.ToString();
             LabelProductType.Text  = type.ProductTypeName.ToString();
         }
     }
 }
示例#13
0
        public void GetSingleQueryUpdate(MsUser item, ref List <SqlCommand> ArraySQLCmd)
        {
            MsUser itm = item;

            //DALInfo.AssignedInfo(ref itm);
            UpdateQuery(itm, ArraySQLCmd);
        }
示例#14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LoginSession"] == null)
     {
         Response.Redirect("../HomeView/Home.aspx");
     }
     else
     {
         String ID   = Session["LoginSession"].ToString();
         MsUser user = HomeController.FetchDataForHome(ID);
         if (user.RoleID != "RL1")
         {
             Response.Redirect("../HomeView/Home.aspx");
         }
         else
         {
             if (Request.QueryString["id"] == null)
             {
                 Response.Redirect("../HomeView/Home.aspx");
             }
             else
             {
                 if (!IsPostBack)
                 {
                     String        ProductTypeID = Request.QueryString["id"];
                     MsProductType type          = UpdateProductTypeController.SearchProductType(ProductTypeID);
                     BoxTypeName.Text    = type.ProductTypeName.ToString();
                     BoxDescription.Text = type.ProductTypeDescription.ToString();
                 }
             }
         }
     }
 }
示例#15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LoginSession"] == null)
     {
         Response.Redirect("../HomeView/Home.aspx");
     }
     else
     {
         String ID   = Session["LoginSession"].ToString();
         MsUser user = HomeController.FetchDataForHome(ID);
         if (user.RoleID != "RL2")
         {
             Response.Redirect("../HomeView/Home.aspx");
         }
         else
         {
             if (!IsPostBack)
             {
                 String     ProductID = Request.QueryString["id"];
                 DetailCart cart      = UpdateCartController.GetCart(ID, ProductID);
                 LabelProductName.Text  = cart.ProductName.ToString();
                 LabelProductPrice.Text = cart.ProductPrice.ToString();
                 BoxQuantity.Text       = cart.ProductQuantity.ToString();
             }
         }
     }
 }
示例#16
0
        public static void UpdatePass(String ID, String Pass)
        {
            MsUser User = SearchUserByID(ID);

            User.UserPassword = Pass;
            TokobeEntities.SaveChanges();
        }
示例#17
0
        public List <MsUser> MoveDataToCollectionDomain(DataTable dataTable)
        {
            List <MsUser> msUserList = new List <MsUser>();

            for (int i = 0; i <= dataTable.Rows.Count - 1; i++)
            {
                MsUser objMsUser = new MsUser();
                objMsUser.UserID     = dataTable.Rows[i]["userid"].ToString();
                objMsUser.UserRoleID = dataTable.Rows[i]["userroleid"].ToString();
                objMsUser.Pwd        = dataTable.Rows[i]["pwd"].ToString().Trim();
                objMsUser.UserGuid   = dataTable.Rows[i]["userguid"].ToString().Trim();
                objMsUser.FullName   = dataTable.Rows[i]["fullname"].ToString();
                objMsUser.Email      = dataTable.Rows[i]["email"].ToString();
                objMsUser.Info1      = dataTable.Rows[i]["info1"].ToString();
                objMsUser.Info2      = dataTable.Rows[i]["info2"].ToString();
                objMsUser.Info3      = dataTable.Rows[i]["info3"].ToString();
                objMsUser.CrtUsrID   = dataTable.Rows[i]["crtusrid"].ToString();
                objMsUser.TsCrt      = Mapper <DateTime>(dataTable.Rows[i]["tscrt"]);
                objMsUser.ModUsrID   = dataTable.Rows[i]["modusrid"].ToString();
                objMsUser.TsMod      = Mapper <DateTime?>(dataTable.Rows[i]["tsmod"]);
                objMsUser.ActiveFlag = dataTable.Rows[i]["activeflag"].ToString();
                objMsUser.RowState   = DataRowState.Unchanged;

                msUserList.Add(objMsUser);
            }
            return(msUserList);
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BtnDeleteProduct.Visible = false;
            BtnInsertProduct.Visible = false;
            BtnUpdateProduct.Visible = false;
            LabelDelete.Visible      = false;
            LabelBox.Visible         = false;
            BoxID.Visible            = false;
            BtnSubmit.Visible        = false;
            FetchFromDB();
            TokobediaEntities2 db = new TokobediaEntities2();

            if (Session["LoginSession"] != null)
            {
                String Temp      = Session["LoginSession"].ToString();
                MsUser UserTemp2 = Repository.RepositoryMsUser.SearchUserByID(Temp);
                if (Repository.RepositoryMsUser.IsAdmin(Temp) == true)
                {
                    BtnDeleteProduct.Visible = true;
                    BtnInsertProduct.Visible = true;
                    BtnUpdateProduct.Visible = true;
                    LabelDelete.Visible      = true;
                }
            }
        }
示例#19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LoginSession"] == null)
     {
         Response.Redirect("../HomeView/Home.aspx");
     }
     else
     {
         BtnReport.Visible = false;
         String ID   = Session["LoginSession"].ToString();
         MsUser user = HomeController.FetchDataForHome(ID);
         if (user.RoleID == "RL1")
         {
             GridView1.DataSource = HistoryTransactionController.GetAllHistory();
             GridView1.DataBind();
             BtnReport.Visible = true;
         }
         else if (user.RoleID == "RL2")
         {
             GridView1.DataSource = HistoryTransactionController.GetUserHistory(ID);
             GridView1.DataBind();
         }
         else
         {
             Response.Redirect("../HomeView/Home.aspx");
         }
     }
 }
示例#20
0
        public static void UpdatePassword(String ID, String Pass)
        {
            MsUser User = GetUserByID(ID);

            User.UserPassword = Pass;
            db.SaveChanges();
        }
示例#21
0
 /**
  *
  * @param userInfo {MsRegistRsp//}
  */
 private void registerUserResponseInner(MsUser userInfo)
 {
     Debug.Log("registerUserResponseInner");
     Debug.Log(userInfo);
     GameNetWork.UserID = userInfo.userid;
     GameNetWork.Token  = userInfo.token;
     engine.login(userInfo.userid, userInfo.token);
 }
示例#22
0
        public static void updatePassword(int id, string pass)
        {
            List <MsUser> data       = UserRepository.getUserData();
            MsUser        updateUser = data.Where(y => y.UserId == id).SingleOrDefault();

            updateUser.UserPassword = pass;
            DBSingleton.getDB().SaveChanges();
        }
示例#23
0
        public static void updateUserToAdmin(int id)
        {
            List <MsUser> data       = UserRepository.getUserData();
            MsUser        updateUser = data.Where(y => y.UserId == id).SingleOrDefault();

            updateUser.UserRole = "U002";
            DBSingleton.getDB().SaveChanges();
        }
 /**
  *
  * @param userInfo {MsRegistRsp//}
  */
 private void registerUserResponseInner(MsUser userInfo)
 {
     Debug.Log("registerUserResponseInner");
     Debug.Log(userInfo);
     PlayerFrame.gUserID = userInfo.userid;
     PlayerFrame.Token   = userInfo.token;
     engine.login(userInfo.userid, userInfo.token);
 }
示例#25
0
        public static void UpdateUser(int ID, int Roles, string Status)
        {
            MsUser user = db.MsUsers.Single(x => x.ID == ID);

            user.RoleID = Roles;
            user.Status = Status;
            db.SaveChanges();
        }
示例#26
0
        public static void UpdateData(String ID, String Nama, String Email, String Gender)
        {
            MsUser User = SearchUserByID(ID);

            User.UserName   = Nama;
            User.UserEmail  = Email;
            User.UserGender = Gender;
            TokobeEntities.SaveChanges();
        }
示例#27
0
        public static void UpdateData(String ID, String Nama, String Email, String Gender)
        {
            MsUser User = GetUserByID(ID);

            User.UserName   = Nama;
            User.UserEmail  = Email;
            User.UserGender = Gender;
            db.SaveChanges();
        }
示例#28
0
        public static void UpdateUserProfile(int ID, string Email, string Name, string Gender)
        {
            MsUser user = db.MsUsers.Single(x => x.ID == ID);

            user.Email  = Email;
            user.Name   = Name;
            user.Gender = Gender;
            db.SaveChanges();
        }
示例#29
0
 public void GetBatchQueryUpdate(List <MsUser> objDomain, ref List <SqlCommand> ArraySQLCmd)
 {
     foreach (MsUser item in objDomain)
     {
         MsUser itm = item;
         DALInfo.AssignedInfo(ref itm);
         UpdateQuery(itm, ArraySQLCmd);
     }
 }
示例#30
0
 public static bool register(string userName, string email, string password, string confirmPass, string gender, string phone, DateTime birthDate, string address, string profilePicture)
 {
     if (userName != "" && checkEmail(email) && checkPassword(password, confirmPass) && checkPhone(phone) && checkAge(birthDate) && checkAddress(address))
     {
         MsUser newUser = UserFactory.createUser(userName, email, password, gender, birthDate, phone, address, profilePicture, "U001");
         UserRepository.insertUser(newUser);
         return(true);
     }
     return(false);
 }