/// <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)
     {
         formMDI.infoError.ErrorString = "BDR:8" + ex.Message;
     }
 }
Beispiel #2
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "PHR:7 " + ex.Message;
     }
 }
Beispiel #3
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "SORP16:" + ex.Message;
     }
 }
 /// <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 (dgvEmployeeAddressBook.Rows.Count > 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.EmployeeViewAllForEmployeeAddressBook(cmbEmployeeCode.Text, txtMobile.Text, txtPhone.Text, txtEmail.Text);
             ds.Tables.Add(dtblEmployee);
             frmReport frmReportObj = new frmReport();
             frmReportObj.MdiParent = formMDI.MDIObj;
             frmReportObj.EmployeeAddressBookPrinting(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "EMP-AB8 " + ex.Message;
     }
 }
Beispiel #5
0
 /// <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);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.ServiceVoucherReport(dsServiceVoucherReport);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SVRT15:" + ex.Message;
     }
 }
 /// <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)
     {
         formMDI.infoError.ErrorString = "DAR:8" + ex.Message;
     }
 }
 /// <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)
     {
         formMDI.infoError.ErrorString = "SPR:9 " + ex.Message;
     }
 }
Beispiel #8
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "PRRT13:" + ex.Message;
     }
 }
Beispiel #9
0
 /// <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);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.ContraVoucherReport(ds);
         }
         else
         {
             MessageBox.Show("No data found", "Oneaccount", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CRT12:" + ex.Message;
     }
 }
Beispiel #10
0
 /// <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);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.PhysicalStockReport(ds);
         }
         else
         {
             Messages.InformationMessage("No data found");
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PSRT6:" + ex.Message;
     }
 }
Beispiel #11
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "APR:8 " + ex.Message;
     }
 }
Beispiel #12
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "DSR9" + ex.Message;
     }
 }
Beispiel #13
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "PVSBR9:" + ex.Message;
     }
 }
Beispiel #14
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "ER9 " + ex.Message;
     }
 }
Beispiel #15
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "NFY 2 : " + ex.Message;
     }
 }
 /// <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)
     {
         formMDI.infoError.ErrorString = "MSR:9" + ex.Message;
     }
 }
Beispiel #17
0
 /// <summary>
 /// To set the from date and todate in the curresponding feilds
 /// </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;
         dtpFromDate.Text  = dtFromDate.ToString("dd-MMM-yyyy");
         dtpFromDate.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;
         dtpToDate.Text  = dtToDate.ToString("dd-MMM-yyyy");
         dtpToDate.Value = Convert.ToDateTime(txtToDate.Text);
         txtToDate.Focus();
         txtToDate.SelectAll();
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "DRNTREP4:" + ex.Message;
     }
 }
Beispiel #18
0
        /// <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 = "Oneaccount " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]";
                    // For showing the Oneaccount 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
                {
                    lblError.Visible = true;
                    Clear();
                }
            }
            catch (Exception ex)
            {
                formMDI.infoError.ErrorString = "LOGIN1:" + ex.Message;
            }
        }
Beispiel #19
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "SELCMPNY : 1" + ex.Message;
     }
 }
Beispiel #20
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "BS3:" + ex.Message;
     }
 }
Beispiel #21
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "RPL17:" + ex.Message;
     }
 }
Beispiel #22
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "CCD 3 : " + ex.Message;
     }
 }
Beispiel #23
0
        /// <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)
            {
                formMDI.infoError.ErrorString = "SELCMPNY : 2" + ex.Message;
            }
        }
 /// <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)
     {
         formMDI.infoError.ErrorString = "MAR15 " + ex.Message;
     }
 }
Beispiel #25
0
 /// <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?", "Oneaccount", 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 = "Oneaccount " + infoCompany.CompanyName + " [ " + PublicVariables._dtFromDate.ToString("dd-MMM-yyyy") + " To " + PublicVariables._dtToDate.ToString("dd-MMM-yyyy") + " ]";
             this.Close();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CHGFINYR:5" + ex.Message;
     }
 }
Beispiel #26
0
        /// <summary>
        /// Function for Start the thread
        /// </summary>
        private void threadStart()
        {
            try
            {
                CompanySP   spCompany   = new CompanySP();
                CompanyInfo infoCompany = new CompanyInfo();
                try
                {
                    infoCompany = spCompany.CompanyView(1);
                }
                catch (Exception)
                { }


                MailMessage mailMsg = new MailMessage();
                mailMsg.From        = "";
                mailMsg.To          = "";
                mailMsg.Subject     = "Oneaccount MsSql Error!" + " Version : " + Application.ProductVersion;
                mailMsg.BodyFormat  = MailFormat.Text;
                mailMsg.Body        = infoCompany.EmailId + " - " + txtError.Text;
                mailMsg.Priority    = MailPriority.High;
                SmtpMail.SmtpServer = "smtp.gmail.com";//smtp is :smtp.gmail.com
                // SmtpMail.SmtpServer = "plus.smtp.mail.yahoo.com";//smtp is :smtp.yahoo.com
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "");
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "");
                // - smtp.gmail.com use port 465 or 587
                // - plus.smtp.mail.yahoo.com use port 465 or 587
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");
                mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");
                SmtpMail.Send(mailMsg);
                Cursor.Current = Cursors.Default;

                this.Invoke(new MethodInvoker(delegate { this.Close(); }));
            }
            catch
            {
            }
        }
