private void btnStock_Click(object sender, EventArgs e) { string password = DialogConfirm.ShowInputDialog("Please provide password to continue.", "Confirm with Password"); try { string finalPass = SecurityEncrypt.Decrypt(ConfigurationManager.AppSettings["CriticalSectionPassword"].ToString(), "nakshal"); if ((User.IsSuperadmin) || (password == finalPass)) { FormHelper.OpenFrmStockSummary(); } else if (password == "") { MessageBox.Show("Stock openning is discarded by the user"); } else { MessageBox.Show("Wrong Password. Stock needs extra permission to open. Please provide correct password."); } } catch (Exception ex) { Logger.LogError(ex); } }
private void btnDelete_Click(object sender, EventArgs e) { try { txtMsg.Text = ""; string password = DialogConfirm.ShowInputDialog("Please provide password to continue.", "Confirm with Password"); string finalPass = SecurityEncrypt.Decrypt(ConfigurationManager.AppSettings["CriticalSectionPassword"], "nakshal"); if (password == finalPass) { bool isSuccess; string msg = DBSaveManager.RationcardDelete(lblRationCardId.Text, lblCustId.Text, out isSuccess); if (isSuccess) { txtMsg.Text = msg; RefreshCatWiseCountInUi(); ResetForm(); FetchFormData(); } } else if (password == "") { MessageBox.Show("Delete has been canceled by user."); } else { MessageBox.Show("Wrong Password."); } } catch (Exception ex) { Logger.LogError(ex); } }
private void btnDelPrd_Click(object sender, EventArgs e) { if (grdVwPrds.CurrentRow != null) { string password = DialogConfirm.ShowInputDialog("Please provide password to continue.", "Confirm with Password"); string finalPass = SecurityEncrypt.Decrypt(ConfigurationManager.AppSettings["CriticalSectionPassword"], "nakshal"); if (password == finalPass) { DeleteProduct(); } else if (password == "") { MessageBox.Show("Delete has been canceled by user."); } else { MessageBox.Show("Wrong Password."); } } else { MessageBox.Show("Please select a product to delete"); } }
private void btnSave_Click(object sender, EventArgs e) { try { txtMsg.Text = ""; if (lblIsEdit.Text == "1") { string password = DialogConfirm.ShowInputDialog("Please provide password to continue.", "Confirm with Password"); string finalPass = SecurityEncrypt.Decrypt(ConfigurationManager.AppSettings["CriticalSectionPassword"].ToString(), "nakshal"); if (password == finalPass) { Save(); } else if (password == "") { MessageBox.Show("Save has been canceled by user."); } else { MessageBox.Show("Wrong Password."); } } else { Save(); } } catch (Exception ex) { Logger.LogError(ex); } }