/// <summary> /// Function for Delete /// </summary> public void Delete() { try { ReminderSP spReminder = new ReminderSP(); if (PublicVariables.isMessageDelete) { if (Messages.DeleteMessage() == true) { isDeleteStatus = spReminder.RemainderDelete(decReminderId); if (isDeleteStatus) { Messages.DeletedMessage(); Clear(); } } } else { isDeleteStatus = spReminder.RemainderDelete(decReminderId); if (isDeleteStatus) { Messages.DeletedMessage(); Clear(); } } } catch (Exception ex) { MessageBox.Show("PREM4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Fills controls for updation /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvRemainder_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (dgvRemainder.CurrentRow != null) { if (dgvRemainder.CurrentRow.Cells["reminderId"].Value != null) { if (dgvRemainder.CurrentRow.Cells["reminderId"].Value.ToString() != string.Empty) { decReminderId = Convert.ToDecimal(dgvRemainder.CurrentRow.Cells["reminderId"].Value.ToString()); ReminderSP spreminder = new ReminderSP(); ReminderInfo infoReminder = new ReminderInfo(); infoReminder = spreminder.RemainderView(decReminderId); txtFromDate.Text = infoReminder.FromDate.ToString("dd-MMM-yyyy"); txtToDate.Text = infoReminder.ToDate.ToString("dd-MMM-yyyy"); //dtpFromDate.Value = infoReminder.FromDate; //dtpToDate.Value = infoReminder.ToDate; txtRemindAbout.Text = infoReminder.RemindAbout; txtFromDate.Focus(); btnSave.Text = "Update"; btnDelete.Enabled = true; } } } } catch (Exception ex) { MessageBox.Show("PREM12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void ReminderGridFill() { try { ReminderSP spReminder = new ReminderSP(); dgvRemainder.DataSource = spReminder.ReminderSearch(txtFromDateSearch.Text, txtToDateSearch.Text); } catch (Exception ex) { MessageBox.Show("PREM6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public void gridfill() { try { DataTable dtbl = new DataTable(); ReminderSP SpRemainder = new ReminderSP(); dtbl = SpRemainder.ShortExpiryReminderGridFill(Convert.ToDecimal(cmbProductGroup.SelectedValue.ToString()), Convert.ToDecimal(cmbProduct.SelectedValue.ToString()), Convert.ToDecimal(cmbBrand.SelectedValue.ToString()), Convert.ToDecimal(cmbSize.SelectedValue.ToString()), Convert.ToDecimal(cmbModelno.SelectedValue.ToString()), Convert.ToDecimal(cmbTax.SelectedValue.ToString()), Convert.ToDecimal(cmbGodown.SelectedValue.ToString()), Convert.ToDecimal(cmbRack.SelectedValue.ToString())); dgvProductExpiry.DataSource = dtbl; } catch (Exception ex) { MessageBox.Show("SE:2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void OverDueSalesOrderGridFill() { try { ReminderSP spReminder = new ReminderSP(); if (cmbAccountLeadger.SelectedValue.ToString() != "System.Data.DataRowView" && cmbAccountLeadger.Text != "System.Data.DataRowView") { decimal decLedgerId = decimal.Parse(cmbAccountLeadger.SelectedValue.ToString()); dgvOverdueSalesOrder.DataSource = spReminder.OverdueSalesOrderCorrespondingAccountLedger(decLedgerId); } } catch (Exception ex) { MessageBox.Show("ODSO2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to call this form frmReminderPopUp form to view details /// </summary> /// <param name="frmReminder"></param> public void CallFromReminder(frmReminderPopUp frmReminder) { try { base.Show(); DataTable dtbl = new DataTable(); dtbl = new ReminderSP().ShortExpiryReminder(0, 0, 0, 0, 0, 0, 0, 0); dgvProductExpiry.DataSource = dtbl; this.frmReminderPopupObj = frmReminder; frmReminderPopupObj.Enabled = false; } catch (Exception ex) { MessageBox.Show("SE:11" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to print the report /// </summary> public void PrintReport() { try { ReminderSP SPReminder = new ReminderSP(); decimal decA = Convert.ToDecimal(cmbProductGroup.SelectedValue.ToString()); decimal decB = Convert.ToDecimal(cmbProductName.SelectedValue.ToString()); decimal decC = Convert.ToDecimal(cmbBrand.SelectedValue.ToString()); decimal decD = Convert.ToDecimal(cmbSize.SelectedValue.ToString()); decimal decE = Convert.ToDecimal(cmbModelno.SelectedValue.ToString()); decimal decF = Convert.ToDecimal(cmbGodown.SelectedValue.ToString()); decimal decG = Convert.ToDecimal(cmbRack.SelectedValue.ToString()); decimal decproExp = 0; string strproExp = string.Empty; if (txtProductExpire.Text != string.Empty) { decproExp = Convert.ToDecimal(txtProductExpire.Text.ToString()); } else { decproExp = 0; } if (cmbProductExpire.Text != string.Empty) { strproExp = cmbProductExpire.Text; } else { strproExp = string.Empty; } DataSet dsShortExpiryReport = SPReminder.ShortExpiryReportPrinting(decA, decB, decC, decD, decE, decF, decG, decproExp, strproExp, PublicVariables._dtCurrentDate, 1); ////frmReport //frmReport = new frmReport(); //frmReport.MdiParent = formMDI.MDIObj; if (dgvShortExpiryReport.Rows.Count > 0) { // frmreport.ShortExpiryReportPrinting(dsShortExpiryReport); } else { Messages.InformationMessage("No Data Found"); } } catch (Exception ex) { MessageBox.Show("SER:10" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> private void OverDuePurchaseOrderGridFill() { try { ReminderSP spReminder = new ReminderSP(); if (cmbAccountLedger.SelectedValue.ToString() != "System.Data.DataRowView" && cmbAccountLedger.Text != "System.Data.DataRowView") { decimal decLedgerId = decimal.Parse(cmbAccountLedger.SelectedValue.ToString()); dgvOverduePurchaseOrder.DataSource = spReminder.OverDuePurchaseOrdersCorrespondingAccountLedger(decLedgerId); dgvOverduePurchaseOrder.Columns["PurchaseOrderMasterId"].Visible = false; dgvOverduePurchaseOrder.Columns["InvoicedMasterId"].Visible = false; dgvOverduePurchaseOrder.Columns["MR_OrderMasterId"].Visible = false; dgvOverduePurchaseOrder.Columns["ledgerId"].Visible = false; } } catch (Exception ex) { MessageBox.Show("ODPO:2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function for Save /// </summary> public void SaveFunction() { try { ReminderSP spReminder = new ReminderSP(); ReminderInfo infoReminder = new ReminderInfo(); infoReminder.FromDate = dtpFromDate.Value; infoReminder.ToDate = dtpToDate.Value; infoReminder.RemindAbout = txtRemindAbout.Text.Trim(); infoReminder.Extra1 = string.Empty; infoReminder.Extra2 = string.Empty; infoReminder.ExtraDate = DateTime.Now; if (spReminder.ReminderAdd(infoReminder)) { Messages.SavedMessage(); } } catch (Exception ex) { MessageBox.Show("PREM2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill the short expiry products /// </summary> public void GridFill() { try { DataTable dtbl = new DataTable(); ReminderSP SpRemainder = new ReminderSP(); decimal decA = Convert.ToDecimal(cmbProductGroup.SelectedValue.ToString()); decimal decB = Convert.ToDecimal(cmbProductName.SelectedValue.ToString()); decimal decC = Convert.ToDecimal(cmbBrand.SelectedValue.ToString()); decimal decD = Convert.ToDecimal(cmbSize.SelectedValue.ToString()); decimal decE = Convert.ToDecimal(cmbModelno.SelectedValue.ToString()); decimal decF = Convert.ToDecimal(cmbGodown.SelectedValue.ToString()); decimal decG = Convert.ToDecimal(cmbRack.SelectedValue.ToString()); decimal decproExp = 0; string strproExp = string.Empty; if (txtProductExpire.Text != string.Empty) { decproExp = Convert.ToDecimal(txtProductExpire.Text.ToString()); } else { decproExp = 0; } if (cmbProductExpire.Text != string.Empty) { strproExp = cmbProductExpire.Text; } else { strproExp = string.Empty; } dtbl = SpRemainder.ShortExpiryReportGridFill(decA, decB, decC, decD, decE, decF, decG, decproExp, strproExp, PublicVariables._dtCurrentDate); dgvShortExpiryReport.DataSource = dtbl; } catch (Exception ex) { MessageBox.Show("SER:8" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void gridfill() { try { DataTable dtbl = new DataTable(); string strCriteria = string.Empty; if (rbtnAll.Checked) { strCriteria = "All"; } if (rbtnMax.Checked) { strCriteria = "Maximum Level"; } if (rbtnMin.Checked) { strCriteria = "Minimum Level"; } if (rbtnNegativestock.Checked) { strCriteria = "Negative Stock"; } if (rbtnReorder.Checked) { strCriteria = "Reorder Level"; } ReminderSP SpRemainder = new ReminderSP(); dtbl = SpRemainder.StockSearch(Convert.ToDecimal(cmbGroup.SelectedValue), Convert.ToDecimal(cmbProduct.SelectedValue), Convert.ToDecimal(cmbBrand.SelectedValue), Convert.ToDecimal(cmbSize.SelectedValue), Convert.ToDecimal(cmbModelNo.SelectedValue), Convert.ToDecimal(cmbTax.SelectedValue), Convert.ToDecimal(cmbGodown.SelectedValue), Convert.ToDecimal(cmbRack.SelectedValue), strCriteria); dgvStock.DataSource = dtbl; } catch (Exception ex) { MessageBox.Show("ST:11" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Showing Reminder If Any one have /// </summary> public void ShowReminderIfAny() { try { string Purchasereminder = string.Empty; string Salesreminder = string.Empty; string Personalreminder = string.Empty; string NegativeStkreminder = string.Empty; string MinStkreminder = string.Empty; string MaxStkreminder = string.Empty; string ReordrStkreminder = string.Empty; string ShortExpiryReminder = string.Empty; DataTable dtbl = new DataTable(); ReminderSP SpReminder = new ReminderSP(); if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmOverduePurchaseOrder", "View")) { PurchaseOrderMasterSP SpPurchaseOrderMaster = new PurchaseOrderMasterSP(); dtbl = SpPurchaseOrderMaster.PurchaseOrderOverDueReminder(PublicVariables._dtFromDate, PublicVariables._dtToDate, "Due", PublicVariables._dtCurrentDate, "All"); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { Purchasereminder = Purchasereminder + "1 Overdue purchase order\n\n"; } else { Purchasereminder = Purchasereminder + dtbl.Rows.Count + " Overdue purchase orders\n\n"; } } } if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmOverdueSalesOrder", "View")) { SalesOrderMasterSP SpSalesOrderMaster = new SalesOrderMasterSP(); dtbl = SpSalesOrderMaster.SalesOrderOverDueReminder(PublicVariables._dtFromDate, PublicVariables._dtToDate, "Due", PublicVariables._dtCurrentDate, "All"); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { Salesreminder = Salesreminder + "1 Overdue sales order\n\n"; } else { Salesreminder = Salesreminder + dtbl.Rows.Count + " Overdue sales orders\n\n"; } } } if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Delete Item") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Update") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Save")) { string FromDate = Convert.ToString(PublicVariables._dtCurrentDate); string ToDate = Convert.ToString(PublicVariables._dtCurrentDate); dtbl = SpReminder.ReminderSearch(FromDate, ToDate); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { Personalreminder = Personalreminder + "1 personal reminder \n\n"; } else { Personalreminder = Personalreminder + dtbl.Rows.Count + " Personal reminders\n\n"; } } } if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmShortExpiry", "View")) { dtbl = SpReminder.ShortExpiryReminder(0, 0, 0, 0, 0, 0, 0, 0); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { ShortExpiryReminder = ShortExpiryReminder + "1 Product batch is going to expire"; } else { ShortExpiryReminder = ShortExpiryReminder + dtbl.Rows.Count + " Product batches going to expire"; } } } //frmStock if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmStock", "View")) { dtbl = SpReminder.StockSearch(0, 0, 0, 0, 0, 0, 0, 0, "Negative Stock"); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { NegativeStkreminder = NegativeStkreminder + "1 Negative stock product \n\n"; } else { NegativeStkreminder = NegativeStkreminder + dtbl.Rows.Count + " Negative stock products\n\n"; } } dtbl = SpReminder.StockSearch(0, 0, 0, 0, 0, 0, 0, 0, "Minimum Level"); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { MinStkreminder = MinStkreminder + "1 Minimum stock product \n\n"; } else { MinStkreminder = MinStkreminder + dtbl.Rows.Count + " Minimum stock products \n\n"; } } dtbl = SpReminder.StockSearch(0, 0, 0, 0, 0, 0, 0, 0, "Maximum Level"); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { MaxStkreminder = MaxStkreminder + "1 Maximum stock product \n\n"; } else { MaxStkreminder = MaxStkreminder + dtbl.Rows.Count + " Maximum stock products \n\n"; } } dtbl = SpReminder.StockSearch(0, 0, 0, 0, 0, 0, 0, 0, "Reorder Level"); if (dtbl.Rows.Count > 0) { if (dtbl.Rows.Count == 1) { ReordrStkreminder = ReordrStkreminder + "1 Reorder Level product \n\n"; } else { ReordrStkreminder = ReordrStkreminder + dtbl.Rows.Count + " Reorder Level products \n\n"; } } } if (Salesreminder.Trim() != string.Empty || Purchasereminder.Trim() != string.Empty || Personalreminder.Trim() != string.Empty || NegativeStkreminder.Trim() != string.Empty || MinStkreminder.Trim() != string.Empty || MaxStkreminder.Trim() != string.Empty || ReordrStkreminder.Trim() != string.Empty) { frmReminderPopUp frmReminder = new frmReminderPopUp(); frmReminderPopUp isOpen = Application.OpenForms["frmReminderPopUp"] as frmReminderPopUp; if (isOpen == null) { frmReminder.WindowState = FormWindowState.Normal; frmReminder.MdiParent = formMDI.MDIObj; frmReminder.BringToFront(); frmReminder.ChangeLabel(Salesreminder, Purchasereminder, Personalreminder, ShortExpiryReminder, NegativeStkreminder, MinStkreminder, MaxStkreminder, ReordrStkreminder); } } } catch (Exception ex) { MessageBox.Show("CCD : 13 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }