Exemplo n.º 1
0
        public IList <GetAccountDetails> ViewUsers()
        {
            SqlConnection             con = new SqlConnection();
            DataTable                 dt  = new DataTable();
            IList <GetAccountDetails> accountDetailList = new List <GetAccountDetails>();

            try
            {
                int rowCount = 0;
                con.ConnectionString = ConfigurationManager.ConnectionStrings["Bankingsysconn"].ConnectionString;
                con.Open();
                string        getRowNo = Query.getCount;
                SqlCommand    cmd      = new SqlCommand(getRowNo, con);
                SqlDataReader dr       = cmd.ExecuteReader();
                if (dr.Read())
                {
                    rowCount = Convert.ToInt32(dr.GetValue(0));
                }
                dr.Close();
                string        getDetails = Query.selectViewUsers;
                SqlCommand    cmd1       = new SqlCommand(getDetails, con);
                SqlDataReader dr1        = cmd1.ExecuteReader();
                dt.Columns.AddRange(new DataColumn[8] {
                    new DataColumn("Account number", typeof(string)),
                    new DataColumn("Customer name", typeof(string)),
                    new DataColumn("Age", typeof(string)),
                    new DataColumn("Address", typeof(string)),
                    new DataColumn("Email", typeof(string)),
                    new DataColumn("City", typeof(string)),
                    new DataColumn("Gender", typeof(string)),
                    new DataColumn("Account balance", typeof(string))
                });
                while (dr1.Read())
                {
                    GetAccountDetails detail = new GetAccountDetails();

                    detail.AccountNo      = Convert.ToString(dr1["account_no"]);
                    detail.CustomerName   = Convert.ToString(dr1["customer_name"]);
                    detail.Age            = Convert.ToString(dr1["age"]);
                    detail.Address        = Convert.ToString(dr1["address"]);
                    detail.EmailId        = Convert.ToString(dr1["email_id"]);
                    detail.City           = Convert.ToString(dr1["city"]);
                    detail.Gender         = Convert.ToString(dr1["gender"]);
                    detail.AccountBalance = Convert.ToString(dr1["account_balance"]);
                    accountDetailList.Add(detail);
                }
                dr1.Close();
            }

            finally
            {
                con.Close();
            }
            return(accountDetailList);
        }
 public void Default(GetAccountDetailsOutput output)
 {
     GetAccountDetails.Add(output);
 }
Exemplo n.º 3
0
 public void Handle(Application.Boundaries.GetAccountDetails.Output output)
 {
     GetAccountDetails.Add(output);
 }
 public void Default(Application.Boundaries.GetAccountDetails.GetAccountDetailsOutput output)
 {
     GetAccountDetails.Add(output);
 }
 public void Standard(Application.Boundaries.GetAccountDetails.GetAccountDetailsOutput output)
 {
     GetAccountDetails.Add(output);
 }
Exemplo n.º 6
0
        public async Task <ActionResult> Details(GetAccountDetails query)
        {
            var accountDetails = await _queryProcessor.ProcessAsync(query);

            return(View(accountDetails));
        }
 public void Standard(GetAccountDetailsOutput output)
 {
     GetAccountDetails.Add(output);
 }