/// <summary>
 /// Function to save the items to database
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         decimal decIdentity = 0;
         FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
         FinancialYearBll bllFinancialYear = new FinancialYearBll();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         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 = bllFinancialYear.FinancialYearAddWithReturnIdentity(infoFinancialYear);
         infoFinancialYear = bllFinancialYear.FinancialYearView(decIdentity);
         PublicVariables._decCurrentFinancialYearId = infoFinancialYear.FinancialYearId;
         PublicVariables._dtFromDate = infoFinancialYear.FromDate;
         PublicVariables._dtToDate = infoFinancialYear.ToDate;
         PublicVariables._dtCurrentDate = infoFinancialYear.FromDate;
         bllCompanyCreation.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>
 /// Function to get the current Date
 /// </summary>
 public void CurrentDate()
 {
     try
     {
         CompanyInfo infoComapany = new CompanyInfo();
         //CompanySP spCompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
         FinancialYearBll bllFinancialYear = new FinancialYearBll();
         infoComapany = bllCompanyCreation.CompanyView(1);
         PublicVariables._dtCurrentDate = infoComapany.CurrentDate;
         infoFinancialYear = bllFinancialYear.FinancialYearView(1);
         PublicVariables._dtFromDate = infoFinancialYear.FromDate;
         PublicVariables._dtToDate = infoFinancialYear.ToDate;
         dateToolStripMenuItem.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy");
     }
     catch (Exception ex)
     {
         MessageBox.Show("MDI 2 : " + 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();
                CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                FinancialYearInfo infoFinancialYear = new FinancialYearInfo();
                FinancialYearBll bllFinancialYear = new FinancialYearBll();

                infoComapany = bllCompanyCreation.CompanyView(1);
                PublicVariables._dtCurrentDate = infoComapany.CurrentDate;
                infoFinancialYear = bllFinancialYear.FinancialYearView(1);
                PublicVariables._dtFromDate = infoFinancialYear.FromDate;
                PublicVariables._dtToDate = infoFinancialYear.ToDate;

            }
            catch (Exception ex)
            {
                MessageBox.Show("SELCMPNY :2 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }