Esempio n. 1
0
        public bool ProfileUpdate(Query_DB cdbe)
        {
            string query = string.Format("update UserData set [Name]='{0}',[Email]='{1}',[Mobile]='{2}',[Address]='{3}'  where [id]={4}", cdbe.NAME, cdbe.USER_EMAIL, cdbe.MOBILE, cdbe.ADDRESS, cdbe.ID);

            if (b1.NonQuery(query) == 1)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        public bool CartAdd(Query_DB cdb, String token, int cid)
        {
            bool   temp  = false;
            String query = String.Format("insert into Cart values({0}+1,{1},'{2}',{3},'{4}','{5}')", GetMaxID("Cart"), cdb.ID, DateTime.Now.ToString(), cid, "0", token);

            if (b1.NonQuery(query) == 1)
            {
                temp = true;
            }
            return(temp);
        }
Esempio n. 3
0
        public bool TestDriveAdd(Query_DB cdb, int cid)
        {
            bool   temp  = false;
            String query = String.Format("insert into TestDrive values({0}+1,{1},{2},'{3}','{4}')", GetMaxID("TestDrive"), cdb.ID, cid, "0", DateTime.Now.ToString());

            if (b1.NonQuery(query) == 1)
            {
                temp = true;
            }
            return(temp);
        }
Esempio n. 4
0
        public bool CreateUser(Query_DB cdb)
        {
            bool   temp  = false;
            String query = String.Format("insert into UserData values('{0}','{1}','{2}','{3}','{4}',{5},{6}+1)", cdb.NAME, cdb.USER_EMAIL, cdb.MOBILE, cdb.PASSWORD, cdb.ADDRESS, cdb.USER_TYPE, GetMaxID("UserData"));

            if (b1.NonQuery(query) == 1)
            {
                temp = true;
            }
            return(temp);
        }
Esempio n. 5
0
        public bool FeedbackAdd(Query_DB cdb, String msg)
        {
            bool   temp  = false;
            String query = String.Format("insert into Feedback values({0}+1,{1},'{2}')", GetMaxID("Feedback"), cdb.ID, msg);

            if (b1.NonQuery(query) == 1)
            {
                temp = true;
            }
            return(temp);
        }
Esempio n. 6
0
        public bool VerifyAddUser(Query_DB cdb)
        {
            string          query = string.Format("select count(*) from UserData where Email='{0}' and Password = '******' and UserType = 1", cdb.USER_EMAIL, cdb.PASSWORD);
            OleDbDataReader rec   = b1.SelectQuery(query);

            while (rec.Read())
            {
                if (rec[0].ToString().Equals("1"))
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 7
0
        public bool CheckUser(Query_DB cdb)
        {
            bool            temp  = false;
            String          query = String.Format("select count(*) from UserData where Email='{0}'", cdb.USER_EMAIL);
            OleDbDataReader rec   = b1.SelectQuery(query);

            while (rec.Read())
            {
                if (Convert.ToInt32(rec[0].ToString()) >= 1)
                {
                    temp = true;
                }
            }
            return(temp);
        }
Esempio n. 8
0
        public Query_DB GetUserDetails(Query_DB cdb)
        {
            string          query = string.Format("select id,Name,Email,Mobile,Password,Address,UserType from UserData where Email='{0}' and Password = '******'", cdb.USER_EMAIL, cdb.PASSWORD);
            OleDbDataReader rec   = b1.SelectQuery(query);

            while (rec.Read())
            {
                if (!rec[0].ToString().Equals(" ") && Convert.ToInt32(rec[0].ToString()) >= 1)
                {
                    Query_DB utb = new Query_DB();
                    utb.ID         = Convert.ToInt32(rec[0].ToString());
                    utb.NAME       = rec[1].ToString();
                    utb.USER_EMAIL = rec[2].ToString();
                    utb.MOBILE     = rec[3].ToString();
                    utb.PASSWORD   = rec[4].ToString();
                    utb.ADDRESS    = rec[5].ToString();
                    utb.USER_TYPE  = Convert.ToInt32(rec[6].ToString());
                    return(utb);
                }
            }
            return(null);
        }
Esempio n. 9
0
 public CarView(Code.Query_DB cdbe, String a, String b, String c, String d, String f, String g, String h, String i, String j)
 {
     InitializeComponent();
     utb   = cdbe;
     pb    = a;
     model = i;
     try
     {
         main.Image    = Image.FromFile(System.IO.Directory.GetCurrentDirectory().Replace("\\bin\\Debug", "") + "\\image\\" + a + "\\1.jpg");
         P1.Image      = Image.FromFile(System.IO.Directory.GetCurrentDirectory().Replace("\\bin\\Debug", "") + "\\image\\" + a + "\\1.jpg");
         P2.Image      = Image.FromFile(System.IO.Directory.GetCurrentDirectory().Replace("\\bin\\Debug", "") + "\\image\\" + a + "\\2.jpg");
         P3.Image      = Image.FromFile(System.IO.Directory.GetCurrentDirectory().Replace("\\bin\\Debug", "") + "\\image\\" + a + "\\3.jpg");
         P4.Image      = Image.FromFile(System.IO.Directory.GetCurrentDirectory().Replace("\\bin\\Debug", "") + "\\image\\" + a + "\\4.jpg");
         Mile.Text     = b;
         Fuel.Text     = c;
         Tank.Text     = d;
         Engine.Text   = f;
         Capacity.Text = g;
         Speed.Text    = h;
         CName.Text    = i;
         CPrice.Text   = j;
     }
     catch (Exception e) { erro.Text = e.Message; }
 }
Esempio n. 10
0
 public ChangeProfile(Code.Query_DB cdbe)
 {
     InitializeComponent();
     utb = cdbe;
 }
Esempio n. 11
0
 public TestDrive(Code.Query_DB cdbe, int car)
 {
     InitializeComponent();
     utb   = cdbe;
     carid = car;
 }
Esempio n. 12
0
 public MyOrder(Code.Query_DB cdbe)
 {
     InitializeComponent();
     utb = cdbe;
 }
Esempio n. 13
0
 public Admin(Code.Query_DB cdbe)
 {
     InitializeComponent();
     utb = cdbe;
 }
Esempio n. 14
0
 public Home(Code.Query_DB cdbe)
 {
     cdb = cdbe;
     InitializeComponent();
 }
Esempio n. 15
0
 public MyTestDrive(Code.Query_DB cdbe)
 {
     InitializeComponent();
     cdb = cdbe;
 }
Esempio n. 16
0
 public ChangePassword(Code.Query_DB cdbe)
 {
     InitializeComponent();
     utb = cdbe;
 }
Esempio n. 17
0
 public SendFeedback(Code.Query_DB cd)
 {
     InitializeComponent();
     cdb = cd;
 }