private void TxtUserCode_Validating(object sender, CancelEventArgs e) { if (_Tag == "" || this.ActiveControl == TxtUserCode) { return; } if (TxtUserCode.Enabled == false) { return; } if (string.IsNullOrEmpty(TxtUserCode.Text)) { MessageBox.Show("User Code Cannot Left Blank...!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); e.Cancel = true; TxtUserCode.Focus(); return; } else if (_Tag == "NEW") { if (_objUserMaster.CheckDuplicateUserCode(TxtUserCode.Text) == 1) { MessageBox.Show("User Code No Already Exist...!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); e.Cancel = true; TxtUserCode.Focus(); return; } } }
private void BtnSearchUser_Click(object sender, EventArgs e) { Common.PickList frmPickList = new Common.PickList("UaserMaster", _SearchKey); if (Common.PickList.dt.Rows.Count > 0) { frmPickList.ShowDialog(); if (frmPickList.SelectedList.Count > 0 && _Tag != "NEW") { this._UserId = frmPickList.SelectedList[0]["UserCode"].ToString().Trim(); DataTable dt = _objUserMaster.GetDataUser(this._UserId); SetData(dt); } else { TxtUserCode.Text = ""; } frmPickList.Dispose(); } else { MessageBox.Show("No List Available in User Master !", "Mr. Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtUserCode.Focus(); return; } TxtUserCode.Focus(); }
private void TxtUserCode_Validating(object sender, CancelEventArgs e) { if (string.IsNullOrEmpty(TxtUserCode.Text)) { MessageBox.Show("User Name Cannot Left Blank...!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information); e.Cancel = true; TxtUserCode.Focus(); return; } }
private void BtnDelete_Click(object sender, EventArgs e) { _Tag = "DELETE"; ControlEnableDisable(false, false); Text = "User Master [DELETE]"; TxtUserCode.Enabled = true; BtnSearchUser.Enabled = true; TxtUserCode.Focus(); BtnSave.Enabled = true; BtnCancel.Enabled = true; }
private void ClearFld() { _UserId = ""; foreach (Control control in PanelContainer.Controls) { if (control is TextBox) { control.Text = ""; } } CmbUserType.SelectedIndex = 0; TxtUserCode.Focus(); }
private void SetData(DataTable dt) { TxtUserCode.Text = dt.Rows[0]["UserCode"].ToString(); TxtUserName.Text = dt.Rows[0]["UserName"].ToString(); TxtMobileNo.Text = dt.Rows[0]["MobileNo"].ToString(); TxtEmailId.Text = dt.Rows[0]["EmailId"].ToString(); TxtStartDate.Text = dt.Rows[0]["StartDate"].ToString(); TxtEndDate.Text = dt.Rows[0]["EndDate"].ToString(); TxtUserPassword.Text = dt.Rows[0]["UserPassword"].ToString(); TxtConUserPassword.Text = dt.Rows[0]["UserPassword"].ToString(); TxtLedger.Text = dt.Rows[0]["GlDesc"].ToString(); TxtLedger.Tag = ((dt.Rows[0]["LedgerId"].ToString() == "") ? 0 : Convert.ToInt32(dt.Rows[0]["LedgerId"].ToString())); CmbUserType.Text = dt.Rows[0]["UserType"].ToString(); TxtUserCode.SelectAll(); }
public void ControlEnableDisable(bool trb, bool fld) { BtnNew.Enabled = trb; BtnEdit.Enabled = trb; BtnDelete.Enabled = trb; BtnExit.Enabled = trb; BtnFirstData.Enabled = trb; BtnNextData.Enabled = trb; BtnLastData.Enabled = trb; BtnPreviousData.Enabled = trb; BtnSearchUser.Enabled = fld; TxtUserCode.Enabled = fld; Utility.EnableDesibleColor(TxtUserCode, fld); TxtUserName.Enabled = fld; Utility.EnableDesibleColor(TxtUserName, fld); TxtMobileNo.Enabled = fld; Utility.EnableDesibleColor(TxtMobileNo, fld); TxtEmailId.Enabled = fld; Utility.EnableDesibleColor(TxtEmailId, fld); TxtStartDate.Enabled = fld; // Utility.EnableDesibleColor(TxtStartDate, fld); TxtEndDate.Enabled = fld; //Utility.EnableDesibleColor(TxtEndDate, fld); TxtUserPassword.Enabled = fld; Utility.EnableDesibleColor(TxtUserPassword, fld); TxtConUserPassword.Enabled = fld; Utility.EnableDesibleColor(TxtConUserPassword, fld); TxtLedger.Enabled = fld; BtnSearchLedger.Enabled = fld; Utility.EnableDesibleColor(TxtLedger, fld); CmbUserType.Enabled = fld; // CbActive.Enabled = fld; BtnSave.Enabled = fld; BtnCancel.Enabled = fld; if (BtnNew.Enabled == true) { BtnNew.Focus(); } else if (TxtUserCode.Enabled == true) { TxtUserCode.Focus(); } }