コード例 #1
0
        public List <AirtelManagementModel> FilterAirtelDetails(string SearchString, int DateId, string CityName)
        {
            Database    _db     = DatabaseFactory.CreateDatabase("CCIDBConnection");
            IDataReader _reader = _db.ExecuteReader("[dbo].FilterAirtelDetails", SearchString, DateId, CityName);
            List <AirtelManagementModel> _list = new List <AirtelManagementModel>();

            while (_reader.Read())
            {
                AirtelManagementModel _model = new AirtelManagementModel();
                _model.MobileAcNumber      = Convert.ToInt32(_reader["AccountNo"].ToString());
                _model.AirtelNumber        = Convert.ToInt64(_reader["AirtelNumber"].ToString());
                _model.OneTime             = Convert.ToInt16(_reader["OneTimeCharges"].ToString());
                _model.MonthlyCharges      = (float)Convert.ToDouble(_reader["MonthlyCharges"].ToString());
                _model.CallCharges         = (float)Convert.ToDouble(_reader["CallCharges"].ToString());
                _model.ValueAddedServices  = (float)Convert.ToDouble(_reader["ValueAddedServices"].ToString());
                _model.MobileInternetUsage = (float)Convert.ToDouble(_reader["MobileInternetUsage"].ToString());
                _model.Roaming             = (float)Convert.ToDouble(_reader["Roaming"].ToString());
                _model.Discounts           = (float)Convert.ToDouble(_reader["Discounts"].ToString());
                _model.Taxes        = (float)Convert.ToDouble(_reader["Taxes"]);
                _model.TotalCharges = (float)Convert.ToDouble(_reader["TotalCharges"].ToString());
                _list.Add(_model);
            }
            _reader.Close();
            return(_list);
        }
コード例 #2
0
        public List <AirtelManagementModel> ViewAirtelDetails()
        {
            Database    _db     = DatabaseFactory.CreateDatabase("CCIDBConnection");
            IDataReader _reader = _db.ExecuteReader("[dbo].ViewAirtelDetails");
            List <AirtelManagementModel> list = new List <AirtelManagementModel>();

            while (_reader.Read())
            {
                AirtelManagementModel _model = new AirtelManagementModel();
                _model.MobileAcNumber      = Convert.ToInt64(_reader["AccountNo"]);
                _model.AirtelNumber        = Convert.ToInt64(_reader["AirtelNumber"]);
                _model.OneTime             = Convert.ToInt16(_reader["OneTimeCharges"]);
                _model.MonthlyCharges      = (float)Convert.ToDouble(_reader["MonthlyCharges"]);
                _model.CallCharges         = (float)Convert.ToDouble(_reader["CallCharges"]);
                _model.ValueAddedServices  = (float)Convert.ToDouble(_reader["ValueAddedServices"]);
                _model.MobileInternetUsage = (float)Convert.ToDouble(_reader["MobileInternetUsage"]);
                _model.Roaming             = (float)Convert.ToDouble(_reader["Roaming"]);
                _model.Discounts           = (float)Convert.ToDouble(_reader["Discounts"]);
                _model.Taxes        = (float)Convert.ToDouble(_reader["Taxes"]);
                _model.TotalCharges = (float)Convert.ToDouble(_reader["TotalCharges"]);
                _model.ImportDateId = Convert.ToInt32(_reader["ImportId"]);
                //_model.UploadedDate = (DateTime)(_reader["UploadedDate"]);
                //_model.DateOfCreation = _reader["ForWhichMonth"].ToString();
                list.Add(_model);
            }
            _reader.Close();
            return(list);
        }
コード例 #3
0
        public int InsertImportDate(AirtelManagementModel _model)
        {
            Database  _db     = DatabaseFactory.CreateDatabase("CCIDBConnection");
            DbCommand command = _db.GetStoredProcCommand("dbo.AddImportDates");

            _db.AddInParameter(command, "@UploadedDate", DbType.Date, _model.UploadedDate);
            _db.AddInParameter(command, "@ForWhichMonth", DbType.Date, _model.DateOfCreation);
            _db.AddOutParameter(command, "@DateId", DbType.Int32, 32);
            _db.ExecuteNonQuery(command);
            var columnid = Convert.ToInt32(_db.GetParameterValue(command, "@DateId").ToString());

            return(columnid);
        }
コード例 #4
0
        public bool SaveData(AirtelManagementModel _model)
        {
            Database _db = DatabaseFactory.CreateDatabase("CCIDBConnection");

            _db.ExecuteNonQuery("[dbo].SaveDataIntoDataBase", _model.MobileAcNumber,
                                _model.AirtelNumber,
                                _model.OneTime,
                                _model.MonthlyCharges,
                                _model.CallCharges,
                                _model.ValueAddedServices,
                                _model.MobileInternetUsage,
                                _model.Roaming,
                                _model.Discounts,
                                _model.Taxes,
                                _model.TotalCharges,
                                _model.WhoUploaded,
                                _model.ImportDateId
                                //_model.DateId
                                //_model.UploadedDate,
                                //_model.DateOfCreation
                                );
            return(true);
        }