Example #1
0
        public async Task <IActionResult> GetAll([FromBody] AccountMasterModel editAccountMasterModel)
        {
            ServiceResponseModel <IEnumerable <AccountMasterModel> > response = new  ServiceResponseModel <IEnumerable <AccountMasterModel> >();

            try
            {
                if (string.IsNullOrWhiteSpace(editAccountMasterModel.CompCode))
                {
                    throw new ArgumentNullException("CompCode is required");
                }
                if (string.IsNullOrWhiteSpace(editAccountMasterModel.AccYear))
                {
                    throw new ArgumentNullException("AccYear is required");
                }

                response = await _accountMasterService.GetAll(editAccountMasterModel);

                if (response.Data == null)
                {
                    return(NotFound(response));
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.StackTrace);
                response.Success = false;
                response.Message = ex.Message;
            }
            return(Ok(response));
        }
Example #2
0
        public async Task <IActionResult> GetAll([FromQuery] PageParams pageParams, [FromBody] AccountMasterModel accountMasterModel)
        {
            ServiceResponseModel <IEnumerable <AccountMaster> > response = new ServiceResponseModel <IEnumerable <AccountMaster> >();

            try
            {
                if (string.IsNullOrWhiteSpace(accountMasterModel.CompCode))
                {
                    throw new ArgumentNullException("CompCode is required");
                }
                if (string.IsNullOrWhiteSpace(accountMasterModel.AccYear))
                {
                    throw new ArgumentNullException("AccYear is required");
                }
                if (string.IsNullOrWhiteSpace(accountMasterModel.OrderBy))
                {
                    accountMasterModel.OrderBy = "accountId";
                }

                var accountList = await _accountMasterService.GetAll(pageParams, accountMasterModel);

                Response.AddPaginationHeader(accountList.CurrentPage, accountList.PageSize, accountList.TotalCount, accountList.TotalPages);
                response.Data = accountList;
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.StackTrace);
                response.Success = false;
                response.Message = ex.Message;
            }
            return(Ok(response));
        }
Example #3
0
 private void btnNewEntery_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
 {
     objAccount = new AccountMasterModel();
     ClearControls();
     groupId = 0;
     laCtrlUpdate.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
     laCtrlDelete.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
     laCtrlSave.Visibility   = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
 }
Example #4
0
 private void ClearControls()
 {
     objAccount                        = new AccountMasterModel();
     tbxName.Text                      = string.Empty;
     tbxAlias.Text                     = string.Empty;
     tbxPrintname.Text                 = string.Empty;
     cbxLedgertype.SelectedItem        = string.Empty;
     cbxMulticurrency.SelectedItem     = string.Empty;
     cbxGroupname.SelectedItem         = string.Empty;
     tbxOpbal.Text                     = string.Empty;
     tbxPrevyearbal.Text               = string.Empty;
     cbxCrDr.SelectedItem              = string.Empty;
     cbxPrevCrDr.SelectedItem          = string.Empty;
     cbxMaintainBalancing.SelectedItem = string.Empty;
     //objAccount.ActivateInterestCal = Convert.ToBoolean(dr["ACC_ActivateInterestCal"]);
     cbxAllocateAmount.SelectedItem = string.Empty;
     tbxCreditdaysforSale.Text      = string.Empty;
     tbxCreditdaysforPurc.Text      = string.Empty;
     //objAccount.TypeofDealer = dr["ACC_TypeofDealer"].ToString();
     //objAccount.TypeofBuissness = dr["ACC_TypeofBuissness"].ToString();
     tbxTransport.Text = string.Empty;
     tbxStation.Text   = string.Empty;
     cbxSpecifydefaultSale.SelectedItem     = string.Empty;
     cbxDefaultsaletype.SelectedItem        = string.Empty;
     cbxFreezesaletype.SelectedItem         = string.Empty;
     cbxSpecifydefaultPurcType.SelectedItem = string.Empty;
     cbxDefaultPurcType.SelectedItem        = string.Empty;
     cbxFreezePurcType.SelectedItem         = string.Empty;
     //objAccount.LockSalesType = Convert.ToBoolean(dr["ACC_LockSalesType"]);
     //objAccount.LockPurchaseType = Convert.ToBoolean(dr["ACC_LockPurcType"]);
     tbxAddress.Text       = string.Empty;
     tbxAddress1.Text      = string.Empty;
     tbxAddress2.Text      = string.Empty;
     tbxAddress3.Text      = string.Empty;
     tbxTelno.Text         = string.Empty;
     cbxState.SelectedItem = string.Empty;
     tbxFax.Text           = string.Empty;
     tbxMobileno.Text      = string.Empty;
     tbxEmail.Text         = string.Empty;
     //objAccount.WebSite = dr["ACC_Website"].ToString();
     tbxEmailQuery.SelectedItem = string.Empty;
     tbxSMSQuery.SelectedItem   = string.Empty;
     tbxContactPerson.Text      = string.Empty;
     tbxITpan.Text      = string.Empty;
     tbxLstno.Text      = string.Empty;
     tbxCstno.Text      = string.Empty;
     tbxTin.Text        = string.Empty;
     tbxServicetax.Text = string.Empty;
     tbxlbtno.Text      = string.Empty;
     //objAccount.BankAccountNumber = dr["ACC_BankAccountNumber"].ToString();
     tbxIecode.Text                 = string.Empty;
     tbxWard.Text                   = string.Empty;
     tbxChequePrintName.Text        = string.Empty;
     tbxInterestPay.Text            = string.Empty;
     tbxInterestrateReceviable.Text = string.Empty;
 }
        public async Task <ServiceResponseModel <AccountMasterModel> > Add(AccountMasterModel newAccountMasterModel)
        {
            ServiceResponseModel <AccountMasterModel> serviceResponse = new ServiceResponseModel <AccountMasterModel>();
            AccountMaster accounttMaster = _mapper.Map <AccountMaster>(newAccountMasterModel);
            await UnitOfWork.AccountMasters.AddAsync(accounttMaster);

            await UnitOfWork.Complete();

            serviceResponse.Data = newAccountMasterModel;
            return(serviceResponse);
        }
        public async Task <ServiceResponseModel <AccountMasterModel> > GetAccountByName(AccountMasterModel editAccountMasterModel)
        {
            ServiceResponseModel <AccountMasterModel> serviceResponse = new ServiceResponseModel <AccountMasterModel>();
            AccountMaster dbAccountMaster = await UnitOfWork.AccountMasters.SingleOrDefaultAsync(a =>
                                                                                                 a.CompCode == editAccountMasterModel.CompCode &&
                                                                                                 a.AccYear == editAccountMasterModel.AccYear &&
                                                                                                 a.Name == editAccountMasterModel.Name);

            AccountMasterModel accountMasterModel = _mapper.Map <AccountMasterModel>(dbAccountMaster);

            serviceResponse.Data = accountMasterModel;
            return(serviceResponse);
        }
        public async Task <ServiceResponseModel <AccountMasterModel> > Edit(AccountMasterModel editAccountMasterModel)
        {
            ServiceResponseModel <AccountMasterModel> serviceResponse = new ServiceResponseModel <AccountMasterModel>();
            AccountMaster editAccountMaster = await UnitOfWork.AccountMasters.SingleOrDefaultAsync(a => a.CompCode == editAccountMasterModel.CompCode &&
                                                                                                   a.AccYear == editAccountMasterModel.AccYear && a.AccountId == editAccountMasterModel.AccountId);

            _mapper.Map <AccountMasterModel, AccountMaster>(editAccountMasterModel, editAccountMaster);
            serviceResponse.Data = editAccountMasterModel;
            UnitOfWork.AccountMasters.Update(editAccountMaster);
            await UnitOfWork.Complete();

            return(serviceResponse);
        }
        public async Task <ServiceResponseModel <AccountMasterModel> > Delete(AccountMasterModel delAccountMasterModel)
        {
            ServiceResponseModel <AccountMasterModel> serviceResponse = new ServiceResponseModel <AccountMasterModel>();
            AccountMaster delAccountMaster = await UnitOfWork.AccountMasters.SingleOrDefaultAsync(a =>
                                                                                                  a.CompCode == delAccountMasterModel.CompCode &&
                                                                                                  a.AccYear == delAccountMasterModel.AccYear &&
                                                                                                  a.AccountId == delAccountMasterModel.AccountId);

            UnitOfWork.AccountMasters.Remove(delAccountMaster);
            await UnitOfWork.Complete();

            serviceResponse.Data = delAccountMasterModel;
            return(serviceResponse);
        }
        public async Task <PagedList <AccountMaster> > GetAll(PageParams pageParams, AccountMasterModel accountMasterModel)
        {
            var query = _context.AccountMasters
                        .Where(a => a.CompCode == accountMasterModel.CompCode && a.AccYear == accountMasterModel.AccYear)
                        .AsQueryable();

            switch (accountMasterModel.OrderBy)
            {
            case "accountId":
                query = query.OrderBy(c => c.CompCode).ThenBy(c => c.AccYear).ThenBy(c => c.AccountId);
                break;

            case "name":
                query = query.OrderBy(c => c.CompCode).ThenBy(c => c.AccYear).ThenBy(c => c.Name);
                break;

            default:
                query = query.OrderBy(c => c.CompCode).ThenBy(c => c.AccYear).ThenBy(c => c.AccountId);
                break;
            }

            return(await PagedList <AccountMaster> .CreateAsync(query, pageParams.PageNumber, pageParams.PageSize));
        }
Example #10
0
        public AccountMasterModel GetListofAccountByAccountName(string accountname)
        {
            AccountMasterModel _acctMaster = new AccountMasterModel();

            try
            {
                string Query = "SELECT * from ACCOUNTMaster WHERE ACC_NAME='" + accountname + "'";
                System.Data.IDataReader dr = _dbHelper.ExecuteDataReader(Query, _dbHelper.GetConnObject());

                while (dr.Read())
                {
                    _acctMaster.AccountId     = Convert.ToInt32(dr["Ac_ID"]);
                    _acctMaster.AccountName   = dr["ACC_NAME"].ToString();
                    _acctMaster.ShortName     = dr["ACC_SHORTNAME"].ToString();
                    _acctMaster.PrintName     = dr["ACC_PRINTNAME"].ToString();
                    _acctMaster.LedgerType    = dr["ACC_LedgerType"].ToString();
                    _acctMaster.MultiCurrency = Convert.ToBoolean(dr["ACC_MultiCurr"]) ? true : false;
                    _acctMaster.Group         = dr["ACC_Group"].ToString();
                    _acctMaster.OPBal         = dr["ACC_OpBal"].ToString() == "" ? 0 : Convert.ToInt32(dr["ACC_OpBal"].ToString());
                    // _acctMaster.PrevYearBal = dr["ACC_PrevYearBal"].ToString();
                    _acctMaster.DrCrOpeningBal           = dr["ACC_DrCrOpenBal"].ToString();
                    _acctMaster.DrCrPrevBal              = dr["ACC_DrCrPrevBal"].ToString();
                    _acctMaster.MaintainBillwiseAccounts = Convert.ToBoolean(dr["ACC_MaintainBitwise"]) ? true : false;

                    _acctMaster.ActivateInterestCal    = Convert.ToBoolean(dr["ACC_ActivateInterestCal"]) == false ? false : true;
                    _acctMaster.CreditDays             = dr["ACC_CreditDays"].ToString();
                    _acctMaster.CreditLimit            = dr["ACC_CreditLimit"].ToString();
                    _acctMaster.TypeofDealer           = dr["ACC_TypeofDealer"].ToString();
                    _acctMaster.TypeofBuissness        = dr["ACC_TypeofBuissness"].ToString();
                    _acctMaster.Transport              = dr["ACC_Transport"].ToString();
                    _acctMaster.Station                = dr["ACC_Station"].ToString();
                    _acctMaster.specifyDefaultSaleType = Convert.ToBoolean(dr["ACC_SpecifyDefaultSaleType"]) == false ? false : true;
                    _acctMaster.DefaultSaleType        = dr["ACC_DefaultSaleType"].ToString();
                    _acctMaster.FreezeSaleType         = dr["ACC_FreezeSaleType"].ToString();
                    _acctMaster.SpecifyDefaultPurType  = Convert.ToBoolean(dr["ACC_SpecifyDefaultPurType"]) == false ? false : true;

                    _acctMaster.LockSalesType    = Convert.ToBoolean(dr["ACC_LockSalesType"]) == false ? false : true;
                    _acctMaster.LockPurchaseType = Convert.ToBoolean(dr["ACC_LockPurcType"]) == false ? false : true;
                    _acctMaster.address1         = dr["ACC_address1"].ToString();
                    _acctMaster.address2         = dr["ACC_address2"].ToString();
                    _acctMaster.address3         = dr["ACC_Address3"].ToString();
                    _acctMaster.Transport        = dr["ACC_Address4"].ToString();
                    _acctMaster.Station          = dr["ACC_State"].ToString();
                    _acctMaster.TelephoneNumber  = dr["ACC_TelephoneNumber"].ToString();
                    _acctMaster.Fax            = dr["ACC_Fax"].ToString();
                    _acctMaster.FreezeSaleType = dr["ACC_MobileNumber"].ToString();
                    _acctMaster.email          = dr["ACC_email"].ToString();

                    _acctMaster.WebSite         = dr["ACC_Website"].ToString();
                    _acctMaster.enablemailquery = Convert.ToBoolean(dr["ACC_enablemailquery"]) == false ? false : true;
                    _acctMaster.enableSMSquery  = Convert.ToBoolean(dr["ACC_enableSMSquery"]) == false ? false : true;
                    // _acctMaster.address2 = dr["ACC_address2"].ToString();
                    //_acctMaster.address3 = dr["ACC_Address3"].ToString();
                    //_acctMaster.address4 = dr["ACC_Address4"].ToString();
                    _acctMaster.State           = dr["ACC_State"].ToString();
                    _acctMaster.TelephoneNumber = dr["ACC_TelephoneNumber"].ToString();
                    _acctMaster.Fax             = dr["ACC_Fax"].ToString();
                    _acctMaster.MobileNumber    = dr["ACC_MobileNumber"].ToString();
                    _acctMaster.email           = dr["ACC_email"].ToString();

                    _acctMaster.contactperson     = dr["ACC_contactperson"].ToString();
                    _acctMaster.ITPanNumber       = dr["ACC_ITPanNumber"].ToString();
                    _acctMaster.LstNumber         = dr["ACC_LSTNumber"].ToString();
                    _acctMaster.CSTNumber         = dr["ACC_CSTNumber"].ToString();
                    _acctMaster.TIN               = dr["ACC_TIN"].ToString();
                    _acctMaster.ServiceTaxNumber  = dr["ACC_ServiceTax"].ToString();
                    _acctMaster.LBTNumber         = dr["ACC_LBTNumber"].ToString();
                    _acctMaster.BankAccountNumber = dr["ACC_BankAccountNumber"].ToString();
                    _acctMaster.IECode            = dr["ACC_IECode"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_acctMaster);
        }
Example #11
0
        /// <summary>
        /// Update Account
        /// </summary>
        /// <param name="objAcctMaster"></param>
        /// <returns>True/False</returns>
        public bool UpdateAccount(AccountMasterModel objAcctMaster)
        {
            string Query = string.Empty;

            DBParameterCollection paramCollection = new DBParameterCollection();

            paramCollection.Add(new DBParameter("@Acc_DbName", "zAKIR"));
            paramCollection.Add(new DBParameter("@ACC_NAME", objAcctMaster.AccountName));
            paramCollection.Add(new DBParameter("@ACC_SHORTNAME", objAcctMaster.ShortName));
            paramCollection.Add(new DBParameter("@ACC_PRINTNAME", objAcctMaster.PrintName));
            paramCollection.Add(new DBParameter("@ACC_LedgerType", objAcctMaster.LedgerType));

            paramCollection.Add(new DBParameter("@ACC_MultiCurr", objAcctMaster.MultiCurrency, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_Group", objAcctMaster.Group));
            paramCollection.Add(new DBParameter("@ACC_OpBal", objAcctMaster.OPBal, System.Data.DbType.Int32));
            paramCollection.Add(new DBParameter("@ACC_PrevYearBal", objAcctMaster.PrevYearBal));
            paramCollection.Add(new DBParameter("@ACC_DrCrOpenBal", objAcctMaster.DrCrOpeningBal));


            paramCollection.Add(new DBParameter("@ACC_DrCrPrevBal", objAcctMaster.DrCrOpeningBal));
            paramCollection.Add(new DBParameter("@ACC_MaintainBitwise", objAcctMaster.MaintainBillwiseAccounts, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_ActivateInterestCal", objAcctMaster.ActivateInterestCal, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_CreditDays", objAcctMaster.CreditDays));
            paramCollection.Add(new DBParameter("@ACC_CreditLimit", objAcctMaster.CreditLimit));

            paramCollection.Add(new DBParameter("@ACC_TypeofBuissness", objAcctMaster.TypeofBuissness));
            paramCollection.Add(new DBParameter("@ACC_Transport", objAcctMaster.Transport));
            paramCollection.Add(new DBParameter("@ACC_Station", objAcctMaster.Station));
            paramCollection.Add(new DBParameter("@ACC_SpecifyDefaultSaleType", objAcctMaster.specifyDefaultSaleType, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_DefaultSaleType", objAcctMaster.DefaultSaleType));

            paramCollection.Add(new DBParameter("@ACC_FreezeSaleType", objAcctMaster.FreezeSaleType));
            paramCollection.Add(new DBParameter("@ACC_SpecifyDefaultPurType", objAcctMaster.SpecifyDefaultPurType, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_DefaultPurcType", objAcctMaster.DefaultPurcType));
            paramCollection.Add(new DBParameter("@ACC_LockSalesType", objAcctMaster.LockSalesType, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_LockPurcType", objAcctMaster.LockPurchaseType, System.Data.DbType.Boolean));

            paramCollection.Add(new DBParameter("@ACC_address1", objAcctMaster.address1));
            paramCollection.Add(new DBParameter("@ACC_address2", objAcctMaster.address2));
            paramCollection.Add(new DBParameter("@ACC_Address3", objAcctMaster.address3));

            paramCollection.Add(new DBParameter("@ACC_Address4", objAcctMaster.address4));
            paramCollection.Add(new DBParameter("@ACC_State", objAcctMaster.State));

            paramCollection.Add(new DBParameter("@ACC_TelephoneNumber", objAcctMaster.TelephoneNumber));
            paramCollection.Add(new DBParameter("@ACC_Fax", objAcctMaster.Fax));
            paramCollection.Add(new DBParameter("@ACC_MobileNumber", objAcctMaster.MobileNumber));
            paramCollection.Add(new DBParameter("@ACC_email", objAcctMaster.email));
            paramCollection.Add(new DBParameter("@ACC_Website", objAcctMaster.WebSite));

            paramCollection.Add(new DBParameter("@ACC_enablemailquery", objAcctMaster.enablemailquery, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_enableSMSquery", objAcctMaster.enableSMSquery, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_contactperson", objAcctMaster.contactperson));
            paramCollection.Add(new DBParameter("@ACC_ITPanNumber", objAcctMaster.ITPanNumber));
            paramCollection.Add(new DBParameter("@ACC_LSTNumber", objAcctMaster.LstNumber));

            paramCollection.Add(new DBParameter("@ACC_CSTNumber", objAcctMaster.CSTNumber));
            paramCollection.Add(new DBParameter("@ACC_TIN", objAcctMaster.TIN));
            paramCollection.Add(new DBParameter("@ACC_ServiceTax", objAcctMaster.ServiceTaxNumber));
            paramCollection.Add(new DBParameter("@ACC_BankAccountNumber", objAcctMaster.BankAccountNumber));
            paramCollection.Add(new DBParameter("@ACC_IECode", objAcctMaster.IECode));

            paramCollection.Add(new DBParameter("@ACC_CreatedBy", "admin"));
            paramCollection.Add(new DBParameter("@ACC_DEFAULT_CHEQUE_FORMAT", ""));
            paramCollection.Add(new DBParameter("@ENABLE_CHEQUE_PRINTING", true, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_Cheque_PrintName", objAcctMaster.ChequePrintName));
            paramCollection.Add(new DBParameter("@AC_Id", objAcctMaster.AccountId));

            //todo: NEED TO FIX UPDATE
            Query =
                "UPDATE AccountMaster SET [Acc_DbName]=@Acc_DbName,[ACC_NAME]=@ACC_NAME,[ACC_SHORTNAME]=@ACC_SHORTNAME,[ACC_PRINTNAME]=@ACC_PRINTNAME,[ACC_LedgerType]=@ACC_LedgerType,[ACC_MultiCurr]=@ACC_MultiCurr,[ACC_Group]=@ACC_Group,[ACC_OpBal]=@ACC_OpBal," +
                "[ACC_PrevYearBal]=@ACC_PrevYearBal,[ACC_DrCrOpenBal]=@ACC_DrCrOpenBal,[ACC_DrCrPrevBal]=@ACC_DrCrPrevBal,[ACC_MaintainBitwise]=@ACC_MaintainBitwise,[ACC_ActivateInterestCal]=@ACC_ActivateInterestCal,[ACC_CreditDays]=@ACC_CreditDays, " +
                "[ACC_CreditLimit]=@ACC_CreditLimit,[ACC_TypeofBuissness]=@ACC_TypeofBuissness,[ACC_Transport]=@ACC_Transport,[ACC_Station]=@ACC_Station,[ACC_SpecifyDefaultSaleType]=@ACC_SpecifyDefaultSaleType,[ACC_DefaultSaleType]=@ACC_DefaultSaleType," +
                "[ACC_FreezeSaleType]=@ACC_FreezeSaleType,[ACC_SpecifyDefaultPurType]=@ACC_SpecifyDefaultPurType,[ACC_DefaultPurcType]=@ACC_DefaultPurcType,[ACC_LockSalesType]=@ACC_LockSalesType,[ACC_LockPurcType]=@ACC_LockPurcType,[ACC_address1]=@ACC_address1," +
                "[ACC_address2]=@ACC_address2,[ACC_Address3]=@ACC_Address3,[ACC_Address4]=@ACC_Address4,[ACC_State]=@ACC_State,[ACC_TelephoneNumber]=@ACC_TelephoneNumber,[ACC_Fax]=@ACC_Fax,[ACC_MobileNumber]=@ACC_MobileNumber,[ACC_email]=@ACC_email,[ACC_Website]=@ACC_Website," +
                "[ACC_enablemailquery]=@ACC_enablemailquery,[ACC_enableSMSquery]=@ACC_enableSMSquery,[ACC_contactperson]=@ACC_contactperson,[ACC_ITPanNumber]=@ACC_ITPanNumber,[ACC_LSTNumber]=@ACC_LSTNumber,[ACC_CSTNumber]=@ACC_CSTNumber,[ACC_TIN]=@ACC_TIN," +
                "[ACC_ServiceTax]=@ACC_ServiceTax,[ACC_BankAccountNumber]=@ACC_BankAccountNumber,[ACC_IECode]=@ACC_IECode,[ACC_CreatedBy]=@ACC_CreatedBy,[ACC_DEFAULT_CHEQUE_FORMAT]=@ACC_DEFAULT_CHEQUE_FORMAT,[ENABLE_CHEQUE_PRINTING]=@ENABLE_CHEQUE_PRINTING,[ACC_Cheque_PrintName]=@ACC_Cheque_PrintName " +
                " WHERE [AC_Id]=@Ac_Id";


            return(_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0);
        }
Example #12
0
        /// <summary>
        /// Save Account
        /// </summary>
        /// <param name="objAcctMaster"></param>
        /// <returns>True/False</returns>
        public bool SaveAccount(AccountMasterModel objAcctMaster)
        {
            string Query = string.Empty;

            DBParameterCollection paramCollection = new DBParameterCollection();

            paramCollection.Add(new DBParameter("@Acc_DbName", "SunSpped"));
            paramCollection.Add(new DBParameter("@ACC_NAME", objAcctMaster.AccountName));
            paramCollection.Add(new DBParameter("@ACC_SHORTNAME", objAcctMaster.ShortName));
            paramCollection.Add(new DBParameter("@ACC_PRINTNAME", objAcctMaster.PrintName));
            paramCollection.Add(new DBParameter("@ACC_LedgerType", objAcctMaster.LedgerType));

            paramCollection.Add(new DBParameter("@ACC_MultiCurr", objAcctMaster.MultiCurrency, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_Group", objAcctMaster.Group));
            paramCollection.Add(new DBParameter("@ACC_OpBal", objAcctMaster.OPBal, System.Data.DbType.Int32));
            paramCollection.Add(new DBParameter("@ACC_PrevYearBal", objAcctMaster.PrevYearBal));
            paramCollection.Add(new DBParameter("@ACC_DrCrOpenBal", objAcctMaster.DrCrOpeningBal));


            paramCollection.Add(new DBParameter("@ACC_DrCrPrevBal", objAcctMaster.DrCrOpeningBal));
            paramCollection.Add(new DBParameter("@ACC_MaintainBitwise", objAcctMaster.MaintainBillwiseAccounts, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_ActivateInterestCal", objAcctMaster.ActivateInterestCal, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_CreditDays", objAcctMaster.CreditDays));
            paramCollection.Add(new DBParameter("@ACC_CreditLimit", objAcctMaster.CreditLimit));

            paramCollection.Add(new DBParameter("@ACC_TypeofBuissness", objAcctMaster.TypeofBuissness));
            paramCollection.Add(new DBParameter("@ACC_Transport", objAcctMaster.Transport));
            paramCollection.Add(new DBParameter("@ACC_Station", objAcctMaster.Station));
            paramCollection.Add(new DBParameter("@ACC_SpecifyDefaultSaleType", objAcctMaster.specifyDefaultSaleType, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_DefaultSaleType", objAcctMaster.DefaultSaleType));

            paramCollection.Add(new DBParameter("@ACC_FreezeSaleType", objAcctMaster.FreezeSaleType));
            paramCollection.Add(new DBParameter("@ACC_SpecifyDefaultPurType", objAcctMaster.SpecifyDefaultPurType, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_DefaultPurcType", objAcctMaster.DefaultPurcType));
            paramCollection.Add(new DBParameter("@ACC_LockSalesType", objAcctMaster.LockSalesType, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_LockPurcType", objAcctMaster.LockPurchaseType, System.Data.DbType.Boolean));

            paramCollection.Add(new DBParameter("@ACC_address1", objAcctMaster.address1));
            paramCollection.Add(new DBParameter("@ACC_address2", objAcctMaster.address2));
            paramCollection.Add(new DBParameter("@ACC_Address3", objAcctMaster.address3));
            paramCollection.Add(new DBParameter("@ACC_Address4", objAcctMaster.address4));
            paramCollection.Add(new DBParameter("@ACC_State", objAcctMaster.State));

            paramCollection.Add(new DBParameter("@ACC_TelephoneNumber", objAcctMaster.TelephoneNumber));
            paramCollection.Add(new DBParameter("@ACC_Fax", objAcctMaster.Fax));
            paramCollection.Add(new DBParameter("@ACC_MobileNumber", objAcctMaster.MobileNumber));
            paramCollection.Add(new DBParameter("@ACC_email", objAcctMaster.email));
            paramCollection.Add(new DBParameter("@ACC_Website", objAcctMaster.WebSite));

            paramCollection.Add(new DBParameter("@ACC_enablemailquery", objAcctMaster.enablemailquery, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_enableSMSquery", objAcctMaster.enableSMSquery, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_contactperson", objAcctMaster.contactperson));
            paramCollection.Add(new DBParameter("@ACC_ITPanNumber", objAcctMaster.ITPanNumber));
            paramCollection.Add(new DBParameter("@ACC_LSTNumber", objAcctMaster.LstNumber));

            paramCollection.Add(new DBParameter("@ACC_CSTNumber", objAcctMaster.CSTNumber));
            paramCollection.Add(new DBParameter("@ACC_TIN", objAcctMaster.TIN));
            paramCollection.Add(new DBParameter("@ACC_ServiceTax", objAcctMaster.ServiceTaxNumber));
            paramCollection.Add(new DBParameter("@ACC_BankAccountNumber", objAcctMaster.BankAccountNumber));
            paramCollection.Add(new DBParameter("@ACC_IECode", objAcctMaster.IECode));

            paramCollection.Add(new DBParameter("@ACC_CreatedBy", "admin"));
            paramCollection.Add(new DBParameter("@ACC_DEFAULT_CHEQUE_FORMAT", ""));
            paramCollection.Add(new DBParameter("@ENABLE_CHEQUE_PRINTING", true, System.Data.DbType.Boolean));
            paramCollection.Add(new DBParameter("@ACC_Cheque_PrintName", objAcctMaster.ChequePrintName));


            Query =
                "INSERT INTO accountmaster (`Acc_DbName`,`ACC_NAME`,`ACC_SHORTNAME`,`ACC_PRINTNAME`,`ACC_LedgerType`,`ACC_MultiCurr`,`ACC_Group`,`ACC_OpBal`," +
                "`ACC_PrevYearBal`,`ACC_DrCrOpenBal`,`ACC_DrCrPrevBal`,`ACC_MaintainBitwise`,`ACC_ActivateInterestCal`,`ACC_CreditDays`,`ACC_CreditLimit`,`ACC_TypeofBuissness`," +
                "`ACC_Transport`,`ACC_Station`,`ACC_SpecifyDefaultSaleType`,`ACC_DefaultSaleType`,`ACC_FreezeSaleType`,`ACC_SpecifyDefaultPurType`,`ACC_DefaultPurcType`," +
                "`ACC_LockSalesType`,`ACC_LockPurcType`,`ACC_address1`,`ACC_address2`,`ACC_Address3`,`ACC_Address4`,`ACC_State`,`ACC_TelephoneNumber,`ACC_Fax`,`ACC_MobileNumber`," +
                "`ACC_email`,`ACC_Website`,`ACC_enablemailquery`,`ACC_enableSMSquery`,`ACC_contactperson`,`ACC_ITPanNumber`,`ACC_LSTNumber`,`ACC_CSTNumber`,`ACC_TIN`," +
                "`ACC_ServiceTax`,`ACC_BankAccountNumber`,`ACC_IECode`,`ACC_CreatedBy`,`ACC_DEFAULT_CHEQUE_FORMAT`,`ENABLE_CHEQUE_PRINTING`,`ACC_Cheque_PrintName`)" +
                "VALUES(@Acc_DbName,@ACC_NAME,@ACC_SHORTNAME,@ACC_PRINTNAME,@ACC_LedgerType,@ACC_MultiCurr,@ACC_Group,@ACC_OpBal,@ACC_PrevYearBal,@ACC_DrCrOpenBal," +
                "@ACC_DrCrPrevBal,@ACC_MaintainBitwise,@ACC_ActivateInterestCal,@ACC_CreditDays,@ACC_CreditLimit,@ACC_TypeofBuissness," +
                "@ACC_Transport,@ACC_Station,@ACC_SpecifyDefaultSaleType,@ACC_DefaultSaleType,@ACC_FreezeSaleType,@ACC_SpecifyDefaultPurType,@ACC_DefaultPurcType," +
                "@ACC_LockSalesType,@ACC_LockPurcType,@ACC_address1,@ACC_address2,@ACC_Address3,@ACC_Address4,@ACC_State,@ACC_TelephoneNumber,@ACC_Fax,@ACC_MobileNumber," +
                "@ACC_email,@ACC_Website,@ACC_enablemailquery,@ACC_enableSMSquery,@ACC_contactperson,@ACC_ITPanNumber,@ACC_LSTNumber,@ACC_CSTNumber,@ACC_TIN," +
                "@ACC_ServiceTax,@ACC_BankAccountNumber,@ACC_IECode,@ACC_CreatedBy,@ACC_DEFAULT_CHEQUE_FORMAT,@ENABLE_CHEQUE_PRINTING,@ACC_Cheque_PrintName)";


            return(_dbHelper.ExecuteNonQuery(Query, paramCollection) > 0);
        }
        public async Task <ServiceResponseModel <IEnumerable <AccountMasterModel> > > SearchAccountByCode(AccountMasterModel editAccountMasterModel)
        {
            ServiceResponseModel <IEnumerable <AccountMasterModel> > serviceResponse = new ServiceResponseModel <IEnumerable <AccountMasterModel> >();
            IEnumerable <AccountMaster> dbAccountMaster = await UnitOfWork.AccountMasters.FindAsync(a =>
                                                                                                    a.CompCode == editAccountMasterModel.CompCode &&
                                                                                                    a.AccYear == editAccountMasterModel.AccYear &&
                                                                                                    a.AccountId.StartsWith(editAccountMasterModel.AccountId));



            IEnumerable <AccountMasterModel> accountMasterModel = _mapper.Map <IEnumerable <AccountMasterModel> >(dbAccountMaster);

            serviceResponse.Data = accountMasterModel;
            return(serviceResponse);
        }
        public async Task <ServiceResponseModel <IEnumerable <AccountMasterModel> > > GetAll(AccountMasterModel accountMasterModel)
        {
            ServiceResponseModel <IEnumerable <AccountMasterModel> > serviceResponse = new ServiceResponseModel <IEnumerable <AccountMasterModel> >();
            IEnumerable <AccountMaster> dbAccountMasters = await UnitOfWork.AccountMasters.FindAsync(a =>
                                                                                                     a.CompCode == accountMasterModel.CompCode &&
                                                                                                     a.AccYear == accountMasterModel.AccYear);

            IEnumerable <AccountMasterModel> accountMasterModelAll = _mapper.Map <IEnumerable <AccountMasterModel> >(dbAccountMasters);

            serviceResponse.Data = accountMasterModelAll;

            return(serviceResponse);
        }
Example #15
0
        private void FillAccountInfo()
        {
            objAccount = accMaster.GetListofAccountByAccountId(groupId);

            if (groupId == 0)
            {
                tbxName.Focus();
                laCtrlUpdate.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
                laCtrlDelete.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
                laCtrlSave.Visibility   = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
                return;
            }
            //objAccount.AccountId = Convert.ToInt32(dr["Ac_ID"]);
            tbxName.Text                      = objAccount.AccountName;
            tbxAlias.Text                     = objAccount.ShortName;
            tbxPrintname.Text                 = objAccount.PrintName;
            cbxLedgertype.SelectedItem        = objAccount.LedgerType.ToString();
            cbxMulticurrency.SelectedItem     = (objAccount.MultiCurrency) ? "Y" : "N";
            cbxGroupname.SelectedItem         = objAccount.Group.ToString();
            tbxOpbal.Text                     = objAccount.OPBal.ToString();
            tbxPrevyearbal.Text               = objAccount.PrevYearBal.ToString();
            cbxCrDr.SelectedItem              = objAccount.DrCrOpeningBal.ToString();
            cbxPrevCrDr.SelectedItem          = objAccount.DrCrPrevBal.ToString();
            cbxMaintainBalancing.SelectedItem = objAccount.MaintainBillwiseAccounts ? "Y" : "N";
            //objAccount.ActivateInterestCal = Convert.ToBoolean(dr["ACC_ActivateInterestCal"]);
            cbxAllocateAmount.SelectedItem = objAccount.AllocateAmountItems ? "Y" : "N";
            tbxCreditdaysforSale.Text      = objAccount.CreditDaysforSale.ToString();
            tbxCreditdaysforPurc.Text      = objAccount.CreditDaysforPurchase.ToString();
            //objAccount.TypeofDealer = dr["ACC_TypeofDealer"].ToString();
            //objAccount.TypeofBuissness = dr["ACC_TypeofBuissness"].ToString();
            tbxTransport.Text = objAccount.Transport.ToString();
            tbxStation.Text   = objAccount.Station.ToString();
            cbxSpecifydefaultSale.SelectedItem     = (objAccount.specifyDefaultSaleType) ? "Y" : "N";
            cbxDefaultsaletype.SelectedItem        = objAccount.DefaultSaleType.ToString();
            cbxFreezesaletype.SelectedItem         = objAccount.FreezeSaleType ? "Y" : "N";
            cbxSpecifydefaultPurcType.SelectedItem = objAccount.SpecifyDefaultPurType ? "Y" : "N";
            cbxDefaultPurcType.SelectedItem        = objAccount.DefaultPurcType.ToString();
            cbxFreezePurcType.SelectedItem         = objAccount.FreezePurcType ? "Y" : "N";
            //objAccount.LockSalesType = Convert.ToBoolean(dr["ACC_LockSalesType"]);
            //objAccount.LockPurchaseType = Convert.ToBoolean(dr["ACC_LockPurcType"]);
            tbxAddress.Text  = objAccount.address.ToString();
            tbxAddress1.Text = objAccount.address1.ToString();
            tbxAddress2.Text = objAccount.address2.ToString();
            tbxAddress3.Text = objAccount.address3.ToString();
            //tbxArea.Text = objAccount.area.ToString();
            tbxTelno.Text         = objAccount.TelephoneNumber.ToString();
            cbxState.SelectedItem = objAccount.State.ToString();
            tbxFax.Text           = objAccount.Fax.ToString();
            tbxMobileno.Text      = objAccount.MobileNumber.ToString();
            tbxEmail.Text         = objAccount.email.ToString();
            //objAccount.WebSite = dr["ACC_Website"].ToString();
            tbxEmailQuery.SelectedItem = objAccount.enablemailquery ? "Y" : "N";
            tbxSMSQuery.SelectedItem   = objAccount.enableSMSquery ? "Y" : "N";
            tbxContactPerson.Text      = objAccount.contactperson.ToString();
            tbxITpan.Text      = objAccount.ITPanNumber.ToString();
            tbxLstno.Text      = objAccount.LstNumber.ToString();
            tbxCstno.Text      = objAccount.CSTNumber;
            tbxTin.Text        = objAccount.TIN;
            tbxDlno1.Text      = objAccount.DLNO1;
            tbxNo1.Text        = objAccount.No1;
            tbxServicetax.Text = objAccount.ServiceTaxNumber.ToString();
            tbxlbtno.Text      = objAccount.LBTNumber.ToString();
            //objAccount.BankAccountNumber = dr["ACC_BankAccountNumber"].ToString();
            tbxIecode.Text                 = objAccount.IECode.ToString();
            tbxWard.Text                   = objAccount.Ward.ToString();
            tbxChequePrintName.Text        = objAccount.ChequePrintName.ToString();
            tbxInterestPay.Text            = objAccount.InterestRatePayable.ToString();
            tbxInterestrateReceviable.Text = objAccount.InterestRateReceivable.ToString();
            laCtrlUpdate.Visibility        = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
            laCtrlDelete.Visibility        = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
            laCtrlSave.Visibility          = DevExpress.XtraLayout.Utils.LayoutVisibility.OnlyInCustomization;
            tbxName.Focus();
        }