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 DuplicateCheck(string val, string checkBy) { if (!string.IsNullOrEmpty(val.Trim())) { try { bool isDuplicate, isRecordExists; string finalMsg = DBSaveManager.DuplicateCheck(val, checkBy, out isDuplicate, out isRecordExists, out _cardExists, out _adharExists, out _mobileNoexists); if (isRecordExists) { if (isDuplicate) { MessageBox.Show(finalMsg); } if (_cardExists || _adharExists) { btnSave.Enabled = false; } else { btnSave.Enabled = true; } } } catch (Exception ex) { Logger.LogError(ex); } } }
public static bool DoLogin(string userId, string password, string macId, out string msg) { bool isSuccess; DBSaveManager.DoLogin(userId, password, macId, out msg, out isSuccess); return(isSuccess); }
private void LoadAppStartHis() { try { grdVwAppStart.DataSource = DBSaveManager.LoadAppStartHis(); } catch (Exception ex) { Logger.LogError(ex); } }
public static void RemoveUser(string userId, out bool isSuccess) { isSuccess = false; try { DBSaveManager.RemoveUser(userId, out isSuccess); } catch (Exception ex) { Logger.LogError(ex); } }
private void DeleteRecord(string tableName) { bool isSuccess; DBSaveManager.DeleteAuditRecords(tableName, dtFrom.Value.ToString("MM-dd-yyyy HH:mm:ss"), dtTo.Value.ToString("MM-dd-yyyy HH:mm:ss"), out isSuccess); if (isSuccess) { MessageBox.Show("Records cleaned successfully"); } else { MessageBox.Show("Records cleaning failed"); } }
private List <SecurityCode> OprateSecurityCodes(string email, string code, string operation) { List <SecurityCode> codes = new List <SecurityCode>(); try { DBSaveManager.OprateSecurityCodes(email, code, operation); } catch (Exception ex) { Logger.LogError(ex); } return(codes); }
private static void ApplicationStart() { if (!Network.IsInternetConnected) { DialogConfirm.ShowInformationDialog("Internet is not there. Please connect to internet, then open again.", "Stone Age !!"); Application.ExitThread(); Application.Exit(); } else { //DialogConfirm.ShowInfohScreen("Application is checking your system..." + Environment.NewLine + "Please Wait"); try { ErrorEnum errType = ErrorEnum.Other; string errMsg = string.Empty; bool isSuccess = false; DBSaveManager.ApplicationStartDbFetch(out errType, out errMsg, out isSuccess); if (isSuccess) { if (User.IsSuperadmin) { Application.Run(new FrmUserSelector()); } else { Application.Run(new FrmLogin()); } } else if (errType.Equals(ErrorEnum.IpNotAllowed)) { DialogConfirm.ShowInformationDialog("Your IP is not allowed." + Environment.NewLine + " Please contact administrator to add your IP : " + Network.GetPublicIpAddress(), "IP not Allowed!"); } else if (errType.Equals(ErrorEnum.MacNotAllowed)) { DialogConfirm.ShowInformationDialog("Your machine is not allowed." + Environment.NewLine + " Please contact administrator to add your machine : " + Network.GetActiveMACAddress(), "Machine not Allowed"); } else { Application.Run(new FrmSetup()); } } catch (Exception ex) { Logger.LogError(ex); } //Thread mstDataThread = new Thread(new ThreadStart(FetchMasterData)); //mstDataThread.Start(); } }
private void SaveBill() { var billObj = SaveBillToDrive(); //Fire & Forget save bills to db //Add DB save as task for parallelism DBSaveManager.AddTaskToBillSaveQueue(billObj); FrmFrontDeskEntry frm = (FrmFrontDeskEntry)FormHelper.OpenFrmFrontDeskEntry(); ((DataGridView)frm.Controls["grdVwSearchResult"]).DataSource = null; ((Label)frm.Controls["lblCardCount"]).Text = ""; FormHelper.CloseFrmPrdQuantityInBill(); ((TextBox)frm.Controls["txtRationcardNumber"]).Focus(); FormHelper.CloseRationBillDetails(); }
private void Save() { bool isSuccess; string msgToShow = string.Empty; try { //Logger.LogInfo(dateTimePicker1.Value.ToString()); dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "MM-dd-yyyy"; string hofId = cmbHof.SelectedValue.ToString(); DBSaveManager.SaveRationCard(rationCardId: lblRationCardId.Text, categoryId: cmbCat.SelectedValue.ToString(), categoryDesc: cmbCat.Text, CardNo: cmbCat.Text + "-" + txtCardNo.Text , customerId: lblCustId.Text, adhar: txtAdharOrEpic.Text, cardHolderName: txtCardHolderName.Text, isHof: (chkHof.Checked ? "1" : "0") , hofId: hofId, hofName: cmbHof.Text.Split(new string[] { "||" }, StringSplitOptions.None)[0].Trim() , RelWithHofId: ((cmbRelHof.SelectedValue != null) ? cmbRelHof.SelectedValue.ToString() : ""), RelWithHofDesc: cmbRelHof.Text , FatherName: txtFatherName.Text, typeOfRelationId: ((cmbRel.SelectedValue != null) ? cmbRel.SelectedValue.ToString() : "") , typeOfRelationDesc: cmbRel.Text, activeOrInactiveDt: DateTime.Parse(dateTimePicker1.Value.ToString()).ToString("MM-dd-yyyy HH:mm:ss") , mobileNo: txtMobileNo.Text, age: txtAge.Text, isActive: (chkActive.Checked ? "1" : "0"), address: txtAddress.Text , remarks: txtRemarks.Text, isSuccess: out isSuccess, msgToShow: out msgToShow); if (!isSuccess) { MessageBox.Show(msgToShow); } else { MessageBox.Show("Rationcard Details successfuly saved..."); } //Refresh the form data for new entry RefreshCatWiseCountInUi(); ResetForm(); FetchFormData(); dateTimePicker1.Format = DateTimePickerFormat.Long; dateTimePicker1.CustomFormat = null; } catch (Exception ex) { Logger.LogError(ex); } }
private void btnSearch_Click(object sender, EventArgs e) { try { ShowProductsToGrid(DBSaveManager.ProductSearch(txtBarCode.Text.Trim(), txtArticleCode.Text.Trim(), txtPrdName.Text.Trim(), txtProdDesc.Text.Trim() , chkActive.Checked, chkDefaultToGiveRation.Checked , chkDefaultProduct.Checked, ((cmbDept.SelectedItem == null) ? string.Empty : ((ProductDeptMaster)cmbDept.SelectedItem).ProductDeptMasterId) , ((cmbSubDept.SelectedItem == null) ? string.Empty : ((ProductSubDeptMaster)cmbSubDept.SelectedItem).ProductSubDeptMasterId) , ((cmbClass.SelectedItem == null) ? string.Empty : ((ProductClassMaster)cmbClass.SelectedItem).ProductClassMasterId) , ((cmbSubClass.SelectedItem == null) ? string.Empty : ((ProductSubClassMaster)cmbSubClass.SelectedItem).ProductSubClassMasterId) , ((cmbMcDesc.SelectedItem == null) ? string.Empty : ((ProductMcMaster)cmbMcDesc.SelectedItem).ProductMcMasterId) , txtMcCode.Text.Trim(), ((cmbBrand.SelectedItem == null) ? string.Empty : ((ProductBrandMaster)cmbBrand.SelectedItem).ProductBrandMasterId) , txtBrandCompany.Text.Trim(), dtFrom.Text, dtTo.Text)); } catch (Exception ex) { Logger.LogError(ex); } }
private void DeleteProduct() { bool isSuccess; try { DBSaveManager.DeleteProduct(grdVwPrds.CurrentRow.Cells["Product_Master_Identity"].Value.ToString(), out isSuccess); if (isSuccess) { MessageBox.Show("Product successfuly deleted"); MasterData.PrdData.Refresh(); ShowProductsToGrid(MasterData.PrdData.Data); } } catch (Exception ex) { Logger.LogError(ex); } }
private void FlushAppHistory() { bool isSuccess = false; string statusMsg = string.Empty; try { DBSaveManager.FlushAppHistory(out statusMsg, out isSuccess); if (isSuccess) { LoadAppStartHis(); MessageBox.Show(statusMsg); } } catch (Exception ex) { Logger.LogError(ex); } }
public static void RegisterNewUser(string name, string mobileNo, string address, string email, string profilePicPath , string login, string password, bool macChekRequired, string fpsCode, string fpsLiscenceNo, string mrShopNo , string mac, string remark, string code , out string successMsg) { List <MacIdAssigned> mcs = new List <MacIdAssigned>(); successMsg = ""; try { DBSaveManager.RegisterNewUser(name, mobileNo, address, email, profilePicPath , login, password, macChekRequired, fpsCode, fpsLiscenceNo, mrShopNo , mac, remark, code , out successMsg); } catch (Exception ex) { Logger.LogError(ex); } }
private List <Product_Input_Master> OperateProductTables(string distId, string tableName, string id, string action) { bool isSuccess; string statusMsg = string.Empty; List <Product_Input_Master> prdData = new List <Product_Input_Master>(); try { prdData = DBSaveManager.OperateProductTablesAndReturnData(distId, tableName, id, action, out isSuccess, out statusMsg); if (isSuccess) { MessageBox.Show(statusMsg); } } catch (Exception ex) { Logger.LogError(ex); } return(prdData); }
public void OperateOrphanRecords(string action) { bool isSuccess = false; var rationCards = new List <RationCardDetail>(); var customers = new List <Customer>(); try { string distId = ((Distributor)cmbUserList.SelectedItem).Dist_Id; DBSaveManager.OperateOrphanRecords(distId, action, out isSuccess, out rationCards, out customers); if (isSuccess) { grdVwOrphanCards.DataSource = rationCards; grVwOrphanCustomers.DataSource = customers; } } catch (Exception ex) { Logger.LogError(ex); } }
private void RationBillDetails_Load(object sender, EventArgs e) { grdVwMembers.ScrollBars = ScrollBars.Vertical; try { //internet check logo Network.CheckForInternet(InternetStatusChange); grdVwMembers.DataSource = null; grdVwMembers.DataSource = _membersToGiveRation; //make unneccesary fileds hidden grdVwMembers.Columns["Cat_Key"].Visible = false; grdVwMembers.Columns["Cat_Desc"].Visible = false; grdVwMembers.Columns["RationCard_Id"].Visible = false; grdVwMembers.Columns["Card_Category_Id"].Visible = false; grdVwMembers.Columns["Customer_Created_Date"].Visible = false; grdVwMembers.Columns["Customer_Id"].Visible = false; grdVwMembers.Columns["Hof_Id"].Visible = false; grdVwMembers.Columns["Dist_Id"].Visible = false; grdVwMembers.Columns["ActiveCustomer"].Visible = false; grdVwMembers.Columns["Cat_Id"].Visible = false; grdVwMembers.Columns["CardCount"].Visible = false; grdVwMembers.Columns["FamilyCount"].Visible = false; grdVwMembers.Columns["ActiveCard"].Visible = true; grdVwMembers.Columns["CardStatus"].Visible = false; grdVwMembers.Columns["Gaurdian_Relation"].Visible = false; grdVwMembers.Columns["SlNo"].Visible = false; grdVwMembers.Columns["Adhar_No"].Visible = false; grdVwMembers.Columns["Mobile_No"].Visible = false; grdVwMembers.Columns["Hof_Name"].Visible = false; grdVwMembers.Columns["Relation_With_Hof"].Visible = false; grdVwMembers.Columns["Age"].Visible = false; grdVwMembers.Columns["Address"].Visible = false; grdVwMembers.Columns["Card_Created_Date"].Visible = false; grdVwMembers.Columns["Gaurdian_Name"].Visible = false; grdVwMembers.Columns["Remarks"].Visible = false; grdVwMembers.Columns["IsSelected"].Visible = false; grdVwMembers.Columns["Activecard"].Visible = false; grdVwMembers.Columns["IsSelected"].HeaderText = ""; grdVwMembers.Columns["IsSelected"].DisplayIndex = 0; grdVwMembers.Columns["IsSelected"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; grdVwMembers.Columns["IsSelected"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true); grdVwMembers.Columns["Number"].HeaderText = "Card No."; grdVwMembers.Columns["Number"].DisplayIndex = 1; grdVwMembers.Columns["Number"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; grdVwMembers.Columns["Number"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true); grdVwMembers.Columns["Name"].HeaderText = "Name"; grdVwMembers.Columns["Name"].DisplayIndex = 2; grdVwMembers.Columns["Name"].Width = 100; grdVwMembers.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.None; grdVwMembers.Columns["Name"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true); grdVwMembers.Columns["Hof_Flag"].HeaderText = "IsHof"; grdVwMembers.Columns["Hof_Flag"].DisplayIndex = 6; grdVwMembers.Columns["Hof_Flag"].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; grdVwMembers.Columns["Hof_Flag"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.ColumnHeader, true); btnSaveBill.Visible = true; } catch (Exception ex) { Logger.LogError(ex); } //Fetch bill counter ErrorEnum errType = ErrorEnum.Other; string errMsg = string.Empty; bool isSuccess = false; List <BillCounter> billCounters = DBSaveManager.FetchBillCounter(out errType, out errMsg, out isSuccess); if (isSuccess) { int count = 1; int convertedNum = 0; foreach (BillCounter r in billCounters) { lblCashMemoCounter.Text = r.TotalBillCOunter; _totalBillCounter = int.TryParse(lblCashMemoCounter.Text, out convertedNum) ? convertedNum : 0; lblSerialNumber.Text = r.DailyBillCOunterOrCount; _dayBillCounterOrCount = int.TryParse(lblSerialNumber.Text, out convertedNum) ? convertedNum : 0; count++; } //Assign prd list to prd dropdown cmbCommodity.DataSource = MasterData.PrdData.Data; cmbCommodity.ValueMember = "Product_Master_Identity"; cmbCommodity.DisplayMember = "Name"; cmbCommodity.AutoCompleteMode = AutoCompleteMode.SuggestAppend; cmbCommodity.AutoCompleteSource = AutoCompleteSource.ListItems; lblBalRs.Text = ""; cmbCommodity.Select(); } }