Exemple #1
0
 /// <summary>
 /// Save Or Edit Function
 /// </summary>
 public void SaveOrEdit()
 {
     try
     {
         bool isOk = true;
         if (cbxShowCompanyNAmeAs.Checked && txtShowCompanyName.Text.Trim() == string.Empty)
         {
             MessageBox.Show("Enter company code", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtShowCompanyName.Focus();
             isOk = false;
         }
         else if ((cbxShowPurchaseRate.Checked && CheckGroupBox()) || (!cbxShowPurchaseRate.Checked))
         {
             if (PublicVariables.isMessageAdd)
             {
                 if (Messages.SaveMessage())
                 {
                     isOk = true;
                 }
                 else
                 {
                     isOk = false;
                 }
             }
             if (isOk)
             {
                 BarcodeSettingsInfo InfoSettings = new BarcodeSettingsInfo();
                 InfoSettings.ShowMRP          = cbxShowMrp.Checked;
                 InfoSettings.ShowProductCode  = rbtnShowProductCode.Checked;
                 InfoSettings.ShowCompanyName  = cbxShowCompanyNAmeAs.Checked;
                 InfoSettings.ShowPurchaseRate = cbxShowPurchaseRate.Checked;
                 InfoSettings.CompanyName      = txtShowCompanyName.Text.Trim();
                 InfoSettings.Zero             = txtZero.Text.Trim();
                 InfoSettings.One    = txtOne.Text.Trim();
                 InfoSettings.Two    = txtTwo.Text.Trim();
                 InfoSettings.Three  = txtThree.Text.Trim();
                 InfoSettings.Four   = txtFour.Text.Trim();
                 InfoSettings.Five   = txtFive.Text.Trim();
                 InfoSettings.Six    = txtSix.Text.Trim();
                 InfoSettings.Seven  = txtSeven.Text.Trim();
                 InfoSettings.Eight  = txtEight.Text.Trim();
                 InfoSettings.Nine   = txtNine.Text.Trim();
                 InfoSettings.Point  = txtPoint.Text.Trim();
                 InfoSettings.Extra1 = string.Empty;
                 InfoSettings.Extra2 = string.Empty;
                 BarcodeSettingsBll Bllbarcodesetting = new BarcodeSettingsBll();
                 Bllbarcodesetting.BarcodeSettingsAdd(InfoSettings);
                 Messages.SavedMessage();
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("BS5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #2
0
 /// <summary>
 /// Function to check the Barcode settings
 /// </summary>
 public void BarcodeSettingsViewAll()
 {
     try
     {
         BarcodeSettingsBll Bllbarcodesetting = new BarcodeSettingsBll();
         List <DataTable>   listObj           = new List <DataTable>();
         listObj = Bllbarcodesetting.BarcodeSettingsViewAll();
         foreach (DataRow dr in listObj[0].Rows)
         {
             if (dr["showMRP"].ToString() == "True")
             {
                 cbxShowMrp.Checked = true;
             }
             else
             {
                 cbxShowMrp.Checked = false;
             }
             if (dr["showPurchaseRate"].ToString() == "True")
             {
                 cbxShowPurchaseRate.Checked = true;
             }
             else
             {
                 cbxShowPurchaseRate.Checked = false;
             }
             if (dr["showCompanyName"].ToString() == "True")
             {
                 cbxShowCompanyNAmeAs.Checked = true;
             }
             else
             {
                 cbxShowCompanyNAmeAs.Checked = false;
             }
             if (dr["showProductCode"].ToString() == "True")
             {
                 rbtnShowProductCode.Checked = true;
             }
             else
             {
                 rbtnShowProductName.Checked = true;
             }
             txtShowCompanyName.Text = dr["companyName"].ToString();
             if (cbxShowPurchaseRate.Checked == true)
             {
                 txtEight.Text = dr["eight"].ToString();
                 txtFive.Text  = dr["five"].ToString();
                 txtFour.Text  = dr["four"].ToString();
                 txtNine.Text  = dr["nine"].ToString();
                 txtOne.Text   = dr["one"].ToString();
                 txtPoint.Text = dr["point"].ToString();
                 txtSeven.Text = dr["seven"].ToString();
                 txtSix.Text   = dr["six"].ToString();
                 txtThree.Text = dr["three"].ToString();
                 txtTwo.Text   = dr["two"].ToString();
                 txtZero.Text  = dr["zero"].ToString();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("BS6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #3
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);
     }
 }