示例#1
0
        public static List <ClientCheque> Get_All_ClientCheques_UpcomingPayable(int Start_Index, int Max_Rows, string Client_Name)
        {
            List <ClientCheque> ClientCheques = new List <ClientCheque>();
            string        CS  = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
            SqlConnection con = new SqlConnection(CS);
            SqlCommand    cmd = new SqlCommand("Get_All_ClientCheques_UpcomingPayable", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Client_Name", SqlDbType.NVarChar).Value = Client_Name;
            cmd.Parameters.Add("@StartIndex", SqlDbType.Int).Value       = Start_Index;
            cmd.Parameters.Add("@MaxRows", SqlDbType.Int).Value          = Max_Rows;
            con.Open();
            SqlDataReader rdr = cmd.ExecuteReader();

            while (rdr.Read())
            {
                ClientCheque clientCheque = new ClientCheque();
                clientCheque.ClientName   = rdr["ClientName"].ToString();
                clientCheque.Value        = Convert.ToDecimal(rdr["ChequeValue"]);
                clientCheque.ChequeNumber = Convert.ToString(rdr["ChequeNumber"]);
                clientCheque.DueDate      = Convert.ToDateTime(rdr["DueDate"]);
                ClientCheques.Add(clientCheque);
            }
            rdr.Close();
            con.Close();
            return(ClientCheques);
        }
示例#2
0
        public static List <ClientCheque> GetUnPaidClientCheques()
        {
            List <ClientCheque> ClientCheques = new List <ClientCheque>();
            string        CS  = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
            SqlConnection con = new SqlConnection(CS);
            SqlCommand    cmd = new SqlCommand("GetUnPaidClientCheques", con);

            cmd.CommandType = CommandType.StoredProcedure;
            con.Open();
            SqlDataReader rdr = cmd.ExecuteReader();

            while (rdr.Read())
            {
                ClientCheque clientCheque = new ClientCheque();
                clientCheque.ClientName   = rdr["ClientName"].ToString();
                clientCheque.Value        = Convert.ToDecimal(rdr["ChequeValue"]);
                clientCheque.ChequeNumber = Convert.ToString(rdr["ChequeNumber"]);
                clientCheque.DueDate      = Convert.ToDateTime(rdr["DueDate"]);
                ClientCheques.Add(clientCheque);
            }
            rdr.Close();
            con.Close();
            return(ClientCheques);
        }