コード例 #1
0
 /// <summary>
 /// Save button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, this.Name, btnSave.Text))
         {
             if (dgvBankReconciliation.RowCount > 0)
             {
                 if (PublicVariables.isMessageAdd)
                 {
                     if (Messages.SaveMessage())
                     {
                         saveOrEdit();
                         FindTotal();
                         Messages.SavedMessage();
                     }
                 }
             }
             else
             {
                 Messages.InformationMessage("No row to save");
             }
             clear();
         }
         else
         {
             Messages.NoPrivillageMessage();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("BR:14" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #2
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         BrandSP   spBrand   = new BrandSP();
         BrandInfo infoBrand = new BrandInfo();
         infoBrand.BrandName    = txtBrandName.Text.Trim();
         infoBrand.Narration    = txtNarration.Text.Trim();;
         infoBrand.Manufacturer = txtManufacturer.Text.Trim();
         infoBrand.ExtraDate    = DateTime.Now;
         infoBrand.Extra1       = string.Empty;
         infoBrand.Extra2       = string.Empty;
         if (spBrand.BrandCheckIfExist(txtBrandName.Text.Trim(), 0) == false)
         {
             decIdentity = spBrand.BrandAdd(infoBrand);
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage("Brand name already exist");
             txtBrandName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("BR2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #3
0
ファイル: frmSize.cs プロジェクト: salmanmushtaq/openmiracle
 /// <summary>
 /// Save Function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         SizeSP   spSize   = new SizeSP();
         SizeInfo infoSize = new SizeInfo();
         infoSize.Size      = txtSize.Text.Trim();
         infoSize.Narration = txtNarration.Text.Trim();
         infoSize.Extra1    = String.Empty;
         infoSize.Extra2    = String.Empty;
         if (spSize.SizeNameCheckExistence(txtSize.Text.Trim().ToString(), 0) == false)
         {
             decIdentity = spSize.SizeAdding(infoSize);
             if (decIdentity > 0)
             {
                 Messages.SavedMessage();
                 GridFill();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage(" Size already exist");
             txtSize.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SZ2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #4
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         GodownInfo infoGodown = new GodownInfo();
         GodownBll  BllGodown  = new GodownBll();
         infoGodown.GodownName = txtGodownName.Text.Trim();
         infoGodown.Narration  = txtNarration.Text.Trim();
         infoGodown.Extra1     = string.Empty;
         infoGodown.Extra2     = string.Empty;
         if (BllGodown.GodownCheckIfExist(txtGodownName.Text.Trim(), 0) == false)
         {
             decIdForOtherForms = BllGodown.GodownAddWithoutSameName(infoGodown);
             RackAddCurrespondingtoGodown();
             if (decIdForOtherForms > 0)
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Godown name already exist");
             txtGodownName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("G4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #5
0
ファイル: frmRoute.cs プロジェクト: salmanmushtaq/openmiracle
 /// <summary>
 /// Function to save the new route
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RouteSP   spRoute   = new RouteSP();
         RouteInfo infoRoute = new RouteInfo();
         infoRoute.RouteName = txtRouteName.Text.Trim();
         infoRoute.AreaId    = Convert.ToDecimal(cmbArea.SelectedValue.ToString());
         infoRoute.Narration = txtNarration.Text.Trim();
         infoRoute.Extra1    = String.Empty;
         infoRoute.Extra2    = String.Empty;
         if (spRoute.RouteCheckExistence(txtRouteName.Text.Trim(), 0, Convert.ToDecimal(cmbArea.SelectedValue.ToString())) == false)
         {
             decRoute = spRoute.RouteAddParticularFields(infoRoute);
             {
                 Messages.SavedMessage();
                 Clear();
                 GridFill();
                 if (frmCustomerobj != null)
                 {
                     this.Close();
                 }
             }
         }
         else
         {
             Messages.InformationMessage(" Route name already exist");
             txtRouteName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RT4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #6
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         BonusDedutionInfo infoBonusDeduction = new BonusDedutionInfo();
         BonusDedutionSP   spBonusDeduction   = new BonusDedutionSP();
         infoBonusDeduction.Date            = Convert.ToDateTime(dtpDate.Text.ToString());
         infoBonusDeduction.EmployeeId      = Convert.ToDecimal(cmbEmployeeCode.SelectedValue.ToString());
         infoBonusDeduction.Month           = Convert.ToDateTime(dtpMonth.Text.ToString());
         infoBonusDeduction.BonusAmount     = Convert.ToDecimal(txtBonusAmount.Text.ToString());
         infoBonusDeduction.DeductionAmount = Convert.ToDecimal(txtDeductionAmount.Text.ToString());
         infoBonusDeduction.Narration       = txtNarration.Text;
         infoBonusDeduction.Extra1          = string.Empty;
         infoBonusDeduction.Extra2          = string.Empty;
         if (spBonusDeduction.BonusDeductionAddIfNotExist(infoBonusDeduction))
         {
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage(" Employee bonus deduction already exist");
             cmbEmployeeCode.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("BD2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #7
0
 /// <summary>
 /// Function for save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         PayHeadBll  BllPayHead  = new PayHeadBll();
         PayHeadInfo infoPayhead = new PayHeadInfo();
         infoPayhead.PayHeadName = txtPayheadName.Text.Trim();
         infoPayhead.Type        = cmbPayheadType.SelectedItem.ToString();
         infoPayhead.Narration   = txtPayheadNarration.Text.Trim();
         infoPayhead.ExtraDate   = DateTime.Parse(DateTime.Now.ToString());
         infoPayhead.Extra1      = string.Empty;
         infoPayhead.Extra2      = string.Empty;
         if (btnPayheadSave.Text == "Save")
         {
             if (BllPayHead.PayheadCheckExistence(txtPayheadName.Text.Trim(), 0) == false)
             {
                 Messages.SavedMessage();
                 BllPayHead.PayHeadAdd(infoPayhead);
                 GridFill();
                 Clear();
             }
             else
             {
                 Messages.InformationMessage("Payhead name already exist");
                 txtPayheadName.Focus();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PH1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #8
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         foreach (DataGridViewRow dgvRow in dgvChangeProductTax.Rows)
         {
             if (dgvRow.Cells["dgvtxtSelect"].Value != null)
             {
                 if ((bool)(dgvRow.Cells["dgvtxtSelect"].Value))
                 {
                     int inProductId = Convert.ToInt32(dgvChangeProductTax.Rows[dgvRow.Index].Cells["dgvtxtProductId"].Value.ToString());
                     ProductCreationBll BllProductCreation = new ProductCreationBll();
                     ProductInfo        infoProduct        = new ProductInfo();
                     infoProduct.TaxId     = Convert.ToInt32(cmbNewTaxType.SelectedValue.ToString());
                     infoProduct.ProductId = inProductId;
                     BllProductCreation.ChangeProductTaxSave(infoProduct);
                     isDefault = false;
                 }
             }
         }
         Messages.SavedMessage();
         cmbSearchBy.Focus();
         Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show("CPT 2 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #9
0
 /// <summary>
 /// save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         UnitBll  bllUnit  = new UnitBll();
         UnitInfo infoUnit = new UnitInfo();
         infoUnit.UnitName          = txtUnitname.Text.Trim();
         infoUnit.noOfDecimalplaces = Convert.ToDecimal(txtDecimalPlaces.Text.ToString());
         infoUnit.Narration         = txtNarration.Text.Trim();
         infoUnit.formalName        = txtFormalName.Text.Trim();
         infoUnit.Extra1            = string.Empty;
         infoUnit.Extra2            = string.Empty;
         infoUnit.ExtraDate         = DateTime.Now;
         if (bllUnit.UnitCheckExistence(txtUnitname.Text.Trim(), 0) == false)
         {
             decUnit = bllUnit.UnitAdd(infoUnit);
             if (decUnit > 0)
             {
                 Messages.SavedMessage();
                 GridFill();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage(" Unit name already exist");
             txtUnitname.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("U3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #10
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         ExchangeRateInfo infoExchangeRate = new ExchangeRateInfo();
         ExchangeRateBll  BllExchangeRate  = new ExchangeRateBll();
         infoExchangeRate.CurrencyId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
         infoExchangeRate.Date       = Convert.ToDateTime(dtpDate.Text.Trim().ToString());
         infoExchangeRate.Rate       = Convert.ToDecimal(txtExchangeRate.Text.Trim().ToString());
         infoExchangeRate.Narration  = txtNarration.Text.Trim();
         infoExchangeRate.Extra1     = string.Empty;
         infoExchangeRate.Extra2     = string.Empty;
         if (BllExchangeRate.ExchangeRateCheckExistence(Convert.ToDateTime(txtDate.Text.Trim().ToString()), Convert.ToDecimal(cmbCurrency.SelectedValue.ToString()), 0) == false)
         {
             if (ExchangeRateCheck())
             {
                 BllExchangeRate.ExchangeRateAddParticularFields(infoExchangeRate);
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.ReferenceExistsMessageForUpdate();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ER2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #11
0
ファイル: frmGodown.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         GodownInfo infoGodown = new GodownInfo();
         GodownSP   spGodown   = new GodownSP();
         infoGodown.GodownName = txtGodownName.Text.Trim();
         infoGodown.Narration  = txtNarration.Text.Trim();
         infoGodown.Extra1     = string.Empty;
         infoGodown.Extra2     = string.Empty;
         if (spGodown.GodownCheckIfExist(txtGodownName.Text.Trim(), 0) == false)
         {
             decIdForOtherForms = spGodown.GodownAddWithoutSameName(infoGodown);
             RackAddCurrespondingtoGodown();
             if (decIdForOtherForms > 0)
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Godown name already exist");
             txtGodownName.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "G4:" + ex.Message;
     }
 }
コード例 #12
0
ファイル: frmProductGroup.cs プロジェクト: nwelsheimer/NBS
        /// <summary>
        /// Function to save new productgroup
        /// </summary>
        private void SaveFunction()
        {
            try
            {
                ProductGroupInfo infoProductGroup = new ProductGroupInfo();
                ProductGroupSP   spProductGroup   = new ProductGroupSP();
                infoProductGroup.GroupName  = txtProductGroupName.Text.Trim();
                infoProductGroup.GroupUnder = Convert.ToDecimal(cmbUnder.SelectedValue.ToString());
                infoProductGroup.Narration  = txtNarration.Text.Trim();
                infoProductGroup.Extra1     = string.Empty;
                infoProductGroup.Extra2     = string.Empty;


                if (spProductGroup.ProductGroupCheckExistence(txtProductGroupName.Text.Trim(), 0) == false)
                {
                    decIdForOtherForms = spProductGroup.ProductGroupAdd(infoProductGroup);
                    Messages.SavedMessage();
                    ProductGroupUnderComboFill();
                    ProductGroupUnderComboFillForSearch();
                    GridFill();
                    Clear();
                    txtProductGroupName.Focus();
                }
                else
                {
                    Messages.InformationMessage("Product group already exists");
                    txtProductGroupName.Focus();
                }
            }
            catch (Exception ex)
            {
                formMDI.infoError.ErrorString = "PG4:" + ex.Message;
            }
        }
コード例 #13
0
ファイル: frmPriceListPopup.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// Function to save the new pricelist for the product
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         PriceListSP   spPriceList   = new PriceListSP();
         PriceListInfo infoPriceList = new PriceListInfo();
         infoPriceList.ProductId      = decProductMain;
         infoPriceList.PricinglevelId = decPricingLevelMain;
         infoPriceList.UnitId         = decUnitId;
         infoPriceList.BatchId        = Convert.ToDecimal(cmbBatch.SelectedValue.ToString());
         infoPriceList.Rate           = Convert.ToDecimal(txtRate.Text);
         infoPriceList.Extra1         = string.Empty;
         infoPriceList.Extra2         = string.Empty;
         if (spPriceList.PriceListCheckExistence(0, decPricingLevelMain, Convert.ToDecimal(cmbBatch.SelectedValue.ToString()), decProductMain) == true)
         {
             spPriceList.PriceListAdd(infoPriceList);
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage("Price List already exist for selected product and batches");
             Clear();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PLP2" + ex.Message + ex.Message;
     }
 }
コード例 #14
0
ファイル: frmCounter.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         CounterInfo infoCounter = new CounterInfo();
         CounterSP   spCounter   = new CounterSP();
         infoCounter.CounterName = txtCounterName.Text.Trim();
         infoCounter.Narration   = txtNarration.Text.Trim();
         infoCounter.Extra1      = string.Empty;
         infoCounter.Extra2      = string.Empty;
         if (spCounter.CounterCheckIfExist(txtCounterName.Text.Trim(), 0) == false)
         {
             decLedgerId = spCounter.CounterAddWithIdentity(infoCounter);
             Messages.SavedMessage();
             Clear();
             decIdForOtherForms = decLedgerId;
         }
         else
         {
             Messages.InformationMessage("Counter name already exist");
             txtCounterName.Focus();
         }
         if (frmPOSObj != null)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CT3" + ex.Message;
     }
 }
コード例 #15
0
        /// <summary>
        /// save function
        /// </summary>
        public void SaveFunction()
        {
            decimal decBatchId = 0;

            try
            {
                StandardRateInfo infoStandardRate = new StandardRateInfo();
                StandardRateSP   spStandardRate   = new StandardRateSP();
                infoStandardRate.ApplicableFrom = Convert.ToDateTime(txtFromDate.Text.ToString());
                infoStandardRate.ApplicableTo   = Convert.ToDateTime(txtToDate.Text.ToString());
                infoStandardRate.ProductId      = decProduct;
                infoStandardRate.UnitId         = decUnitId;
                decBatchId = Convert.ToDecimal(cmbBatch.SelectedValue.ToString());
                infoStandardRate.BatchId = decBatchId;
                infoStandardRate.Rate    = Convert.ToDecimal(txtRate.Text.ToString());
                infoStandardRate.Extra1  = string.Empty;
                infoStandardRate.Extra2  = string.Empty;
                if (spStandardRate.StandardrateCheckExistence(0, Convert.ToDateTime(txtFromDate.Text.ToString()), Convert.ToDateTime(txtToDate.Text.ToString()), decProduct, decBatchId) == false)
                {
                    spStandardRate.StandardRateAddParticularfields(infoStandardRate);
                    Messages.SavedMessage();
                    GridFill(decProduct);
                    Clear();
                }
                else
                {
                    Messages.InformationMessage("Standard rate already exist for selected product,Batch and dates");
                    Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SRP4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #16
0
ファイル: frmPayHead.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// Function for save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         PayHeadSP   spPayhead   = new PayHeadSP();
         PayHeadInfo infoPayhead = new PayHeadInfo();
         infoPayhead.PayHeadName = txtPayheadName.Text.Trim();
         infoPayhead.Type        = cmbPayheadType.SelectedItem.ToString();
         infoPayhead.Narration   = txtPayheadNarration.Text.Trim();
         infoPayhead.ExtraDate   = DateTime.Parse(DateTime.Now.ToString());
         infoPayhead.Extra1      = string.Empty;
         infoPayhead.Extra2      = string.Empty;
         if (btnPayheadSave.Text == "Save")
         {
             if (spPayhead.PayheadCheckExistence(txtPayheadName.Text.Trim(), 0) == false)
             {
                 Messages.SavedMessage();
                 spPayhead.PayHeadAdd(infoPayhead);
                 GridFill();
                 Clear();
             }
             else
             {
                 Messages.InformationMessage("Payhead name already exist");
                 txtPayheadName.Focus();
             }
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "PH1:" + ex.Message;
     }
 }
コード例 #17
0
ファイル: frmSites.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         SiteInfo infoSite = new SiteInfo();
         SiteSP   spSite   = new SiteSP();
         infoSite.SiteName = txtSiteName.Text.Trim();
         infoSite.Address  = txtAddress.Text.Trim();
         infoSite.managed  = chkManaged.Checked;
         infoSite.dflt     = chkDflt.Checked;
         if (spSite.SiteCheckIfExist(txtSiteName.Text.Trim(), 0) == false)
         {
             decIdForOtherForms = spSite.SiteAddWithoutSameName(infoSite);
             if (decIdForOtherForms > 0)
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Site name already exist");
             txtSiteName.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "G4:" + ex.Message;
     }
 }
コード例 #18
0
 /// <summary>
 /// Function to save the new pricelist for the product
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         PriceListBll  BllPriceList  = new PriceListBll();
         PriceListInfo infoPriceList = new PriceListInfo();
         infoPriceList.ProductId      = decProductMain;
         infoPriceList.PricinglevelId = decPricingLevelMain;
         infoPriceList.UnitId         = decUnitId;
         infoPriceList.BatchId        = Convert.ToDecimal(cmbBatch.SelectedValue.ToString());
         infoPriceList.Rate           = Convert.ToDecimal(txtRate.Text);
         infoPriceList.Extra1         = string.Empty;
         infoPriceList.Extra2         = string.Empty;
         if (BllPriceList.PriceListCheckExistence(0, decPricingLevelMain, Convert.ToDecimal(cmbBatch.SelectedValue.ToString()), decProductMain) == true)
         {
             BllPriceList.PriceListAdd(infoPriceList);
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage("Price List already exist for selected product and batches");
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #19
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         CounterInfo infoCounter = new CounterInfo();
         CounterBll  bllCounter  = new CounterBll();
         infoCounter.CounterName = txtCounterName.Text.Trim();
         infoCounter.Narration   = txtNarration.Text.Trim();
         infoCounter.Extra1      = string.Empty;
         infoCounter.Extra2      = string.Empty;
         if (bllCounter.CounterCheckIfExist(txtCounterName.Text.Trim(), 0) == false)
         {
             decLedgerId = bllCounter.CounterAddWithIdentity(infoCounter);
             Messages.SavedMessage();
             Clear();
             decIdForOtherForms = decLedgerId;
         }
         else
         {
             Messages.InformationMessage("Counter name already exist");
             txtCounterName.Focus();
         }
         if (frmPOSObj != null)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("CT3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #20
0
 /// <summary>
 /// Save Function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         ServiceSP   spService   = new ServiceSP();
         ServiceInfo infoService = new ServiceInfo();
         infoService.ServiceName       = txtServiceName.Text.Trim();
         infoService.ServiceCategoryId = Convert.ToDecimal(cmbCategory.SelectedValue.ToString());
         infoService.Rate      = Convert.ToDecimal(txtRate.Text.ToString());
         infoService.Narration = txtNarration.Text.Trim();
         infoService.ExtraDate = PublicVariables._dtCurrentDate;
         infoService.Extra1    = string.Empty;
         infoService.Extra2    = string.Empty;
         if (spService.ServiceCheckExistence(txtServiceName.Text.Trim(), 0) == false)
         {
             decIdForOtherForms = spService.ServiceAddWithReturnIdentity(infoService);
             Messages.SavedMessage();
             Clear();
             GridFill();
         }
         else
         {
             Messages.InformationMessage("Service name already exist");
             txtServiceName.Focus();
         }
         if (frmServiceVoucherObj != null)
         {
             this.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Ser11 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #21
0
 /// <summary>
 /// Function for save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         BllHolidaySettings.HolidaySettingsDeleteByMonth(dtpMonth.Text.ToString(), dtpYear.Text.ToString());
         if (dgvHolidayRegister.Rows.Count > 0)
         {
             foreach (DataGridViewRow dgvRow in dgvHolidayRegister.Rows)
             {
                 infoHoliday.Date = DateTime.Parse(dgvRow.Cells[0].Value.ToString());
                 if (dgvRow.Cells["dgvtxtNarration"].Value != null)
                 {
                     string strNarration = dgvRow.Cells["dgvtxtNarration"].Value.ToString();
                     infoHoliday.Narration = strNarration.Trim();
                 }
                 else
                 {
                     infoHoliday.Narration = string.Empty;
                 }
                 infoHoliday.HolidayName = string.Empty;
                 infoHoliday.Extra1      = string.Empty;
                 infoHoliday.Extra2      = string.Empty;
                 BllHolidaySettings.HolidayAddWithIdentity(infoHoliday);
             }
         }
         Messages.SavedMessage();
         Clear();
         CalenderFill();
     }
     catch (Exception ex)
     {
         MessageBox.Show("HO4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #22
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         foreach (DataGridViewRow dgvRow in dgvChangeProductTax.Rows)
         {
             if (dgvRow.Cells["dgvtxtSelect"].Value != null)
             {
                 if ((bool)(dgvRow.Cells["dgvtxtSelect"].Value))
                 {
                     int         inProductId = Convert.ToInt32(dgvChangeProductTax.Rows[dgvRow.Index].Cells["dgvtxtProductId"].Value.ToString());
                     ProductSP   spProduct   = new ProductSP();
                     ProductInfo infoProduct = new ProductInfo();
                     infoProduct.TaxId     = Convert.ToInt32(cmbNewTaxType.SelectedValue.ToString());
                     infoProduct.ProductId = inProductId;
                     spProduct.ChangeProductTaxSave(infoProduct);
                     isDefault = false;
                 }
             }
         }
         Messages.SavedMessage();
         cmbSearchBy.Focus();
         Clear();
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "CPT 2 : " + ex.Message;
     }
 }
コード例 #23
0
ファイル: frmRole.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// Save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RoleInfo infoRole = new RoleInfo();
         RoleSP   spRole   = new RoleSP();
         infoRole.Role      = txtRole.Text.Trim();
         infoRole.Narration = txtNarration.Text.Trim();
         infoRole.Extra1    = string.Empty;
         infoRole.Extra2    = string.Empty;
         string strRole = txtRole.Text.Trim();
         if (spRole.RoleCheckExistence(decRoleId, strRole) == false)
         {
             decRoleId = spRole.RoleAdd(infoRole);
             Messages.SavedMessage();
             ClearFunction();
         }
         else
         {
             Messages.InformationMessage("Role already exists");
             txtRole.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "RL:3" + ex.Message;
     }
 }
コード例 #24
0
 /// <summary>
 /// Function to save new rack
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RackSP   spRack   = new RackSP();
         RackInfo rackInfo = new RackInfo();
         rackInfo.RackName  = txtRackName.Text.Trim();
         rackInfo.GodownId  = Convert.ToDecimal(cmbGodown.SelectedValue.ToString());
         rackInfo.Narration = txtNarration.Text.Trim();
         rackInfo.ExtraDate = DateTime.Now;
         rackInfo.Extra1    = string.Empty;
         rackInfo.Extra2    = string.Empty;
         decimal decGodounId = Convert.ToDecimal(cmbGodown.SelectedValue.ToString());
         if (spRack.RackCheckExistence(txtRackName.Text.Trim(), 0, decGodounId) == false)
         {
             decIdForOtherForms = spRack.RackAdd(rackInfo);
             if (decIdForOtherForms > 0)
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage(" Rack name already exist");
             txtRackName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("R7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #25
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         ModelNoSP   spModelNo   = new ModelNoSP();
         ModelNoInfo infoModelNo = new ModelNoInfo();
         infoModelNo.ModelNo   = txtModalNo.Text.Trim();
         infoModelNo.Narration = txtNarration.Text.Trim();
         infoModelNo.Extra1    = string.Empty;
         infoModelNo.Extra2    = string.Empty;
         if (spModelNo.ModelCheckIfExist(txtModalNo.Text.Trim().ToString(), 0) == false)
         {
             decIdForOtherForms = spModelNo.ModelNoAddWithDifferentModelNo(infoModelNo);
             if (decIdForOtherForms > 0)
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Model number already exist");
             txtModalNo.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MN3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #26
0
 /// <summary>
 /// Save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RoleInfo infoRole = new RoleInfo();
         RoleBll  BllRole  = new RoleBll();
         infoRole.Role      = txtRole.Text.Trim();
         infoRole.Narration = txtNarration.Text.Trim();
         infoRole.Extra1    = string.Empty;
         infoRole.Extra2    = string.Empty;
         string strRole = txtRole.Text.Trim();
         if (BllRole.RoleCheckExistence(decRoleId, strRole) == false)
         {
             decRoleId = BllRole.RoleAdd(infoRole);
             Messages.SavedMessage();
             ClearFunction();
         }
         else
         {
             Messages.InformationMessage("Role already exists");
             txtRole.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RL:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #27
0
        /// <summary>
        /// Function to save new productgroup
        /// </summary>
        private void SaveFunction()
        {
            try
            {
                ProductGroupInfo infoProductGroup = new ProductGroupInfo();
                ProductGroupBll  BllProductGroup  = new ProductGroupBll();
                infoProductGroup.GroupName  = txtProductGroupName.Text.Trim();
                infoProductGroup.GroupUnder = Convert.ToDecimal(cmbUnder.SelectedValue.ToString());
                infoProductGroup.Narration  = txtNarration.Text.Trim();
                infoProductGroup.Extra1     = string.Empty;
                infoProductGroup.Extra2     = string.Empty;


                if (BllProductGroup.ProductGroupCheckExistence(txtProductGroupName.Text.Trim(), 0) == false)
                {
                    decIdForOtherForms = BllProductGroup.ProductGroupAdd(infoProductGroup);
                    Messages.SavedMessage();
                    ProductGroupUnderComboFill();
                    ProductGroupUnderComboFillForSearch();
                    GridFill();
                    Clear();
                    txtProductGroupName.Focus();
                }
                else
                {
                    Messages.InformationMessage("Product group already exists");
                    txtProductGroupName.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PG4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #28
0
ファイル: frmExchangeRate.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         ExchangeRateInfo infoExchangeRate = new ExchangeRateInfo();
         ExchangeRateSP   spExchangeRate   = new ExchangeRateSP();
         infoExchangeRate.CurrencyId = Convert.ToDecimal(cmbCurrency.SelectedValue.ToString());
         infoExchangeRate.Date       = Convert.ToDateTime(dtpDate.Text.Trim().ToString());
         infoExchangeRate.Rate       = Convert.ToDecimal(txtExchangeRate.Text.Trim().ToString());
         infoExchangeRate.Narration  = txtNarration.Text.Trim();
         infoExchangeRate.Extra1     = string.Empty;
         infoExchangeRate.Extra2     = string.Empty;
         if (spExchangeRate.ExchangeRateCheckExistence(Convert.ToDateTime(txtDate.Text.Trim().ToString()), Convert.ToDecimal(cmbCurrency.SelectedValue.ToString()), 0) == false)
         {
             if (ExchangeRateCheck())
             {
                 spExchangeRate.ExchangeRateAddParticularFields(infoExchangeRate);
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.ReferenceExistsMessageForUpdate();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "ER2:" + ex.Message;
     }
 }
コード例 #29
0
 /// <summary>
 /// Function to save service category
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         ServiceCategoryInfo infoServiceCategory = new ServiceCategoryInfo();
         ServiceCategorySP   spServiceCategory   = new ServiceCategorySP();
         infoServiceCategory.CategoryName = txtServiceCategory.Text.Trim();
         infoServiceCategory.Narration    = txtNarration.Text.Trim();
         infoServiceCategory.Extra1       = string.Empty;
         infoServiceCategory.Extra2       = string.Empty;
         if (spServiceCategory.ServiceCategoryCheckIfExist(txtServiceCategory.Text.Trim().ToString(), 0) == false)
         {
             decId = spServiceCategory.ServiceCategoryAddSpecificFields1(infoServiceCategory);
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage("Service category name already exist");
             txtServiceCategory.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SC3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #30
0
ファイル: frmUnit.cs プロジェクト: nwelsheimer/NBS
 /// <summary>
 /// save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         UnitSP   spUnit   = new UnitSP();
         UnitInfo infoUnit = new UnitInfo();
         infoUnit.UnitName          = txtUnitname.Text.Trim();
         infoUnit.noOfDecimalplaces = Convert.ToDecimal(txtDecimalPlaces.Text.ToString());
         infoUnit.Narration         = txtNarration.Text.Trim();
         infoUnit.formalName        = txtFormalName.Text.Trim();
         infoUnit.Extra1            = string.Empty;
         infoUnit.Extra2            = string.Empty;
         infoUnit.ExtraDate         = DateTime.Now;
         if (spUnit.UnitCheckExistence(txtUnitname.Text.Trim(), 0) == false)
         {
             decUnit = spUnit.UnitAdd(infoUnit);
             if (decUnit > 0)
             {
                 Messages.SavedMessage();
                 GridFill();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage(" Unit name already exist");
             txtUnitname.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "U3:" + ex.Message;
     }
 }