////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void FillPropeties() { try { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); ProClass.DateType = FormSession.DateType; ProClass.UsrLoginID = txtUsrLoginID.Text; ProClass.UsrPassword = txtUsrPassword.Text; if (!string.IsNullOrEmpty(txtUsrFullName.Text)) { ProClass.UsrFullName = txtUsrFullName.Text; } if (ddlUsrStatus.SelectedIndex > 0) { ProClass.UsrStatus = Convert.ToBoolean(Convert.ToInt16(ddlUsrStatus.SelectedValue)); } if (!string.IsNullOrEmpty(txtUsrDescription.Text)) { ProClass.UsrDescription = txtUsrDescription.Text; } ProClass.UsrEmailID = txtUsrEmail.Text; ProClass.UsrLanguage = ddlUsrLang.SelectedValue; ProClass.UsrPermission = CryptorEngine.Encrypt(PermCtl.getPermissions(), true); ProClass.UsrStartDate = calUsrStartDate.getDate(); ProClass.UsrExpiryDate = calUsrExpiryDate.getDate(); ProClass.TransactionBy = FormSession.LoginID; } catch (Exception Ex) { } }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected void PopulateData(string pID) { try { dt = DBFun.FetchData(MainQuery + " AND UsrLoginID = '" + pID + "'"); if (DBFun.IsNullOrEmpty(dt)) { return; } txtUsrLoginID.Text = dt.Rows[0]["UsrLoginID"].ToString(); txtUsrPassword.Attributes["value"] = dt.Rows[0]["UsrPassword"].ToString(); txtUsrFullName.Text = dt.Rows[0]["UsrFullName"].ToString(); calUsrStartDate.setDBDate(dt.Rows[0]["UsrStartDate"], "S"); calUsrExpiryDate.setDBDate(dt.Rows[0]["UsrExpiryDate"], "S"); ddlUsrStatus.SelectedIndex = ddlUsrStatus.Items.IndexOf(ddlUsrStatus.Items.FindByValue(Convert.ToInt16(dt.Rows[0]["UsrStatus"]).ToString())); ddlUsrLang.SelectedIndex = ddlUsrLang.Items.IndexOf(ddlUsrLang.Items.FindByValue(dt.Rows[0]["UsrLanguage"].ToString())); txtUsrEmail.Text = dt.Rows[0]["UsrEmailID"].ToString(); txtUsrDescription.Text = dt.Rows[0]["UsrDescription"].ToString(); PermCtl.PopulatePermissions(CryptorEngine.Decrypt(dt.Rows[0]["UsrPermission"].ToString(), true), txtUsrLoginID.Text); ButtonAction(true, "11100"); } catch (Exception Ex) { } }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /*##############################################################################################################################*/ /*##############################################################################################################################*/ #region DataItem Events public void DataItemStatus(bool pStatus) { txtUsrLoginID.Enabled = pStatus; txtUsrPassword.Enabled = pStatus; txtUsrFullName.Enabled = pStatus; txtUsrEmail.Enabled = pStatus; calUsrStartDate.setEnabled(pStatus); calUsrExpiryDate.setEnabled(pStatus); ddlUsrStatus.Enabled = pStatus; ddlUsrLang.Enabled = pStatus; txtUsrDescription.Enabled = pStatus; PermCtl.EnablePermissions(pStatus, true); }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void ClearData() { txtUsrLoginID.Text = ""; txtUsrPassword.Attributes["value"] = ""; txtUsrFullName.Text = ""; ddlUsrStatus.SelectedIndex = -1; ddlUsrLang.SelectedIndex = -1; txtUsrEmail.Text = ""; txtUsrDescription.Text = ""; ViewState["CommandName"] = ""; calUsrStartDate.ClearDate(); calUsrExpiryDate.ClearDate(); PermCtl.Clear(); }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected void EnableItem(bool pStatus) { calUsrStartDate.setEnabled(pStatus); calUsrExpiryDate.setEnabled(pStatus); calUsrStartDate.setValidationEnabled(pStatus); calUsrExpiryDate.setValidationEnabled(pStatus); cvCompareDates.Enabled = pStatus; spnUsrStartDate.Visible = pStatus; spnUsrExpiryDate.Visible = pStatus; ddlUsrStatus.Enabled = pStatus; PermCtl.EnablePermissions(pStatus, true); }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected void ClearUI() { txtUsrLoginID.Text = ""; ViewState["Pass"] = null; txtUsrPassword.Attributes["value"] = ""; txtUsrFullName.Text = ""; txtUsrEmailID.Text = ""; //txtUsrEmpID.Text = ""; calUsrStartDate.ClearDate(); calUsrExpiryDate.ClearDate(); ddlUsrStatus.SelectedIndex = 0; txtUsrDescription.Text = ""; PermCtl.Clear(); EnableItem(true); }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void FillPropeties() { try { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); ProClass.DateType = FormSession.DateType; ProClass.UsrLoginID = txtUsrLoginID.Text; ProClass.UsrPassword = CryptorEngine.Encrypt(txtUsrPassword.Text, true); ProClass.UsrFullName = txtUsrFullName.Text; ProClass.UsrEmailID = txtUsrEmailID.Text; //UsrPro.UsrEmpID = txtUsrEmpID.Text; ProClass.UsrStartDate = calUsrStartDate.getDate(); if (!string.IsNullOrEmpty(ProClass.UsrStartDate)) { ProClass.UsrStartDateType = calUsrStartDate.getDateType(); } ProClass.UsrExpiryDate = calUsrExpiryDate.getDate(); if (!string.IsNullOrEmpty(ProClass.UsrExpiryDate)) { ProClass.UsrExpiryDateType = calUsrExpiryDate.getDateType(); } if (ddlUsrStatus.SelectedIndex > -1) { ProClass.UsrStatus = Convert.ToBoolean(Convert.ToInt16(ddlUsrStatus.SelectedValue)); } ProClass.UsrDescription = txtUsrDescription.Text; ProClass.UsrLanguage = "En"; ProClass.UsrPermission = CryptorEngine.Encrypt(PermCtl.getPermissions(), true); ProClass.TransactionBy = FormSession.LoginUsr; } catch (Exception e1) { DBFun.InsertError(FormSession.PageName, "FillUsrObject"); } }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// protected void PopulateUI(string pID) { try { dt = DBFun.FetchData("SELECT * FROM AppUsers WHERE UsrLoginID = '" + pID + "'"); if (DBFun.IsNullOrEmpty(dt)) { return; } txtUsrLoginID.Text = dt.Rows[0]["UsrLoginID"].ToString(); if (txtUsrLoginID.Text == "admin") { EnableItem(false); } else { EnableItem(true); } txtUsrPassword.Attributes["value"] = CryptorEngine.Decrypt(dt.Rows[0]["UsrPassword"].ToString(), true); txtUsrFullName.Text = dt.Rows[0]["UsrFullName"].ToString(); txtUsrEmailID.Text = dt.Rows[0]["UsrEmailID"].ToString(); //txtUsrEmpID.Text = dt.Rows[0]["UsrEmpID"].ToString(); calUsrStartDate.setDBDate(dt.Rows[0]["UsrStartDate"], dt.Rows[0]["UsrStartDateType"].ToString()); calUsrExpiryDate.setDBDate(dt.Rows[0]["UsrExpiryDate"], dt.Rows[0]["UsrExpiryDateType"].ToString()); ddlUsrStatus.SelectedIndex = ddlUsrStatus.Items.IndexOf(ddlUsrStatus.Items.FindByValue(Convert.ToInt16(dt.Rows[0]["UsrStatus"]).ToString())); txtUsrDescription.Text = dt.Rows[0]["UsrDescription"].ToString(); PermCtl.PopulatePermissions(dt.Rows[0]["UsrPermission"].ToString(), txtUsrLoginID.Text); } catch (Exception e1) { } }