Beispiel #27
0
 /// <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? ", "Oneaccount", 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") || CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Update") ||
                 CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmPersonalReminder", "Save"))
             {
                 ShowReminderIfAny();
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CCD 11 : " + ex.Message;
     }
 }
Beispiel #28
0
 /// <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);
             reportobj.MdiParent = formMDI.MDIObj;
             reportobj.PartyAddressBookPrint(ds);
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PAB3:" + ex.Message;
     }
 }
Beispiel #29
0
 /// <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)
     {
         formMDI.infoError.ErrorString = "SPDR:7" + ex.Message;
     }
 }
Beispiel #30
0
 /// <summary>
 /// On print button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         frmReport crptReport  = new frmReport();
         DataSet   ds          = new DataSet();
         DataTable dtblFormat2 = new DataTable();
         DataTable dtblTotal   = new DataTable();
         CompanySP spCompany   = new CompanySP();
         DataTable dtblCompany = new DataTable();
         dtblCompany = spCompany.CompanyViewAll();
         if (dgvVatreturn.Rows.Count > 0)
         {
             if (dtblFill.Rows.Count > 0)
             {
                 DataTable dtblReportFill = new DataTable();
                 dtblReportFill.Columns.Add("SlNO");
                 dtblReportFill.Columns.Add("Invoice No");
                 dtblReportFill.Columns.Add("Date");
                 dtblReportFill.Columns.Add("Party Name");
                 dtblReportFill.Columns.Add("Mailing Name");
                 dtblReportFill.Columns.Add("Tin No");
                 dtblReportFill.Columns.Add("qt");
                 dtblReportFill.Columns.Add("Sales Amound");
                 dtblReportFill.Columns.Add("Tax Amount");
                 dtblReportFill.Columns.Add("Cess");
                 dtblReportFill.Columns.Add("Net Amount");
                 dtblReportFill.Columns.Add("billDiscount");
                 dtblReportFill.Columns.Add("grandtotal");
                 for (int i = 0; i < dgvVatreturn.Rows.Count; i++)
                 {
                     DataRow drow = dtblReportFill.NewRow();
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value != null)
                     {
                         drow["SlNO"] = dgvVatreturn.Rows[i].Cells["dgvtxtSlno"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value != null)
                     {
                         drow["Invoice No"] = dgvVatreturn.Rows[i].Cells["dgvtxtInvoiceNo"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value != null)
                     {
                         drow["Date"] = dgvVatreturn.Rows[i].Cells["dgvtxtDate"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value != null)
                     {
                         drow["Party Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtPartyName"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString() != string.Empty)
                     {
                         drow["Mailing Name"] = dgvVatreturn.Rows[i].Cells["dgvtxtMailingName"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value != null)
                     {
                         drow["Tin No"] = dgvVatreturn.Rows[i].Cells["dgvtxtTinNo"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value != null)
                     {
                         drow["qt"] = dgvVatreturn.Rows[i].Cells["dgvtxtQty"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value != null)
                     {
                         drow["Sales Amound"] = dgvVatreturn.Rows[i].Cells["dgvtxtSalesAmount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value != null)
                     {
                         drow["Tax Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtTaxAmount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value != null)
                     {
                         drow["Cess"] = dgvVatreturn.Rows[i].Cells["dgvtxtCess"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value != null)
                     {
                         drow["Net Amount"] = dgvVatreturn.Rows[i].Cells["dgvtxtNetAmount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value != null)
                     {
                         drow["billDiscount"] = dgvVatreturn.Rows[i].Cells["dgvtxtbillDiscount"].Value.ToString();
                     }
                     if (dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value != null)
                     {
                         drow["grandtotal"] = dgvVatreturn.Rows[i].Cells["dgvtxtGrandTotal"].Value.ToString();
                     }
                     dtblReportFill.Rows.Add(drow);
                 }
                 ds.Tables.Add(dtblReportFill);
                 ds.Tables.Add(dtblCompany);
                 crptReport.vatreturnReport(ds);
             }
             else
             {
                 VoucherTypeSP spVoucher = new VoucherTypeSP();
                 dtblFormat2 = spVoucher.VatGridFill(DateTime.Parse(dtpFrmDate.Text), DateTime.Parse(dtpToDate.Text), cmbTypeofVoucher.Text, Convert.ToDecimal(cmbVouchertype.SelectedValue.ToString()), strformat, cmbTax.Text);
                 if (dgvVatreturn.Rows.Count > 1)
                 {
                     dtblTotal.Columns.Add("taxableamt");
                     dtblTotal.Columns.Add("taxAmount");
                     DataRow dr1 = dtblTotal.NewRow();
                     dr1["taxableamt"] = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxtTaxableAmount"].Value.ToString();
                     dr1["taxAmount"]  = dgvVatreturn.Rows[dgvVatreturn.Rows.Count - 2].Cells["dgvtxttax"].Value.ToString();
                     dtblTotal.Rows.Add(dr1);
                     ds.Tables.Add(dtblCompany);
                     ds.Tables.Add(dtblFormat2);
                     ds.Tables.Add(dtblTotal);
                     crptReport.vatreturnReportFormat(ds);
                 }
             }
         }
         else
         {
             MessageBox.Show("No data found", "Oneaccount", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "VRR15:" + ex.Message;
     }
 }