Esempio n. 1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            objModel.ItemGroup    = tbxGroupName.Text.Trim();
            objModel.Alias        = tbxAliasname.Text.Trim() == null?string.Empty:tbxAliasname.Text.Trim();
            objModel.PrimaryGroup = cbxPrimarygroup.SelectedItem.ToString() == "Y" ? true : false;
            if (cbxPrimarygroup.SelectedItem.ToString() == "N")
            {
                objModel.UnderGroup = cbxUndergroup.SelectedItem.ToString();
            }
            //objModel.StockAccount = cbxStockaccount.SelectedItem.ToString();
            //objModel.SalesAccount = cbxSalesaccount.SelectedItem.ToString();
            //objModel.PurchaseAccount = cbxPurchaseAccount.SelectedItem.ToString();
            objModel.SeparateConfig = false;
            objModel.DefaultConfig  = false;
            if (rbnDefaultConfig.SelectedIndex == 0)
            {
                objModel.DefaultConfig = true;
            }
            if (rbnDefaultConfig.SelectedIndex == 1)
            {
                objModel.SeparateConfig = true;
            }
            objModel.Parameters = Convert.ToInt32(tbxParameters.Text.Trim() == string.Empty?"0": tbxParameters.Text.Trim());
            objModel.SpecifyBillReferencegrp = cbxTagBillReference.SelectedItem.ToString() == "Y" ? true : false;
            objModel.BillReferencegrp        = cbxBillReferenceGroup.Text.Trim() == null ? string.Empty : cbxBillReferenceGroup.Text.Trim();
            objModel.CrDaysforSale           = Convert.ToInt32(tbxCrDaysforSale.Text.Trim() == string.Empty ? "0" : tbxCrDaysforSale.Text.Trim());
            objModel.CrDaysforPurc           = Convert.ToInt32(tbxCrDaysforPurc.Text.Trim() == string.Empty ? "0" : tbxCrDaysforPurc.Text.Trim());
            PopupScreens.MasterSeriesGroup frmMaster = new PopupScreens.MasterSeriesGroup();
            frmMaster.StartPosition = FormStartPosition.CenterParent;
            frmMaster.ShowDialog();
            objModel.IGM_id     = ItemgrpId;
            objModel.ModifiedBy = "Admin";

            bool isSuccess = objItemBL.UpdateIGM(objModel);

            if (isSuccess)
            {
                MessageBox.Show("Update Successfully!");
                ClearControls();
                ItemgrpId = 0;
                Administration.List.ItemgroupList frmList = new Administration.List.ItemgroupList();
                frmList.StartPosition = FormStartPosition.CenterScreen;

                frmList.ShowDialog();
                FillItemGroupInfo();
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (tbxGroupName.Text.Equals(string.Empty))
            {
                MessageBox.Show("Material Center can not be blank!");
                return;
            }

            objGroup.GroupName        = tbxGroupName.Text.Trim();
            objGroup.Alias            = tbxAliasname.Text.Trim() == null?string.Empty:tbxAliasname.Text.Trim();
            objGroup.PrintName        = tbxPrintname.Text.Trim() == null? string.Empty : tbxAliasname.Text.Trim();;
            objGroup.Group            = cbxGroup.SelectedItem.ToString();
            objGroup.StockAccount     = cbxStockaccount.SelectedItem.ToString();
            objGroup.EnableStockinBal = cbxreflectstockinbalancesheet.SelectedItem.ToString() == "Y" ? true : false;

            //In Settings Check Check box This fiels Are Enable
            //objGroup.SalesAccount = cbxSaleAccount.SelectedItem.ToString();
            //objGroup.PurchaseAccount = cbxPurchaseAccount.SelectedItem.ToString();
            //objGroup.EnableAccinTransfer = tbxAccStocktransfer.Text.Trim() == "Y" ? true : false;
            objGroup.Address  = tbxAddress.Text == null ? string.Empty : tbxAddress.Text.Trim();
            objGroup.Address1 = tbxAddress1.Text == null ? string.Empty : tbxAddress1.Text.Trim();
            objGroup.Address2 = tbxAddress2.Text == null ? string.Empty : tbxAddress2.Text.Trim();
            objGroup.Address3 = tbxAddress3.Text == null ? string.Empty : tbxAddress3.Text.Trim();

            PopupScreens.MasterSeriesGroup frmMaster = new PopupScreens.MasterSeriesGroup();
            frmMaster.StartPosition = FormStartPosition.CenterParent;
            frmMaster.ShowDialog();
            objGroup.CreatedBy = "Admin";

            bool isSuccess = objmatcenbl.SaveMaterialMaster(objGroup);

            if (isSuccess)
            {
                MessageBox.Show("Saved Successfully!");
                ClearControls();
                MCId = 0;
            }
        }
Esempio n. 3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //TODO: 1. Check whether the account name exists or not
            //2. if exist then do not allow to save with the same account name
            //3. Prompt user to change the account name as it already exists

            if (tbxName.Text.Equals(string.Empty))
            {
                MessageBox.Show("Account Name can not be blank!");
                tbxName.Focus();
                return;
            }

            if (accMaster.IsAccountExists(tbxName.Text.Trim()))
            {
                MessageBox.Show("Account Name already Exists!");
                tbxName.Focus();
                return;
            }
            objAccount.AccountName = tbxName.Text.Trim();
            objAccount.PrintName   = tbxPrintname.Text.Trim() == null ? string.Empty : tbxPrintname.Text.Trim();
            objAccount.ShortName   = tbxAlias.Text == null ? string.Empty : tbxPrintname.Text.Trim();
            objAccount.LedgerType  = cbxLedgertype.SelectedItem == null ? string.Empty : cbxLedgertype.SelectedItem.ToString();
            objAccount.Group       = cbxGroupname.SelectedItem == null ? string.Empty : cbxGroupname.SelectedItem.ToString();
            AccountGroupModel objGroup = accMaster.GetAccountGroupIdByGroupName(objAccount.Group);

            objAccount.AccGroupId    = objGroup.UnderGroupId;
            objAccount.MultiCurrency = Convert.ToBoolean(cbxMulticurrency.SelectedItem.ToString() == "Y" ? true : false);
            objAccount.OPBal         = Convert.ToDecimal(tbxOpbal.Text.Trim() == string.Empty ? "0.00" : tbxOpbal.Text.Trim());
            if (objAccount.OPBal != 0)
            {
                PopupScreens.CostcenterPopup frmCost = new PopupScreens.CostcenterPopup();
                frmCost.StartPosition = FormStartPosition.CenterParent;
                frmCost.ShowDialog();
            }
            objAccount.PrevYearBal    = Convert.ToDecimal(tbxPrevyearbal.Text.Trim() == string.Empty ? "0.00" : tbxPrevyearbal.Text.Trim());
            objAccount.DrCrOpeningBal = cbxCrDr.SelectedItem.ToString();
            objAccount.DrCrPrevBal    = cbxPrevCrDr.SelectedItem.ToString();
            //objAccount.MaintainBillwiseAccounts = cbxMaintainBalancing.SelectedItem.ToString() == "Y" ? true : false;
            objAccount.AllocateAmountItems   = cbxAllocateAmount.SelectedItem.ToString() == "Y" ? true : false;
            objAccount.CreditDaysforSale     = Convert.ToInt32(tbxCreditdaysforSale.Text == string.Empty ? "0" : tbxCreditdaysforSale.Text.Trim());
            objAccount.CreditDaysforPurchase = Convert.ToInt32(tbxCreditdaysforPurc.Text == string.Empty ? "0" : tbxCreditdaysforPurc.Text.Trim());

            if (objAccount.MaintainBillwiseAccounts)
            {
                PopupScreens.MaintainBillByBillDetails frmbill = new PopupScreens.MaintainBillByBillDetails();
                frmbill.StartPosition = FormStartPosition.CenterParent;
                frmbill.ShowDialog();
            }
            PopupScreens.SalesManDetails frmSM = new PopupScreens.SalesManDetails();
            frmSM.StartPosition = FormStartPosition.CenterParent;
            frmSM.ShowDialog();
            //objAccount.CreditLimit = tbxcred.Text;
            PopupScreens.CreditLimitforAccount frmCredit = new PopupScreens.CreditLimitforAccount();
            frmCredit.StartPosition = FormStartPosition.CenterParent;
            frmCredit.ShowDialog();
            PopupScreens.UnclearChequeDeposite frmDeposites = new PopupScreens.UnclearChequeDeposite();
            frmDeposites.StartPosition = FormStartPosition.CenterParent;
            frmDeposites.ShowDialog();
            PopupScreens.BudgetsforAccount frmBudget = new PopupScreens.BudgetsforAccount();
            frmBudget.StartPosition = FormStartPosition.CenterParent;
            frmBudget.ShowDialog();

            PopupScreens.UnclearChequeIssued frmIssued = new PopupScreens.UnclearChequeIssued();
            frmIssued.StartPosition = FormStartPosition.CenterParent;
            frmIssued.ShowDialog();

            PopupScreens.MasterSeriesGroup frmMaster = new PopupScreens.MasterSeriesGroup();
            frmMaster.StartPosition = FormStartPosition.CenterParent;
            frmMaster.ShowDialog();

            objAccount.Transport = tbxTransport.Text == null ? string.Empty : tbxTransport.Text;
            objAccount.Station   = tbxStation.Text == null ? string.Empty : tbxStation.Text;

            objAccount.specifyDefaultSaleType = cbxSpecifydefaultSale.SelectedItem.ToString() == "Y" ? true : false;
            objAccount.FreezeSaleType         = cbxFreezesaletype.SelectedItem.ToString() == "Y" ? true : false;
            objAccount.DefaultSaleType        = cbxDefaultsaletype.SelectedItem.ToString() == "" ? string.Empty : cbxDefaultsaletype.SelectedItem.ToString();

            objAccount.SpecifyDefaultPurType = cbxSpecifydefaultPurcType.SelectedItem.ToString().Equals("Y") ? true : false;
            objAccount.DefaultPurcType       = cbxDefaultPurcType.SelectedItem == null ? string.Empty : cbxDefaultPurcType.SelectedItem.ToString();
            objAccount.FreezePurcType        = cbxFreezePurcType.SelectedItem.ToString() == "Y" ? true : false;

            objAccount.InterestRatePayable    = Convert.ToDecimal(tbxInterestPay.Text == string.Empty ? "0.00" : tbxInterestPay.Text);
            objAccount.InterestRateReceivable = Convert.ToDecimal(tbxInterestrateReceviable.Text == string.Empty ? "0.00" : tbxInterestrateReceviable.Text.Trim());
            objAccount.address   = tbxAddress.Text.Trim() == null ? string.Empty : tbxAddress.Text.Trim();
            objAccount.address1  = tbxAddress1.Text.Trim() == null ? string.Empty : tbxAddress1.Text.Trim();
            objAccount.address2  = tbxAddress2.Text.Trim() == null ? string.Empty : tbxAddress2.Text.Trim();
            objAccount.address3  = tbxAddress3.Text.Trim() == null ? string.Empty : tbxAddress3.Text.Trim();
            objAccount.ImageData = AccLogo;
            objAccount.State     = cbxState.SelectedItem.ToString();
            //objAccount.area = tbxArea.Text.Trim() == null ? string.Empty : tbxArea.Text.Trim();
            objAccount.TelephoneNumber = tbxTelno.Text.Trim() == null ? string.Empty : tbxTelno.Text.Trim();

            objAccount.Fax          = tbxFax.Text == null ? string.Empty : tbxFax.Text.Trim();
            objAccount.MobileNumber = tbxMobileno.Text == null ? string.Empty : tbxMobileno.Text.Trim();
            objAccount.email        = tbxEmail.Text == null ? string.Empty : tbxEmail.Text.Trim();

            objAccount.enablemailquery = Convert.ToBoolean(tbxEmailQuery.Text.Trim().Equals("Y") ? true : false);
            objAccount.enableSMSquery  = Convert.ToBoolean(tbxSMSQuery.Text.Trim().Equals("Y") ? true : false);

            objAccount.contactperson          = tbxContactPerson.Text == null ? string.Empty : tbxContactPerson.Text.Trim();
            objAccount.ITPanNumber            = tbxITpan.Text == null ? string.Empty : tbxITpan.Text.Trim();
            objAccount.Ward                   = tbxWard.Text == null ? string.Empty : tbxWard.Text.Trim();
            objAccount.LstNumber              = tbxLstno.Text == null ? string.Empty : tbxLstno.Text.Trim();
            objAccount.CSTNumber              = tbxCstno.Text == null ? string.Empty : tbxCstno.Text.Trim();
            objAccount.TIN                    = tbxTin.Text == null ? string.Empty : tbxTin.Text.Trim();
            objAccount.LBTNumber              = tbxlbtno == null ? string.Empty : tbxlbtno.Text.Trim();
            objAccount.ServiceTaxNumber       = tbxServicetax == null ? string.Empty : tbxServicetax.Text.Trim();
            objAccount.IECode                 = tbxIecode.Text == null ? string.Empty : tbxIecode.Text.Trim();
            objAccount.DLNO1                  = tbxDlno1.Text.Trim() == null ? string.Empty : tbxDlno1.Text.Trim();
            objAccount.No1                    = tbxNo1.Text.Trim() == null ? string.Empty : tbxNo1.Text.Trim();
            objAccount.ChequePrintName        = tbxChequePrintName.Text == null ? string.Empty : tbxChequePrintName.Text.Trim();
            objAccount.allowwebbasedreporting = tbxWebBasedReporting.Text.Trim() == null ? string.Empty : tbxWebBasedReporting.Text.Trim();
            //objAccount.BankAccountNumber=
            string message = string.Empty;

            decLedgerId = accMaster.SaveAccount(objAccount);
            if (decLedgerId > 0)
            {
                LedgerPostingAdd();
                MessageBox.Show("Saved Successfully!");
                ClearControls();
                tbxName.Focus();
                groupId = 0;
            }
        }