Example #1
0
        public void Orders_insert(int id, string title, string desc, int vehicle, int price, int maxnumber, int beginning, int destination, string date, string time, int status)
        {
            Connectionclass cs = new Connectionclass();
            string          connectionstring = cs.Select_connection();
            SqlDataReader   read;
            SqlConnection   conn = new SqlConnection(connectionstring);

            conn.Open();
            SqlCommand cmd = new SqlCommand("Orders_insert", conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@ID", SqlDbType.BigInt).Value          = id;
            cmd.Parameters.Add("@OrderName", SqlDbType.NVarChar).Value = title;
            cmd.Parameters.Add("@OrderDesc", SqlDbType.NVarChar).Value = desc;
            cmd.Parameters.Add("@Vehicle", SqlDbType.BigInt).Value     = vehicle;
            cmd.Parameters.Add("@price", SqlDbType.BigInt).Value       = price;
            cmd.Parameters.Add("@maxnumber", SqlDbType.BigInt).Value   = maxnumber;
            cmd.Parameters.Add("@beginning", SqlDbType.BigInt).Value   = beginning;
            cmd.Parameters.Add("@destination", SqlDbType.BigInt).Value = destination;
            cmd.Parameters.Add("@date", SqlDbType.NVarChar).Value      = date;
            cmd.Parameters.Add("@time", SqlDbType.NVarChar).Value      = time;
            cmd.Parameters.Add("@time", SqlDbType.NVarChar).Value      = status;
            read = cmd.ExecuteReader();
            read.Close();
            conn.Close();
        }
Example #2
0
        public void Emp_update(Int64 id, string name, string family, string father, string username, string password, string codemelli, string bdate, Int64 bprovince, Int64 bcity, Int64 bpart, Int64 bvillage, string sex, Int64 lprovince, Int64 lcity, Int64 lpart, Int64 lvillage, int madrak, int tell, int status)
        {
            Connectionclass cs = new Connectionclass();
            string          connectionstring = cs.Select_connection();
            SqlDataReader   read;
            SqlConnection   conn = new SqlConnection(connectionstring);

            conn.Open();
            SqlCommand cmd = new SqlCommand("Employee_Update", conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@EmployeeID", SqlDbType.BigInt).Value     = Convert.ToInt64("1");
            cmd.Parameters.Add("@FirstName", SqlDbType.NVarChar).Value    = name;
            cmd.Parameters.Add("@LastName", SqlDbType.NVarChar).Value     = family;
            cmd.Parameters.Add("@FatherName", SqlDbType.NVarChar).Value   = father;
            cmd.Parameters.Add("@Username", SqlDbType.NVarChar).Value     = username;
            cmd.Parameters.Add("@Password", SqlDbType.NVarChar).Value     = password;
            cmd.Parameters.Add("@NationalCode", SqlDbType.NVarChar).Value = codemelli;
            cmd.Parameters.Add("@BirthDate", SqlDbType.NVarChar).Value    = bdate;
            cmd.Parameters.Add("@Gender", SqlDbType.NVarChar).Value       = sex;
            cmd.Parameters.Add("@Phone", SqlDbType.Int).Value             = tell;
            cmd.Parameters.Add("@status", SqlDbType.Int).Value            = status;
            cmd.Parameters.Add("@MadrakCode", SqlDbType.Int).Value        = madrak;
            cmd.Parameters.Add("@BProvinceCode", SqlDbType.BigInt).Value  = bprovince;
            cmd.Parameters.Add("@BCityCode", SqlDbType.BigInt).Value      = bcity;
            cmd.Parameters.Add("@BPartCode", SqlDbType.BigInt).Value      = bpart;
            cmd.Parameters.Add("@BVillageCode", SqlDbType.BigInt).Value   = bvillage;
            cmd.Parameters.Add("@LProvinceCode", SqlDbType.BigInt).Value  = lprovince;
            cmd.Parameters.Add("@LCityCode", SqlDbType.BigInt).Value      = lcity;
            cmd.Parameters.Add("@LPartCode", SqlDbType.BigInt).Value      = lpart;
            cmd.Parameters.Add("@LVillageCode", SqlDbType.BigInt).Value   = lvillage;
            read = cmd.ExecuteReader();
            read.Close();
            conn.Close();
        }
Example #3
0
        public DataSet Orders_GetList()
        {
            Connectionclass cs = new Connectionclass();
            string          connectionstring = cs.Select_connection();
            SqlConnection   con = new SqlConnection(connectionstring);
            SqlDataAdapter  da  = new SqlDataAdapter("Orders_GetList", con);

            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            DataSet ds = new DataSet();

            da.Fill(ds, "Orders");
            return(ds);
        }
Example #4
0
        public DataSet Orders_GetList_By_Type(int type)
        {
            Connectionclass cs = new Connectionclass();
            string          connectionstring = cs.Select_connection();
            SqlConnection   con = new SqlConnection(connectionstring);
            SqlDataAdapter  da  = new SqlDataAdapter("Orders_GetList_By_Type", con);

            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@type", type);
            //cmd.Parameters.Add("@type", SqlDbType.BigInt).Value = type;
            DataSet ds = new DataSet();

            da.Fill(ds, "Orders");
            return(ds);
        }
Example #5
0
        public DataSet Select_Customer(Int64 id)
        {
            Connectionclass cs = new Connectionclass();
            string          connectionstring = cs.Select_connection();
            SqlConnection   con = new SqlConnection(connectionstring);
            SqlDataAdapter  da  = new SqlDataAdapter("Select_Customer", con);

            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@id", id);
            //cmd.Parameters.Add("@type", SqlDbType.BigInt).Value = type;
            DataSet ds = new DataSet();

            da.Fill(ds, "Customer");
            return(ds);
        }
Example #6
0
        public void Orders_delete(int id)
        {
            Connectionclass cs = new Connectionclass();
            string          connectionstring = cs.Select_connection();
            SqlDataReader   read;
            SqlConnection   conn = new SqlConnection(connectionstring);

            conn.Open();
            SqlCommand cmd = new SqlCommand("Orders_Delete", conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@ID", SqlDbType.BigInt).Value = id;
            read = cmd.ExecuteReader();
            read.Close();
            conn.Close();
        }
Example #7
0
        public void OrderHistoryDetails_insert(int Employeeid, int OrderID, int CustomerID, int status)
        {
            Connectionclass cs = new Connectionclass();
            string          connectionstring = cs.Select_connection();
            SqlDataReader   read;
            SqlConnection   conn = new SqlConnection(connectionstring);

            conn.Open();
            SqlCommand cmd = new SqlCommand("OrderHistoryDetails_insert", conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Employeeid", SqlDbType.BigInt).Value = Employeeid;
            cmd.Parameters.Add("@OrderID", SqlDbType.BigInt).Value    = OrderID;
            cmd.Parameters.Add("@CustomerID", SqlDbType.BigInt).Value = CustomerID;
            cmd.Parameters.Add("@status", SqlDbType.BigInt).Value     = status;
            read = cmd.ExecuteReader();
            read.Close();
            conn.Close();
        }