Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string submitKey = (Request.Form["submitKey"] ?? "").ToString();
            if (!string.IsNullOrEmpty(submitKey))
            {
                string allSubmitKeys = (Session["allSubmitKeys"] ?? "").ToString();
                if (!allSubmitKeys.Split(',').Contains(submitKey))
                {
                    Session["allSubmitKeys"] = allSubmitKeys + "," + submitKey;
                    CurrentUser user = new CurrentUser("TimeSheetAdmin");
                    TimeSheetBO.Users userRoleObj = new TimeSheetBO.Users(user);
                    Guid guidfield;
                    Guid.TryParse(Request.Form["guidfield"], out guidfield);
                    userRoleObj.LoadSingle(userRoleObj, " WHERE guidfield = @guidfield", "guidfield", guidfield);
                    userRoleObj.UserName = Request.Form["username"];
                    userRoleObj.FullName = Request.Form["fullname"];
                    userRoleObj.emailAddress = Request.Form["emailAddress"];
                    userRoleObj.Address1 = Request.Form["address1"];
                    userRoleObj.Address2 = Request.Form["address2"];
                    userRoleObj.City = Request.Form["city"];
                    userRoleObj.State = Request.Form["state"];
                    userRoleObj.Role = Request.Form["role"];

                    if (userRoleObj.Save())
                    {

                        ltrMessage.Text = "User saved successfully.";
                    }
                    else
                    {
                        ltrMessage.Text = "Unable to save User information.";
                    }
                }
            }
        }
Пример #2
0
 public void Load()
 {
     _Users = new Users();
     _Users.LoadSingle(_Users, " where UserName=@username", "UserName", this.userName);
 }