protected void btSaveModal_Click(object sender, EventArgs e) { if (CheckData()) { int ActiveCheck = 0; if (chkActive.Checked) { ActiveCheck = 1; } MDUserLoginData oUserLoginData = new MDUserLoginData(); if (Session["Login"] != null) { oUserLoginData = (MDUserLoginData)Session["Login"]; } if (ViewState["UserID"] == null) // Add { string Password = ""; Password = oAuthen.EncryptPasswordNoKey(txtPassword.Text.Trim()); oUser.InsertUserList(txtUsername.Text.Trim(), Password, txtSupplierNo.Text.Trim() , txtEmpCode.Text.Trim(), Convert.ToInt32(txtPwdExpried.Text.Trim()), ActiveCheck , oUserLoginData.ListOfUserLoginData[0].UserID.ToString()); } else { oUser.UpdateUserList(Convert.ToInt32(ViewState["UserID"]), txtUsername.Text.Trim(), txtSupplierNo.Text.Trim() , txtEmpCode.Text.Trim(), Convert.ToInt32(txtPwdExpried.Text.Trim()), ActiveCheck , oUserLoginData.ListOfUserLoginData[0].UserID.ToString()); } } else { ModalPopup1.Show(); } }
private void SetDataEdit(int ID) { MDUserLoginData oUserLoginData = new MDUserLoginData(); oUserLoginData = oUser.GetUserListByID(ID); if (oUserLoginData.ListOfUserLoginData.Length > 0) { trPassword.Visible = false; trConfirmPassword.Visible = false; txtUsername.Text = oUserLoginData.ListOfUserLoginData[0].UserName; txtEmpCode.Text = oUserLoginData.ListOfUserLoginData[0].EmpCode; txtPwdExpried.Text = oUserLoginData.ListOfUserLoginData[0].PwdExpired.ToString(); txtSupplierNo.Text = oUserLoginData.ListOfUserLoginData[0].SupplierName; if (oUserLoginData.ListOfUserLoginData[0].Active == 0) { chkActive.Checked = false; } else { chkActive.Checked = true; } ModalPopup1.Show(); } }
protected void btAddNew_Click(object sender, EventArgs e) { ClearData(); ClearColor(); lbHeader.Text = "Add New User"; ViewState["UserID"] = null; trPassword.Visible = true; trConfirmPassword.Visible = true; ModalPopup1.Show(); }