Exemplo n.º 1
0
        public static ArrayList GetReqs()
        {
            ArrayList ReqList = new ArrayList();

            Connections con           = new Connections();
            string      strConnString = con.GetConnString();

            using (SqlConnection SqlCon = new SqlConnection(strConnString))
            {
                SqlCommand SqlComm = new SqlCommand("", SqlCon);
                SqlCon.Open();

                string query = string.Format("SELECT * FROM account_req ORDER BY req_no DESC");
                SqlComm.CommandText = query;
                SqlDataReader reader = SqlComm.ExecuteReader();

                while (reader.Read())
                {
                    int      req_no        = reader.GetInt32(0);
                    string   account_type  = reader.GetString(1);
                    string   sub_account   = reader.GetString(2);
                    string   title         = reader.GetString(3);
                    string   fname         = reader.GetString(4);
                    string   mname         = reader.GetString(5);
                    string   lname         = reader.GetString(6);
                    string   address       = reader.GetString(7);
                    string   pin           = reader.GetString(8);
                    int      state         = reader.GetInt32(9);
                    int      city          = reader.GetInt32(10);
                    int      branch        = reader.GetInt32(11);
                    string   gender        = reader.GetString(12);
                    string   maritalStatus = reader.GetString(13);
                    DateTime birthdate     = reader.GetDateTime(14);
                    string   email         = reader.GetString(15);
                    string   phone_no      = reader.GetString(16);
                    string   mob_no        = reader.GetString(17);
                    string   aadhaar_no    = reader.GetString(18);
                    DateTime req_date      = reader.GetDateTime(19);
                    string   status        = reader.GetString(20);

                    CustReq custReq = new CustReq(req_no, account_type, sub_account, title, fname, mname, lname, address, pin, state, city, branch, gender, maritalStatus, birthdate, email, phone_no, mob_no, aadhaar_no, req_date, status);
                    ReqList.Add(custReq);
                }
                return(ReqList);
            }
        }
Exemplo n.º 2
0
        public static CustReq GetCustReqAllDataById(int CustReqId)
        {
            Connections con           = new Connections();
            string      strConnString = con.GetConnString();

            using (SqlConnection SqlCon = new SqlConnection(strConnString))
            {
                SqlCommand SqlComm = new SqlCommand("", SqlCon);
                SqlCon.Open();

                string query = string.Format("SELECT req_no, account_type, sub_account, title, fname, mname, lname, address, pin, StateName, CityName, branch_name, gender, maritalStatus, birthdate, email, phone_no, mob_no, aadhaar_no, req_date, status FROM account_req JOIN BranchStates ON StateID=state JOIN BranchCities ON CityID=city JOIN branch_details ON branch_code=branch WHERE req_no='{0}'", CustReqId);
                SqlComm.CommandText = query;
                SqlDataReader reader      = SqlComm.ExecuteReader();
                CustReq       ReqDataById = null;

                while (reader.Read())
                {
                    int      req_no        = reader.GetInt32(0);
                    string   account_type  = reader.GetString(1);
                    string   sub_account   = reader.GetString(2);
                    string   title         = reader.GetString(3);
                    string   fname         = reader.GetString(4);
                    string   mname         = reader.GetString(5);
                    string   lname         = reader.GetString(6);
                    string   address       = reader.GetString(7);
                    string   pin           = reader.GetString(8);
                    string   state         = reader.GetString(9);
                    string   city          = reader.GetString(10);
                    string   branch        = reader.GetString(11);
                    string   gender        = reader.GetString(12);
                    string   maritalStatus = reader.GetString(13);
                    DateTime birthdate     = reader.GetDateTime(14);
                    string   email         = reader.GetString(15);
                    string   phone_no      = reader.GetString(16);
                    string   mob_no        = reader.GetString(17);
                    string   aadhaar_no    = reader.GetString(18);
                    DateTime req_date      = reader.GetDateTime(19);
                    string   status        = reader.GetString(20);

                    ReqDataById = new CustReq(req_no, account_type, sub_account, title, fname, mname, lname, address, pin, state, city, branch, gender, maritalStatus, birthdate, email, phone_no, mob_no, aadhaar_no, req_date, status);
                }
                return(ReqDataById);
            }
        }