/// <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();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.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      = bllCompanyCreation.CompanyView(1);
         DateTime dtToDate = infoComapany.CurrentDate;
         dtpTodate.Value      = dtToDate;
         txtToDate.Text       = dtToDate.ToString("dd-MMM-yyyy");
         dtpTodate.Value      = Convert.ToDateTime(txtToDate.Text);
         dtpCheckdate.MinDate = PublicVariables._dtFromDate;
         dtpCheckdate.MaxDate = PublicVariables._dtToDate;
         infoComapany         = bllCompanyCreation.CompanyView(1);
         DateTime dtCheckDate = infoComapany.CurrentDate;
         dtpCheckdate.Value = dtCheckDate;
         txtCheckDate.Text  = dtToDate.ToString("dd-MMM-yyyy");
         dtpCheckdate.Value = Convert.ToDateTime(txtCheckDate.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show("PCREG5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to set 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();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.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      = bllCompanyCreation.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("AGR:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #3
0
        /// <summary>
        /// Start a login
        /// </summary>
        public void Login()

        {
            try
            {
                UserBll            bllUser            = new UserBll();
                CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
                CompanyInfo        infoCompany        = new CompanyInfo();
                string             strUserName        = txtUserName.Text.Trim();
                string             strPassword        = bllUser.LoginCheck(strUserName);
                if (strPassword == txtPassword.Text.Trim() && strPassword != string.Empty)
                {
                    int inUserId = bllUser.GetUserIdAfterLogin(strUserName, strPassword);
                    PublicVariables._decCurrentUserId = inUserId;
                    infoCompany = bllCompanyCreation.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);
            }
        }
예제 #4
0
 /// <summary>
 /// To Display the company name in text box
 /// </summary>
 public void txtcompanynamefill()
 {
     try
     {
         //CompanySP spcompany = new CompanySP();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         CompanyInfo        infoCompany        = new CompanyInfo();
         infoCompany = bllCompanyCreation.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);
     }
 }
예제 #5
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();
         CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
         infoComapany = bllCompanyCreation.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>
 /// 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();
             FinancialYearBll  bllFinancialYear  = new FinancialYearBll();
             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();
             CompanyCreationBll bllCompanyCreation = new CompanyCreationBll();
             bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
             if (dtGetCurrentdate < dtmFromDate)
             {
                 PublicVariables._dtCurrentDate = dtmFromDate;
                 bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
                 formMDI.MDIObj.ShowCurrentDate();
             }
             else
             {
                 PublicVariables._dtCurrentDate = dtGetCurrentdate;
                 bllCompanyCreation.CompanyCurrentDateEdit(dtmFromDate);
                 formMDI.MDIObj.ShowCurrentDate();
             }
             CompanyInfo infoCompany = new CompanyInfo();
             infoCompany         = bllCompanyCreation.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);
     }
 }
예제 #7
0
        /// <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);
            }
        }
예제 #8
0
 /// <summary>
 /// Setting the check box Status
 /// </summary>
 public void FillSettings()
 {
     try
     {
         BarcodeSettingsInfo Info = new BarcodeSettingsBll().BarcodeSettingsView(1);
         if (Info.ShowMRP == true)
         {
             cbxShowMrp.Checked = true;
         }
         else
         {
             cbxShowMrp.Checked = false;
         }
         if (Info.ShowProductCode == true)
         {
             rbtnShowProductCode.Checked = true;
         }
         else
         {
             rbtnShowProductName.Checked = true;
         }
         if (Info.ShowCompanyName == true)
         {
             cbxShowCompanyNAmeAs.Checked = true;
         }
         else
         {
             cbxShowCompanyNAmeAs.Checked = false;
         }
         if (Info.ShowPurchaseRate == true)
         {
             cbxShowPurchaseRate.Checked = true;
         }
         else
         {
             cbxShowPurchaseRate.Checked = false;
         }
         txtShowCompanyName.Text = Info.CompanyName;
         if (txtShowCompanyName.Text == string.Empty)
         {
             CompanyInfo InfoCompany = new CompanyInfo();
             //CompanySP Sp = new CompanySP();
             CompanyCreationBll Bll = new CompanyCreationBll();
             InfoCompany             = Bll.CompanyView(1);
             txtShowCompanyName.Text = InfoCompany.CompanyName;
         }
         txtZero.Text  = Info.Zero;
         txtOne.Text   = Info.One;
         txtTwo.Text   = Info.Two;
         txtThree.Text = Info.Three;
         txtFour.Text  = Info.Four;
         txtFive.Text  = Info.Five;
         txtSix.Text   = Info.Six;
         txtSeven.Text = Info.Seven;
         txtEight.Text = Info.Eight;
         txtNine.Text  = Info.Nine;
         txtPoint.Text = Info.Point;
     }
     catch (Exception ex)
     {
         MessageBox.Show("BS4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }