コード例 #1
0
ファイル: SaleGasServiceBLL.cs プロジェクト: tuanly/SGM
        public string ValidateGasStationLogin(string stGasStationID, string stGasStationMacAddress)
        {
            GasStationDAL dalGasStation = new GasStationDAL();
            DataTransfer  response      = dalGasStation.ValidateGasStationLogin(stGasStationID, stGasStationMacAddress);

            if (response.ResponseCode == DataTransfer.RESPONSE_CODE_SUCCESS)
            {
                SystemAdminDAL dalSystemAdmin = new SystemAdminDAL();
                DataTransfer   responseAdmin  = dalSystemAdmin.GetCurrentPrice(SystemAdminDTO.GAS_TYPE_ALL);
                response.ResponseCurrentPriceGas92  = responseAdmin.ResponseCurrentPriceGas92;
                response.ResponseCurrentPriceGas95  = responseAdmin.ResponseCurrentPriceGas95;
                response.ResponseCurrentPriceGasDO  = responseAdmin.ResponseCurrentPriceGasDO;
                response.ResponseDataSystemAdminDTO = responseAdmin.ResponseDataSystemAdminDTO;

                GasStoreDAL  dalGasStore      = new GasStoreDAL();
                DataTransfer responseGasStore = dalGasStore.GetGasStoreFromGasStation(stGasStationID);
                response.ResponseDataGasStoreDTO    = responseGasStore.ResponseDataGasStoreDTO;
                response.ResponseGasStoreGas92Total = responseGasStore.ResponseDataGasStoreDTO.GasStoreGas92Total;
                response.ResponseGasStoreGas95Total = responseGasStore.ResponseDataGasStoreDTO.GasStoreGas95Total;
                response.ResponseGasStoreGasDOTotal = responseGasStore.ResponseDataGasStoreDTO.GasStoreGasDOTotal;
            }


            return(JSonHelper.ConvertObjectToJSon(response));
        }
コード例 #2
0
ファイル: AdminServiceBLL.cs プロジェクト: tuanly/SGM
        public string GetCurrentPrice(int iGasType)
        {
            SystemAdminDAL dalSystemAd = new SystemAdminDAL();
            DataTransfer   response    = dalSystemAd.GetCurrentPrice(iGasType);

            return(JSonHelper.ConvertObjectToJSon(response));
        }
コード例 #3
0
ファイル: AdminServiceBLL.cs プロジェクト: tuanly/SGM
        public string UpdateSystemPrice(String jsonSysAdminDTO)
        {
            DataTransfer   dataInput   = JSonHelper.ConvertJSonToObject(jsonSysAdminDTO);
            SystemAdminDAL dalSystemAd = new SystemAdminDAL();
            DataTransfer   response    = dalSystemAd.UpdateSystemAdminPrice(dataInput.ResponseDataSystemAdminDTO);

            return(JSonHelper.ConvertObjectToJSon(response));
        }
コード例 #4
0
ファイル: SaleGasServiceBLL.cs プロジェクト: tuanly/SGM
        public string GasBuying(String jsonSaleGasDTO)
        {
            DataTransfer   dataInput   = JSonHelper.ConvertJSonToObject(jsonSaleGasDTO);
            SystemAdminDAL dalSystemAd = new SystemAdminDAL();
            SaleGasDTO     saleGasDTO  = dataInput.ResponseDataSaleGasDTO;
            DataTransfer   response    = GasBuyingAddSaleGas(saleGasDTO);

            if (response.ResponseCode == DataTransfer.RESPONSE_CODE_SUCCESS)
            {
                response = GasBuyingUpdateCard(saleGasDTO.CardID, saleGasDTO.SaleGasCardMoneyAfter, saleGasDTO.SaleGasCardMoneySaving);
                if (response.ResponseCode == DataTransfer.RESPONSE_CODE_SUCCESS)
                {
                    response = GasBuyingUpdateGasStore(saleGasDTO);
                }
            }

            return(JSonHelper.ConvertObjectToJSon(response));
        }
コード例 #5
0
ファイル: AdminServiceBLL.cs プロジェクト: tuanly/SGM
        public string UpdateAdminAccount(string admin, string admin_new, string pwd)
        {
            SystemAdminDAL dalSysAdmin = new SystemAdminDAL();
            DataTransfer   response    = new DataTransfer();
            bool           res         = dalSysAdmin.UpdateAdminAccount(admin, admin_new, pwd);

            if (res == true)
            {
                response.ResponseCode     = DataTransfer.RESPONSE_CODE_SUCCESS;
                response.ResponseErrorMsg = SGMText.SYS_ADMIN_CHANGE_SUCCESS;
            }
            else
            {
                response.ResponseCode     = DataTransfer.RESPONSE_CODE_FAIL;
                response.ResponseErrorMsg = SGMText.SYS_ADMIN_CHANGE_FAIL;
            }
            return(JSonHelper.ConvertObjectToJSon(response));
        }
コード例 #6
0
ファイル: AdminServiceBLL.cs プロジェクト: tuanly/SGM
        public string ValidateAdminLogin(string admin, string pwd)
        {
            SystemAdminDAL dalSysAdmin = new SystemAdminDAL();
            DataTransfer   response    = new DataTransfer();
            SystemAdminDTO dto         = dalSysAdmin.GetSystemAdminInfo(admin, pwd);

            if (dto != null)
            {
                response.ResponseCode = DataTransfer.RESPONSE_CODE_SUCCESS;
                response.ResponseDataSystemAdminDTO = dto;
            }
            else
            {
                response.ResponseCode     = DataTransfer.RESPONSE_CODE_FAIL;
                response.ResponseErrorMsg = SGMText.ADMIN_LOGON_ERROR;
            }
            return(JSonHelper.ConvertObjectToJSon(response));
        }