/// <summary> /// On 'Print' button click to take print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvAdvancePayment.Rows.Count > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); AdvancePaymentSP spAdvancePayment = new AdvancePaymentSP(); DataTable dtblAdvancePayment = new DataTable(); dtblAdvancePayment = spAdvancePayment.AdvancePaymentViewAllForAdvancePaymentReport(dtpFrmDate.Value, dtpToDate.Value, cmbEmployeeCode.Text, DateTime.Parse(dtpSalaryMonth.Text.ToString())); ds.Tables.Add(dtblAdvancePayment); //frmReport frmReportObj = new frmReport(); //frmReportObj.MdiParent = formMDI.MDIObj; // frmReportObj.AdvancePaymentReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("APR:8" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click to print the data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvPurchaseReturnReport.Rows.Count > 0) { if (dgvPurchaseReturnReport.Rows.Count > 0) { DataSet dsPurchaseReturnReport = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblGrid = dtblReg.Copy(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); dsPurchaseReturnReport.Tables.Add(dtblGrid); dsPurchaseReturnReport.Tables.Add(dtblCompany); ////frmReport //frmReport = new frmReport(); //frmReport.MdiParent = formMDI.MDIObj; // frmreport.PurchaseReturnReportPrinting(dsPurchaseReturnReport, txtTotalAmount.Text); } } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("PRRT:13" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill dates /// </summary> public void FinancialYearDate() { try { dtpfromDate.MinDate = PublicVariables._dtFromDate; dtpfromDate.MaxDate = PublicVariables._dtToDate; CompanyInfo infoComapany = new CompanyInfo(); CompanySP spCompany = new CompanySP(); infoComapany = spCompany.CompanyView(1); DateTime dtFromDate = infoComapany.CurrentDate; dtpfromDate.Value = dtFromDate; txtFromDate.Text = dtFromDate.ToString("dd-MMM-yyyy"); dtpfromDate.Value = Convert.ToDateTime(txtFromDate.Text); dtpTodate.MinDate = PublicVariables._dtFromDate; dtpTodate.MaxDate = PublicVariables._dtToDate; infoComapany = spCompany.CompanyView(1); DateTime dtToDate = infoComapany.CurrentDate; dtpTodate.Value = dtToDate; txtTodate.Text = dtToDate.ToString("dd-MMM-yyyy"); dtpTodate.Value = Convert.ToDateTime(txtFromDate.Text); } catch (Exception ex) { MessageBox.Show("PPREG2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvContraReport.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); //frmReport reportobj = new frmReport(); ContraMasterSP spContraMaster = new ContraMasterSP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); DataTable dtblCotraReport = spContraMaster.ContraReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrBank.Text, strType); ds.Tables.Add(dtblCompany); ds.Tables.Add(dtblCotraReport); // frmreport.MdiParent = formMDI.MDIObj; // frmreport.ContraVoucherReport(ds); } else { MessageBox.Show("No data found", "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("CRT:12" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click to take print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvEmployee.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); EmployeeSP spEmployee = new EmployeeSP(); DataTable dtblEmployee = spEmployee.EmployeeViewAllEmployeeReport(cmbDesigantion.Text, cmbEmployee.Text, cmbStatus.Text); ds.Tables.Add(dtblEmployee); //frmReport frmReportObj = new frmReport(); //frmReportObj.MdiParent = formMDI.MDIObj; // frmReportObj.EmployeeReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("ER9" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click to print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvPayHead.RowCount > 0) { DataSet ds = new DataSet(); PayHeadSP spPayHead = new PayHeadSP(); DataTable dtbl = spPayHead.PayHeadViewAllForPayHeadReport(cmbPayHead.Text, cmbType.Text); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ////frmReport //frmReport = new frmReport(); //frmReport.MdiParent = formMDI.MDIObj; ds.Tables.Add(dtbl); ds.Tables.Add(dtblCompany); // frmreport.PayHeadReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("PHR:7 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to set the financial year date /// </summary> public void FinancialYearDate() { try { //-----For FromDate----// dtpFromDate.MinDate = PublicVariables._dtFromDate; dtpFromDate.MaxDate = PublicVariables._dtToDate; CompanyInfo infoComapany = new CompanyInfo(); CompanySP spCompany = new CompanySP(); infoComapany = spCompany.CompanyView(1); DateTime dtFromDate = infoComapany.CurrentDate; dtpFromDate.Value = dtFromDate; dtpFromDate.Text = dtFromDate.ToString("dd-MMM-yyyy"); dtpFromDate.Value = Convert.ToDateTime(txtFromDate.Text); txtFromDate.Focus(); txtFromDate.SelectAll(); //==============================// //-----For ToDate-----------------// dtpToDate.MinDate = PublicVariables._dtFromDate; dtpToDate.MaxDate = PublicVariables._dtToDate; infoComapany = spCompany.CompanyView(1); DateTime dtToDate = infoComapany.CurrentDate; dtpToDate.Value = dtToDate; dtpToDate.Text = dtToDate.ToString("dd-MMM-yyyy"); dtpToDate.Value = Convert.ToDateTime(txtToDate.Text); txtToDate.Focus(); txtToDate.SelectAll(); //=====================// } catch (Exception ex) { MessageBox.Show("ALREP6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click to print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvDailySalary.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblEmployee = spEmployee.EmployeeViewAllForDailySalaryReport(cmbEmployeeCode.Text, cmbDesignation.Text, Convert.ToDateTime(dtpFromDate.Text.ToString()), Convert.ToDateTime(dtpToDate.Text.ToString()), cmbStatus.Text); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); ds.Tables.Add(dtblEmployee); //frmReport frmReportObj = new frmReport(); //frmReportObj.MdiParent = formMDI.MDIObj; // frmReportObj.DailySalaryReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("DSR9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvDailyAttendanceReport.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); DailyAttendanceMasterSP spDailyAttendanceMaster = new DailyAttendanceMasterSP(); DataTable dtblAttendance = spDailyAttendanceMaster.DailyAttendanceViewForDailyAttendanceReport(dtpDate.Text.Trim(), cmbStatus.Text.Trim(), cmbEmployee.Text.Trim(), cmbDesignation.Text.Trim()); ds.Tables.Add(dtblAttendance); //frmReport frmReportObj = new frmReport(); //frmReportObj.MdiParent = formMDI.MDIObj; // frmReportObj.DailyAttendanceReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("DAR:8" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { DataSet dsSalesOrderReport = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); DataTable dtblDetails = new DataTable(); dtblDetails = dtblSalesOrderReport.Copy(); if (dtblSalesOrderReport.Rows.Count > 0) { dsSalesOrderReport.Tables.Add(dtblCompany); dsSalesOrderReport.Tables.Add(dtblDetails); ////frmReport //frmReport = new frmReport(); //frmReport.MdiParent = formMDI.MDIObj; // frmreport.SalesOrderReportPrinting(dsSalesOrderReport, txtTotalAmount.Text); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("SORP16:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// on "print' button click for print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvServiceReport.RowCount > 0) { DataSet dsServiceVoucherReport = new DataSet(); CompanySP spCompany = new CompanySP(); //frmReport reportobj = new frmReport(); ServiceMasterSP spServiceMaster = new ServiceMasterSP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); DataTable dtblServiceVoucherReport = spServiceMaster.ServiceReport(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbVoucherType.Text, cmbCashOrParty.Text, cmbSalesman.Text); dsServiceVoucherReport.Tables.Add(dtblCompany); dsServiceVoucherReport.Tables.Add(dtblServiceVoucherReport); // frmreport.MdiParent = formMDI.MDIObj; // frmreport.ServiceVoucherReport(dsServiceVoucherReport); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("SVRT 15 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click to print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvSalaryPackage.RowCount > 0) { ////frmReport //frmReport = new frmReport(); DataSet ds = new DataSet(); SalaryPackageSP spSalaryPackage = new SalaryPackageSP(); CompanySP spCompany = new CompanySP(); DataTable dtblSalaryPackage = spSalaryPackage.SalaryPackageViewAllForSalaryPackageReport(cmbPackageName.Text, cmbStatus.Text); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblSalaryPackage); ds.Tables.Add(dtblCompany); //frmReport.MdiParent = formMDI.MDIObj; // frmreport.SalaryPackageReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("SPD:9 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to save the items to database /// </summary> public void SaveFunction() { try { decimal decIdentity = 0; FinancialYearInfo infoFinancialYear = new FinancialYearInfo(); FinancialYearSP spFinancialYear = new FinancialYearSP(); CompanySP spCompany = new CompanySP(); infoFinancialYear.FromDate = Convert.ToDateTime(txtFromDate.Text); infoFinancialYear.ToDate = Convert.ToDateTime(txtToDate.Text); infoFinancialYear.ExtraDate = System.DateTime.Now; infoFinancialYear.Extra1 = string.Empty; infoFinancialYear.Extra2 = string.Empty; decIdentity = spFinancialYear.FinancialYearAddWithReturnIdentity(infoFinancialYear); infoFinancialYear = spFinancialYear.FinancialYearView(decIdentity); PublicVariables._decCurrentFinancialYearId = infoFinancialYear.FinancialYearId; PublicVariables._dtFromDate = infoFinancialYear.FromDate; PublicVariables._dtToDate = infoFinancialYear.ToDate; PublicVariables._dtCurrentDate = infoFinancialYear.FromDate; spCompany.CompanyCurrentDateEdit(PublicVariables._dtCurrentDate); formMDI.MDIObj.ShowCurrentDate(); isSave = true; this.Close(); } catch (Exception ex) { MessageBox.Show("NFY 2 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On print button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { DateTime FromDate = this.dtpFromDate.Value; DateTime ToDate = this.dtpToDate.Value; DataSet ds = new DataSet(); CompanySP spcompany = new CompanySP(); DataTable dtblProduct = dtbl.Copy(); DataTable dtblCompany = spcompany.CompanyViewDataTable(1); if (dgvProductBatch.Rows.Count > 0) { DataTable dtblNew = dtbl.Copy(); ds.Tables.Add(dtblCompany); ds.Tables.Add(dtblProduct); ////frmReport //frmReport = new frmReport(); //frmReport.MdiParent = formMDI.MDIObj; // frmreport.ProductBatchReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show(" PVSBR:9" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvBonusDeductionReport.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); DataTable dtblBonusDeduction = spBonusDeduction.BonusDeductionReportGridFill(dtpFromDate.Text, dtpToDate.Text, dtpSalaryMonth.Text, cmbDesignation.Text, cmbEmployee.Text, strBonusOrDeduction); ds.Tables.Add(dtblBonusDeduction); //frmReport frmReportObj = new frmReport(); //frmReportObj.MdiParent = formMDI.MDIObj; // frmReportObj.BonusDeductionReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("BDR:8" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click for print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvMonthlySalary.Rows.Count > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); MonthlySalarySP spMonthlySalary = new MonthlySalarySP(); DataTable dtblMonthlySalary = spMonthlySalary.MonthlySalryViewAllForMonthlySalaryReports(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), cmbDesignation.Text, cmbEmployeeCode.Text, Convert.ToDateTime(dtpSalaryMonth.Value.ToString())); ds.Tables.Add(dtblMonthlySalary); //frmReport frmReportObj = new frmReport(); // frmReportObj.MdiParent = formMDI.MDIObj; // frmReportObj.MonthlySalaryReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("MSR:9" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Print button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click_1(object sender, EventArgs e) { try { PhysicalStockMasterSP spPhysicalStockMaster = new PhysicalStockMasterSP(); if (dgvPhysicalStockReport.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); //frmReport reportobj = new frmReport(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); DataTable dtblPhysicalStockReport = spPhysicalStockMaster.PhysicalStockReportFill(Convert.ToDateTime(dtpFromDate.Value.ToString()), Convert.ToDateTime(dtpToDate.Value.ToString()), txtVoucherNo.Text.Trim(), txtProductName.Text.Trim(), Convert.ToDecimal(cmbProductCode.SelectedValue), Convert.ToDecimal(cmbVoucherType.SelectedValue)); ds.Tables.Add(dtblCompany); ds.Tables.Add(dtblPhysicalStockReport); // frmreport.MdiParent = formMDI.MDIObj; // frmreport.PhysicalStockReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("PSRT:6" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Start a login /// </summary> public void Login() { try { UserSP spUser = new UserSP(); CompanySP spCompany = new CompanySP(); CompanyInfo infoCompany = new CompanyInfo(); string strUserName = txtUserName.Text.Trim(); string strPassword = spUser.LoginCheck(strUserName); if (strPassword == txtPassword.Text.Trim() && strPassword != string.Empty) { int inUserId = spUser.GetUserIdAfterLogin(strUserName, strPassword); PublicVariables._decCurrentUserId = inUserId; infoCompany = spCompany.CompanyView(1); PublicVariables._decCurrencyId = infoCompany.CurrencyId; formMDI.MDIObj.CallFromLogin(); SettingsCheck(); //for Quock Launch menu formMDI.MDIObj.ShowQuickLaunchMenu(); formMDI.MDIObj.CurrentSettings(); //Display ChangeCurrentDate form// frmChangeCurrentDate frmCurrentDateChangeObj = new frmChangeCurrentDate(); frmCurrentDateChangeObj.MdiParent = formMDI.MDIObj; frmCurrentDateChangeObj.CallFromLogin(this); formMDI.MDIObj.Text = "OpenMiracle " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]"; // For showing the OpenMiracle message from the website formMDI.MDIObj.logoutToolStripMenuItem.Enabled = true; if (PublicVariables.MessageToShow != string.Empty) { frmMessage frmMsg = new frmMessage(); frmMsg.lblHeading.Text = PublicVariables.MessageHeadear; frmMsg.lblMessage.Text = PublicVariables.MessageToShow; frmMsg.MdiParent = formMDI.MDIObj; frmMsg.Show(); frmMsg.Location = new Point(0, formMDI.MDIObj.Height - 270); foreach (Form form in Application.OpenForms) { if (form.GetType() == typeof(frmChangeCurrentDate)) { form.Focus(); } } } } else { Messages.InformationMessage("Invalid username or password"); Clear(); } } catch (Exception ex) { MessageBox.Show("LOGIN02:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void CompanyGridFill() { try { DataTable dtbl = new DataTable(); CompanySP spComapny = new CompanySP(); dtbl = spComapny.CompanyViewAllForSelectCompany(); dgvSelectCompany.DataSource = dtbl; } catch (Exception ex) { MessageBox.Show("SELCMPNY : 1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to Set the from date and todate based on the settings /// </summary> public void FinancialYearDate() { try { dtpFrmDate.MinDate = PublicVariables._dtFromDate; dtpFrmDate.MaxDate = PublicVariables._dtToDate; CompanyInfo infoComapany = new CompanyInfo(); CompanySP spCompany = new CompanySP(); infoComapany = spCompany.CompanyView(1); DateTime dtFromDate = PublicVariables._dtFromDate; dtpFrmDate.Value = dtFromDate; txtFromDate.Text = dtFromDate.ToString("dd-MMM-yyyy"); dtpFrmDate.Value = Convert.ToDateTime(txtFromDate.Text); txtFromDate.Focus(); txtFromDate.SelectAll(); dtpToDate.MinDate = PublicVariables._dtFromDate; dtpToDate.MaxDate = PublicVariables._dtToDate; infoComapany = spCompany.CompanyView(1); DateTime dtToDate = infoComapany.CurrentDate; dtpToDate.Value = dtToDate; txtToDate.Text = dtToDate.ToString("dd-MMM-yyyy"); dtpToDate.Value = Convert.ToDateTime(txtToDate.Text); txtToDate.Focus(); txtToDate.SelectAll(); dtpCheckDateFrom.MinDate = PublicVariables._dtFromDate; dtpCheckDateFrom.MaxDate = PublicVariables._dtToDate; infoComapany = spCompany.CompanyView(1); DateTime dtCheckdateFrom = infoComapany.CurrentDate; dtpCheckDateFrom.Value = dtCheckdateFrom; txtcheckdateFrom.Text = dtCheckdateFrom.ToString("dd-MMM-yyyy"); dtpCheckDateFrom.Value = Convert.ToDateTime(txtcheckdateFrom.Text); txtcheckdateFrom.Focus(); txtcheckdateFrom.SelectAll(); dtpCheckDateTo.MinDate = PublicVariables._dtFromDate; dtpCheckDateTo.MaxDate = PublicVariables._dtToDate; infoComapany = spCompany.CompanyView(1); DateTime dtCheckdateTo = infoComapany.CurrentDate; dtpCheckDateTo.Value = dtCheckdateTo; txtCheckDateTo.Text = dtCheckdateTo.ToString("dd-MMM-yyyy"); dtpCheckDateTo.Value = Convert.ToDateTime(txtCheckDateTo.Text); txtCheckDateTo.Focus(); txtCheckDateTo.SelectAll(); } catch (Exception ex) { MessageBox.Show("PRREP1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// To Display the company name in text box /// </summary> public void txtcompanynamefill() { try { CompanySP spcompany = new CompanySP(); CompanyInfo infoCompany = new CompanyInfo(); infoCompany = spcompany.CompanyView(1); string strCompanyName = infoCompany.CompanyName; txtShowCompanyName.Text = strCompanyName; txtShowCompanyName.ReadOnly = true; } catch (Exception ex) { MessageBox.Show("BS3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On print button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvPriceList.Rows.Count > 0) { //frmReport frmReport = new frmReport(); //frmReport.MdiParent = formMDI.MDIObj; DataTable dtblOption = new DataTable(); dtblOption.Columns.Add("PurchaseRate", typeof(String)); dtblOption.Columns.Add("SalesRate", typeof(String)); dtblOption.Columns.Add("LastSalesRate", typeof(String)); dtblOption.Columns.Add("StandardRate", typeof(String)); dtblOption.Columns.Add("MRP", typeof(String)); dtblOption.Columns.Add("Price", typeof(String)); DataRow dr = dtblOption.NewRow(); dr["PurchaseRate"] = cbxPurchaseRate.Checked?"True":"False"; dr["SalesRate"] = cbxSalesRate.Checked ? "True" : "False"; dr["LastSalesRate"] = cbxlastSalesRate.Checked ? "True" : "False"; dr["StandardRate"] = CbxStandardRate.Checked ? "True" : "False"; dr["MRP"] = cbxMrp.Checked ? "True" : "False"; dr["Price"] = "True"; dtblOption.Rows.Add(dr); DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); PriceListSP spPriceList = new PriceListSP(); DataTable dtblPriceList = spPricingList.PriceListReportPrint(decGroupId, strProductName, decSizeId, decModelId, decPricingLevelId); DataTable dtblCompanyReport = spCompany.CompanyViewDataTable(1); DataTable dtblPriceListGridFill = dtblPriceListReport.Copy(); ds.Tables.Add(dtblCompanyReport); ds.Tables.Add(dtblPriceList); ds.Tables.Add(dtblOption); //frmReport.MdiParent = formMDI.MDIObj; //frmReport.PriceListReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show(" RPL17:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// To set current date /// </summary> public void CurrentDate() { try { dtpCompanyCurrentDate.MinDate = PublicVariables._dtFromDate; dtpCompanyCurrentDate.MaxDate = PublicVariables._dtToDate; CompanyInfo infoComapany = new CompanyInfo(); CompanySP spCompany = new CompanySP(); infoComapany = spCompany.CompanyView(1); DateTime dtCurrentDate = PublicVariables._dtFromDate; if (infoComapany.CurrentDate != null) { dtCurrentDate = infoComapany.CurrentDate; } if (dtCurrentDate > PublicVariables._dtToDate) { dtCurrentDate = PublicVariables._dtToDate; } if (dtCurrentDate < PublicVariables._dtFromDate) { dtCurrentDate = PublicVariables._dtFromDate; } dtpCompanyCurrentDate.Value = dtCurrentDate; PublicVariables._dtCurrentDate = dtCurrentDate; DateTime sysDate = System.DateTime.Today; if (sysDate >= PublicVariables._dtFromDate && sysDate <= PublicVariables._dtToDate) { txtCompanyCurrentdate.Text = sysDate.ToString("dd-MMM-yyyy"); } else { txtCompanyCurrentdate.Text = dtCurrentDate.ToString("dd-MMM-yyyy"); } dtpCompanyCurrentDate.Value = Convert.ToDateTime(txtCompanyCurrentdate.Text); txtCompanyCurrentdate.Focus(); txtCompanyCurrentdate.SelectAll(); } catch (Exception ex) { MessageBox.Show("CCD 3 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to Get the Current Date /// </summary> public void CurrentDate() { try { CompanyInfo infoComapany = new CompanyInfo(); CompanySP spCompany = new CompanySP(); FinancialYearInfo infoFinancialYear = new FinancialYearInfo(); FinancialYearSP spFinancialYear = new FinancialYearSP(); infoComapany = spCompany.CompanyView(1); PublicVariables._dtCurrentDate = infoComapany.CurrentDate; infoFinancialYear = spFinancialYear.FinancialYearView(1); PublicVariables._dtFromDate = infoFinancialYear.FromDate; PublicVariables._dtToDate = infoFinancialYear.ToDate; } catch (Exception ex) { MessageBox.Show("SELCMPNY :2 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// ON 'Print' button click to take print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvMonthlyAttendance.Rows.Count > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); DataTable dtblMonthlyAttendance = new DataTable(); dtblMonthlyAttendance.Columns.Add("SlNo", typeof(Int32)); dtblMonthlyAttendance.Columns.Add("employeeCode", typeof(string)); dtblMonthlyAttendance.Columns.Add("employeeName", typeof(string)); dtblMonthlyAttendance.Columns.Add("Present", typeof(string)); dtblMonthlyAttendance.Columns.Add("Absent", typeof(string)); foreach (DataGridViewRow dgvrow in dgvMonthlyAttendance.Rows) { dtblMonthlyAttendance.Rows.Add(); dtblMonthlyAttendance.Rows[dgvrow.Index]["SlNo"] = dgvrow.Cells["SlNo"].Value; dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeCode"] = dgvrow.Cells["employeeCode"].Value; dtblMonthlyAttendance.Rows[dgvrow.Index]["employeeName"] = dgvrow.Cells["employeeName"].Value; dtblMonthlyAttendance.Rows[dgvrow.Index]["Present"] = dgvrow.Cells["Present"].Value; dtblMonthlyAttendance.Rows[dgvrow.Index]["Absent"] = dgvrow.Cells["Absent"].Value; } ds.Tables.Add(dtblMonthlyAttendance); //frmReport frmReportObj = new frmReport(); //frmReportObj.MdiParent = formMDI.MDIObj; // frmReportObj.MonthlyAttendancePrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("MAR15 " + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Changing company's financial year /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSelect_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Are you sure you want to change the financial year?", "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FinancialYearInfo infoFinancialYear = new FinancialYearInfo(); FinancialYearSP spFinancialYear = new FinancialYearSP(); decimal decFinacialId = Convert.ToDecimal(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtfinancialYearId"].Value); DateTime dtmFromDate = Convert.ToDateTime(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtFromDate"].Value); DateTime dtmToDate = Convert.ToDateTime(dgvChangeFinancialYear.CurrentRow.Cells["dgvtxtToDate"].Value); PublicVariables._decCurrentFinancialYearId = decFinacialId; PublicVariables._dtFromDate = dtmFromDate; PublicVariables._dtToDate = dtmToDate; DateTime dtGetCurrentdate = DateTime.Now; CompanySP spCompany = new CompanySP(); spCompany.CompanyCurrentDateEdit(dtmFromDate); if (dtGetCurrentdate < dtmFromDate) { PublicVariables._dtCurrentDate = dtmFromDate; spCompany.CompanyCurrentDateEdit(dtmFromDate); formMDI.MDIObj.ShowCurrentDate(); } else { PublicVariables._dtCurrentDate = dtGetCurrentdate; spCompany.CompanyCurrentDateEdit(dtmFromDate); formMDI.MDIObj.ShowCurrentDate(); } CompanyInfo infoCompany = new CompanyInfo(); infoCompany = spCompany.CompanyView(1); formMDI.MDIObj.Text = "OpenMiracle " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]"; this.Close(); } } catch (Exception ex) { MessageBox.Show("CHGFINYR:5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Save button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { try { if (txtCompanyCurrentdate.Text == string.Empty) { Messages.InformationMessage("Select a date in between financial year"); txtCompanyCurrentdate.Focus(); } else { PublicVariables._dtCurrentDate = Convert.ToDateTime(txtCompanyCurrentdate.Text); CompanySP spCompany = new CompanySP(); spCompany.CompanyCurrentDateEdit(Convert.ToDateTime(txtCompanyCurrentdate.Text)); if (frmCompanyCreationObj != null) { if ((MessageBox.Show("Saved successfully...Do you want to save settings now? ", "Open Miracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) == DialogResult.Yes) { frmSettings frmSettingsObj = new frmSettings(); frmSettingsObj.MdiParent = formMDI.MDIObj; frmSettingsObj.CallFromChangeCurrentDate(frmCompanyCreationObj); } } this.Close(); if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmShortExpiry", "View") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmStock", "View") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmOverdueSalesOrder", "View") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmOverduePurchaseOrder", "View") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Delete Item") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Update") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Save")) { ShowReminderIfAny(); } } } catch (Exception ex) { MessageBox.Show("CCD 11 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to print partyaddress book /// </summary> public void Print() { try { if (dvgPartyAddressBook.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); //frmReport reportobj = new frmReport(); AccountLedgerSP spAccountLedger = new AccountLedgerSP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); DataTable dtbl = spAccountLedger.PartyAddressBookPrint(cmbAccountGroup.Text, txtMobile.Text, txtPhone.Text, txtEmail.Text, txtLedgerName.Text); ds.Tables.Add(dtblCompany); ds.Tables.Add(dtbl); // frmreport.MdiParent = formMDI.MDIObj; // frmreport.PartyAddressBookPrint(ds); } } catch (Exception ex) { MessageBox.Show("PAB:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click to Print /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvSalaryPackageDetails.RowCount > 0) { DataTable dtblOther = new DataTable(); ////frmReport //frmReport = new frmReport(); DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); SalaryPackageDetailsSP spSalaryPackageDetails = new SalaryPackageDetailsSP(); DataTable dtbl = spSalaryPackageDetails.SalaryPackageDetailsForSalaryPackageDetailsReport(cmbSalaryPackage.Text); ds.Tables.Add(dtblCompany); ds.Tables.Add(dtbl); ds.Tables.Add(dtblOther); DataColumn dc = new DataColumn("Addition", typeof(decimal)); dtblOther.Columns.Add(dc); dc = new DataColumn("Deduction", typeof(decimal)); dtblOther.Columns.Add(dc); DataRow dr = dtblOther.NewRow(); dr[0] = decCountAdditon; dr[1] = decCountDeduction; dtblOther.Rows.InsertAt(dr, 0); //frmReport.MdiParent = formMDI.MDIObj; // frmreport.SalaryPackageDetailsReport(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("SPDR:7" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to execute query from RichTextBox to company path /// </summary> /// <param name="txt"></param> /// <returns></returns> public bool ExecuteQueries(RichTextBox txt) { decimal decCompanyIdForTemp = PublicVariables._decCurrentCompanyId; bool iscontinue = true; try { if (cbUpdation.SelectedItems.Count == 0) { MessageBox.Show("Select DB to execute", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); cbUpdation.Focus(); } else { foreach (System.Data.DataRowView p in cbUpdation.CheckedItems) { PublicVariables._decCurrentCompanyId = Convert.ToDecimal(p[0].ToString()); PathForExecuter = p[2].ToString(); CompanySP SpcompanyForExecuter = new CompanySP(); if (File.Exists(PathForExecuter + "\\DBOpenMiracle.mdf")) { string error = SpcompanyForExecuter.StoredProcedureInserter(txtNarration.Text.Trim()); if (error.Trim() != string.Empty) { if (MessageBox.Show(PathForExecuter + " :\n" + error + "\n Continue?", "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { iscontinue = true; } else { iscontinue = false; } if (failed == string.Empty) { failed = PathForExecuter; } else { failed = failed + " , " + PathForExecuter; } } else { if (success == "") { success = PathForExecuter; } else { success = success + " , " + PathForExecuter; } } } else { if (MessageBox.Show("DB does not exist in " + PathForExecuter + "\n Continue?", "OpenMiracle", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { iscontinue = true; } else { iscontinue = false; } if (failed == string.Empty) { failed = PathForExecuter; } else { failed = failed + " , " + PathForExecuter; } } if (!iscontinue) { break; } } } PublicVariables._decCurrentCompanyId = decCompanyIdForTemp; } catch (Exception ex) { MessageBox.Show("SPIns:2" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(iscontinue); }