Пример #1
0
    private bool ValidateUserAvailability(string userId)
    {
        MembershipModule membershipModule = new MembershipModule();
        if (membershipModule.GetMembershipByUsername(userId) == null)
            return false;

        return true;
    }
Пример #2
0
    private bool CheckUserPassword(string userId,string password)
    {
        if (ValidateUserAvailability(userId))
        {
            MembershipModule membershipModule = new MembershipModule();
            InventorySystem.Business.Membership membership = new InventorySystem.Business.Membership();
            membership = membershipModule.GetMembershipByUsername(userId);

            if (membership.Username == userId && membership.Password == password)
                return true;

        }
        return false;
    }
    private void InsertMembership()
    {
        InventorySystem.Business.Membership membership = new InventorySystem.Business.Membership();
        InventorySystem.Business.MembershipModule membershipModule = new InventorySystem.Business.MembershipModule();
        if (ViewState["id"] != null)
            membership.Username = ViewState["id"].ToString();
        else
            membership.Username = null;

        membership.Username = txtMembershipUserid.Text;
        membership.Password = txtMembershipPassword.Text;
        membership.Authorization = Convert.ToInt32(ddlMembershipAuthorization.SelectedValue.ToString());
        membership.EmployeeId = ddlMembershipEmployeeName.SelectedValue.ToString();

        membershipModule.Save(membership);
    }