Пример #1
0
 /// <summary>
 /// Form closing event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmNewFinancialYear_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (frmCompanyCreationObj != null)
         {
             if (isSave)
             {
                 frmChangeCurrentDate frmChangeCurrenttDateObj = new frmChangeCurrentDate();
                 frmChangeCurrenttDateObj.MdiParent = formMDI.MDIObj;
                 frmCompanyCreation CompanyCreationObj = new frmCompanyCreation();
                 CompanyCreationObj    = frmCompanyCreationObj;
                 frmCompanyCreationObj = null;
                 frmChangeCurrenttDateObj.CallFromNewFinancialYear(CompanyCreationObj);
             }
             else
             {
                 e.Cancel = true;
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "NFY 13 : " + ex.Message;
     }
 }
Пример #2
0
 /// <summary>
 /// Function to call this form from frmCompanyCreation to view details and for updation
 /// </summary>
 /// <param name="frmCompanyCreation"></param>
 public void CallFromCompanyCreation(frmCompanyCreation frmCompanyCreation)
 {
     try
     {
         frmCompanyCreationObj = frmCompanyCreation;
         base.Show();
         frmCompanyCreationObj = frmCompanyCreation;
         btnClose.Enabled      = false;
         isSave = false;
         dtpFromDate.Enabled = true;
         txtFromDate.Enabled = true;
         DateTime dtFromDate = dtpFromDate.Value;
         DateTime dtToDate   = dtpToDate.Value;
         //dtpFromDate.MinDate = dtFromDate;
         //dtpFromDate.MaxDate = dtToDate;
         //dtpToDate.MinDate = dtFromDate;
         //dtpToDate.MaxDate = dtToDate;
         txtFromDate.Text  = dtFromDate.ToString("dd-MMM-yyyy");
         dtpFromDate.Value = Convert.ToDateTime(txtFromDate.Text);
         txtToDate.Text    = dtToDate.ToString("dd-MMM-yyyy");
         dtpToDate.Value   = Convert.ToDateTime(txtToDate.Text);
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "NFY 4 : " + ex.Message;
     }
 }
Пример #3
0
 /// <summary>
 /// Function to call this form from frmCompanyCreation to view details and for updation
 /// </summary>
 /// <param name="frmCompanyCreation"></param>
 public void CallFromNewFinancialYear(frmCompanyCreation frmCompanyCreation)
 {
     try
     {
         frmCompanyCreationObj = frmCompanyCreation;
         base.Show();
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CCD 5: " + ex.Message;
     }
 }
Пример #4
0
 /// <summary>
 /// On FormClosing opens the form from which frmCurrencyDetails form has opened
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmCurrencyDetails_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         if (frmExchangeRateObj != null)
         {
             frmExchangeRateObj = Application.OpenForms["frmExchangeRate"] as frmExchangeRate;
             if (frmExchangeRateObj == null)
             {
                 frmExchangeRateObj           = new frmExchangeRate();
                 frmExchangeRateObj.MdiParent = formMDI.MDIObj;
                 frmExchangeRateObj.Show();
             }
             else
             {
                 frmExchangeRateObj.Activate();
             }
         }
         if (frmCompanyCreationObj != null)
         {
             frmCompanyCreationObj = Application.OpenForms["frmCompanyCreation"] as frmCompanyCreation;
             if (frmCompanyCreationObj == null)
             {
                 frmCompanyCreationObj           = new frmCompanyCreation();
                 frmCompanyCreationObj.MdiParent = formMDI.MDIObj;
                 frmCompanyCreationObj.Show();
             }
             else
             {
                 frmCompanyCreationObj.Activate();
             }
         }
         if (frmJournalVoucherObj != null)
         {
             frmJournalVoucherObj.Enabled = true;
         }
         if (frmDebitNoteObj != null)
         {
             frmDebitNoteObj.Enabled = true;
         }
         if (frmCreditNoteObj != null)
         {
             frmCreditNoteObj.Enabled = true;
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CDP14:" + ex.Message;
     }
 }
Пример #5
0
 /// <summary>
 /// Function to call this form from frmCompanyCreation
 /// </summary>
 /// <param name="frmCompanyCreation"></param>
 /// <param name="decId"></param>
 public void CallFromCmpany(frmCompanyCreation frmCompanyCreation, decimal decId)
 {
     try
     {
         base.Show();
         this.frmCompanyCreationObj = frmCompanyCreation;
         int inRowCount = dgvCurrency.Rows.Count;
         for (int i = 0; i < inRowCount; i++)
         {
             if (Convert.ToDecimal(dgvCurrency.Rows[i].Cells["dgvtxtCurrencyId"].Value.ToString()) == decId)
             {
                 dgvCurrency.Rows[i].DefaultCellStyle.BackColor = Color.MediumSeaGreen;
             }
         }
         txtCurrencyName.Focus();
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CDP4:" + ex.Message;
     }
 }