public LoginPage() { using (UserInformationRT _userInfoRT = new UserInformationRT()) { this._userInformationRT = _userInfoRT; } }
protected void btnDeactive_Click(object sender, EventArgs e) { try { using (AdGiverRT receiverTransfer = new AdGiverRT()) { string userEmailId = Convert.ToString(Session["UserName"]); AdGiver adgiverEmailId = receiverTransfer.GetAdGiverIDByEmail(userEmailId); if (adgiverEmailId != null) { using (UserInformationRT receiverTransferuserinfo = new UserInformationRT()) { UserInfo UserDeactive = CreateUserDeactive(); receiverTransferuserinfo.UpdateUserDeactive(userEmailId, UserDeactive.Comments, UserDeactive.LeavingCausesID, UserDeactive.IsActiveUser); Session["UserName"] = null; Response.Redirect("~/"); } } else { lblAccountdetails.Text = "Account is not Deactivated Yet"; lblAccountdetails.ForeColor = System.Drawing.Color.Red; } } } catch (Exception ex) { lblAccountdetails.Text = "Error : " + ex.Message; lblAccountdetails.ForeColor = System.Drawing.Color.Red; } }
public DefaultMaster() { this._categoryRT = new CategoryRT(); this._userInformationRT = new UserInformationRT(); this._visitorCounterRT = new VisitorCounterRT(); this._visitorCounter = new VisitorCounter(); }
protected void btnChngPass_Click(object sender, EventArgs e) { try { using (AdGiverRT receiverTransfer = new AdGiverRT()) { string userEmailId = Convert.ToString(Session["UserName"]); string password = txtCurrentPass.Text; AdGiver adgiverEmailId = receiverTransfer.GetAdGiverIDByEmail(userEmailId); string UserpassWord = StringCipher.Decrypt(receiverTransfer.GetPasswordIDByEmail(userEmailId).LoginPassword); if (adgiverEmailId != null && UserpassWord == password) { using (UserInformationRT receiverTransferuserinfo = new UserInformationRT()) { UserInfo UserInfoPassword = CreateUserInfoPassword(); receiverTransferuserinfo.UpdateUserInfoPassword(userEmailId, StringCipher.Encrypt(UserInfoPassword.LoginPassword)); lblAccountdetails.Text = "Password successfully updated..."; lblAccountdetails.ForeColor = System.Drawing.Color.Green; } } else { lblAccountdetails.Text = "Current Password is not Valid"; lblAccountdetails.ForeColor = System.Drawing.Color.Red; } } } catch (Exception ex) { lblAccountdetails.Text = "Error : " + ex.Message; lblAccountdetails.ForeColor = System.Drawing.Color.Red; } clearfield(); }
public ControlAdminMaster() { this._categoryRT = new CategoryRT(); this._userInformationRT = new UserInformationRT(); this._userWFPermission = new UserPermissionRT(); this._urlWFListRT = new UrlWFListRT(); }
protected void lvUserInfo_ItemCommand(object sender, ListViewCommandEventArgs e) { if (e.CommandName == "EditUserInfo") { labelMessage.Text = string.Empty; try { btnSave.Visible = false; btnUpdate.Visible = true; btnDelete.Visible = true; btnCancel.Visible = true; int userInfoID = Convert.ToInt32(e.CommandArgument); hdUserInfoID.Value = userInfoID.ToString(); using (UserInformationRT receiverTransfer = new UserInformationRT()) { UserInfo userInfo = receiverTransfer.GetUserInfoByID(userInfoID); FillUserInfoForEdit(userInfo); } } catch (Exception ex) { labelMessage.Text = "Error : " + ex.Message; labelMessage.ForeColor = System.Drawing.Color.Red; } } }
protected void btn_CreateAccount_Click(object sender, EventArgs e) { try { using (AdGiverRT adGiverRt = new AdGiverRT()) { UserInformationRT aUserInformationRt = new UserInformationRT(); UserInfo aUserInfo = new UserInfo(); AdGiver adGiver = new AdGiver(); adGiver = CreateAdGiver(); if (adGiver != null) { // const int userInGroup = 7; //for addgiver adGiverRt.AddAdGiver(adGiver); aUserInfo = CreateUserInfo(adGiver.IID); aUserInformationRt.AddUserInfo(aUserInfo); } else { if (txtPassword.Text == string.Empty || txtPassword.Text == "") { labelMessage.Text = "Please enter your password"; } else if (txtConfirmPassword.Text == "" || txtConfirmPassword.Text == string.Empty) { labelMessage.Text = "Please comfirm your password"; } else if (txtPassword.Text != txtConfirmPassword.Text) { labelMessage.Text = "password doesn't match"; } else if (txtPassword.Text.Length < 6) { labelMessage.Text = "password too short, enter at least 6 character"; } else { labelMessage.Text = string.Format("The email address {0} already registered ", txtEmail.Text.Trim()); } labelMessage.ForeColor = System.Drawing.Color.Red; //ClearField(); return; } labelMessage.Text = "you have registered successfully...and your user ID is " + adGiver.EmailID; labelMessage.ForeColor = System.Drawing.Color.Green; ClearField(); } } catch (Exception ex) { labelMessage.Text = "Error : " + ex.Message; labelMessage.ForeColor = System.Drawing.Color.Red; } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { labelMessage.Text = string.Empty; using (UserInformationRT receiverTransfer = new UserInformationRT()) { hdIsEdit.Value = "true"; List <UserInfo> userInfoList = new List <UserInfo>(); Int32 userGroupID = Convert.ToInt32(dropDownListGroupName.SelectedValue); Int32 userID = Convert.ToInt32(hdUserInfoID.Value.ToString()); userInfoList = receiverTransfer.GetUserInfoIDByGropIDAndLoginNameAndLoginPasswordAndUserID(userID, userGroupID, txtLoginName.Text); if (userInfoList != null && userInfoList.Count > 0) { string msg = "Group Name " + "'" + dropDownListGroupName.SelectedItem + "'" + " And\n" + " Login Name " + "'" + txtLoginName.Text + "'" + " Already Exists!"; labelMessage.Text = msg; labelMessage.ForeColor = System.Drawing.Color.Red; return; } UserInfo userInfo = CreateUserInfo(); if (userInfo != null) { receiverTransfer.UpdateUserInfo(userInfo); labelMessage.Text = "Data successfully updated..."; labelMessage.ForeColor = System.Drawing.Color.Green; } else { labelMessage.Text = "Data not updated..."; labelMessage.ForeColor = System.Drawing.Color.Red; } } btnSave.Visible = true; btnUpdate.Visible = false; btnCancel.Visible = false; btnDelete.Visible = false; ClearField(); LoadUserInfo(); } catch (Exception ex) { labelMessage.Text = "Error : " + ex.Message; labelMessage.ForeColor = System.Drawing.Color.Red; } }
private void LoadUserInfo() { try { using (UserInformationRT receiverTransfer = new UserInformationRT()) { lvUserInfo.DataSource = receiverTransfer.GetUserInfoAllForListView();; lvUserInfo.DataBind(); } } catch (Exception ex) { labelMessage.Text = "Error : " + ex.Message; labelMessage.ForeColor = System.Drawing.Color.Red; } }
protected void btnSave_Click(object sender, EventArgs e) { try { labelMessage.Text = string.Empty; using (UserInformationRT receiverTransfer = new UserInformationRT()) { List <UserInfo> UserInfo = new List <UserInfo>(); Int32 userGroupID = Convert.ToInt32(dropDownListGroupName.SelectedValue); UserInfo = receiverTransfer.GetUserInfoIDByGropIDAndLoginNameAndLoginPassword(userGroupID, txtLoginName.Text); if (UserInfo != null && UserInfo.Count > 0) { string msg = "Group Name " + dropDownListGroupName.SelectedItem + " And\n" + " Login Name " + txtLoginName.Text + " Already Exists!"; labelMessage.Text = msg; labelMessage.ForeColor = System.Drawing.Color.Red; return; } UserInfo userInfo = CreateUserInfo(); receiverTransfer.AddUserInfo(userInfo); if (userInfo.IID > 0) { labelMessage.Text = "Data successfully saved..."; labelMessage.ForeColor = System.Drawing.Color.Green; } else { labelMessage.Text = "Data not saved..."; labelMessage.ForeColor = System.Drawing.Color.Red; } } ClearField(); LoadUserInfo(); } catch (Exception ex) { labelMessage.Text = "Error : " + ex.Message; labelMessage.ForeColor = System.Drawing.Color.Red; } }
protected void btnDelete_Click(object sender, EventArgs e) { try { labelMessage.Text = string.Empty; using (UserInformationRT receiverTransfer = new UserInformationRT()) { hdIsDelete.Value = "true"; hdIsEdit.Value = "true"; UserInfo user = CreateUserInfo(); if (user != null) { receiverTransfer.UpdateUserInfo(user); labelMessage.Text = "Data successfully deleted..."; labelMessage.ForeColor = System.Drawing.Color.Green; } else { labelMessage.Text = "Data not deleted..."; labelMessage.ForeColor = System.Drawing.Color.Red; } } btnSave.Visible = true; btnUpdate.Visible = false; btnCancel.Visible = false; btnDelete.Visible = false; LoadUserInfo(); ClearField(); } catch (Exception ex) { labelMessage.Text = "Error : " + ex.Message; labelMessage.ForeColor = System.Drawing.Color.Red; } }
public LoginPage() { this._userInformationRT = new UserInformationRT(); }
public LoginMaster() { this._categoryRT = new CategoryRT(); this._userInformationRT = new UserInformationRT(); }
public InnerMasterPage() { this._categoryRT = new CategoryRT(); this._userInformationRT = new UserInformationRT(); }