Exemple #1
0
        private void DataSave()
        {
            CheckUnCheck();
            string userid = string.Empty;

            if (CmbUserName.SelectedIndex >= 0)
            {
                userid = ((KeyValuePair <string, string>)CmbUserName.SelectedItem).Key.ToString();
            }
            string query = "update usercontrol set permision='" + checkbox + "',Isdelete='" + chkDelete.Checked + "',IsEdit='" + chkEdit.Checked + "',IsCancel='" + ChkCancel.Checked + "' where userid='" + userid + "'";
            bool   bl    = SQLHelper.GetInstance().ExcuteQuery(query, out msg);

            if (bl == true)
            {
                MessageBox.Show("Permission Success fully Updated", "Permission", MessageBoxButtons.OK, MessageBoxIcon.Information);
                UserTools.GetEditDeletePermision();
                CmbUserName.SelectedIndex = -1;
                for (int i = 0; i < chklistbox.Items.Count; i++)
                {
                    chklistbox.SetItemChecked(i, false);
                }
                chkDelete.Checked = false;
                chkEdit.Checked   = false;
                ChkCancel.Checked = false;
            }
        }
Exemple #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (Islogin())
            {
                UserTools._UserID   = ((KeyValuePair <string, string>)cmbUserName.SelectedItem).Key.ToString();
                UserTools._UserName = ((KeyValuePair <string, string>)cmbUserName.SelectedItem).Value.ToString();
                FinancialYearTools.GetFinancialYearDetails();
                UserTools.GetEditDeletePermision();

                flag = true;
                this.Close();
            }
            else
            {
                flag = false;
                toolTip1.Show("SORRY!INVALID PASSWORD", cmbUserName, 10, cmbUserName.Height - 100, 1000);
                // MessageBox.Show("SORRY! INVALID PASSWORD", "Wrong Password", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }