コード例 #1
1
    public bool AddCate(cat catss)
    {

        LQDataContext ctxs = new LQDataContext();
        ctxs.cats.InsertOnSubmit(catss);
        ctxs.SubmitChanges();
        return true;
    }
コード例 #2
1
    public void UpdateCate(cat ca)
    {
        try
        {
            LQDataContext ctxx = new LQDataContext();
            var q = ctxx.cats.Where(d => d.id_cat == ca.id_cat).SingleOrDefault();
            q.cat_name = ca.cat_name;
            ctxx.SubmitChanges();
        }
        catch (Exception ex)
        {

        }
    }
コード例 #3
0
    public bool AddimgProd(img_prod imp)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.img_prods.InsertOnSubmit(imp);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #4
0
 public user_name getUserbyID(int id)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.user_names
              where a.id_user == id
              select a).SingleOrDefault();
     return q;
 }
コード例 #5
0
 public cat getCate(int id)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.cats
              where a.id_cat == id
              select a).SingleOrDefault();
     return q;
 }
コード例 #6
0
    public bool AddCate(cat catss)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.cats.InsertOnSubmit(catss);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #7
0
    public bool AddCart(customer_cart_time ca)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.customer_cart_times.InsertOnSubmit(ca);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #8
0
    public bool AddCustomer(cust ca)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.custs.InsertOnSubmit(ca);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #9
0
    public bool AddimgProd(product_image imp)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.product_images.InsertOnSubmit(imp);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #10
0
    public bool AddProduct(prod pr)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.prods.InsertOnSubmit(pr);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #11
0
    public bool AdddtCart(detail_cart ca)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.detail_carts.InsertOnSubmit(ca);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #12
0
    public bool AddProduct(category_product_detail pr)
    {
        LQDataContext ctxs = new LQDataContext();

        ctxs.category_product_details.InsertOnSubmit(pr);
        ctxs.SubmitChanges();
        return(true);
    }
コード例 #13
0
    public List <prod> getTopProduct(int top)
    {
        LQDataContext ctx  = new LQDataContext();
        var           list = (from t in ctx.prods
                              orderby t.pro_price
                              select t).Take(top);

        return(list.ToList());
    }
コード例 #14
0
    public List <prod> getCateProduct(int cate)
    {
        LQDataContext ctx  = new LQDataContext();
        var           list = (from t in ctx.prods
                              where t.id_cat == cate
                              select t);

        return(list.ToList());
    }
コード例 #15
0
    public List <img_prod> getProdImage(int idprod)
    {
        LQDataContext ctx  = new LQDataContext();
        var           list = (from t in ctx.img_prods
                              where t.id_prod == idprod
                              select t);

        return(list.ToList());
    }
コード例 #16
0
    public cust getCusbyID(int id)
    {
        LQDataContext dm = new LQDataContext();
        var           q  = (from a in dm.custs
                            where a.id_cus == id
                            select a).SingleOrDefault();

        return(q);
    }
コード例 #17
0
    public List <cart> getCustomerCart(int idcus)
    {
        LQDataContext ctx  = new LQDataContext();
        var           list = (from t in ctx.carts
                              where t.id_cus == idcus
                              select t);

        return(list.ToList());
    }
コード例 #18
0
    public List <detail_cart> getDetailCartID(int idcart)
    {
        LQDataContext ctx  = new LQDataContext();
        var           list = (from t in ctx.detail_carts
                              where t.id_cart == idcart
                              select t);

        return(list.ToList());
    }
コード例 #19
0
    public detail_cart getdtCart(int id_Cart)
    {
        LQDataContext dm = new LQDataContext();
        var           q  = (from a in dm.detail_carts
                            where a.id_cart == id_Cart
                            select a).SingleOrDefault();

        return(q);
    }
コード例 #20
0
    public void updatedtCart(detail_cart dtc)
    {
        LQDataContext ctxx = new LQDataContext();
        var           q    = ctxx.detail_carts.Where(d => d.id_dtcart == dtc.id_dtcart).SingleOrDefault();

        q.id_pro   = dtc.id_pro;
        q.quanlity = dtc.quanlity;
        ctxx.SubmitChanges();
    }
コード例 #21
0
    public user_detail getUserbyID(int id)
    {
        LQDataContext dm = new LQDataContext();
        var           q  = (from a in dm.user_details
                            where a.user_id == id
                            select a).SingleOrDefault();

        return(q);
    }
コード例 #22
0
    public prod getProduct(int id)
    {
        LQDataContext dm = new LQDataContext();
        var           q  = (from a in dm.prods
                            where a.id_pro == id
                            select a).SingleOrDefault();

        return(q);
    }
コード例 #23
0
    public user_name getUserbyID(int id)
    {
        LQDataContext dm = new LQDataContext();
        var           q  = (from a in dm.user_names
                            where a.id_user == id
                            select a).SingleOrDefault();

        return(q);
    }
コード例 #24
0
    public img_prod getImage(int id)
    {
        LQDataContext ctx = new LQDataContext();
        var           n   = (from t in ctx.img_prods
                             where t.id_img == id
                             select t).SingleOrDefault();

        return(n);
    }
コード例 #25
0
    public cat getCate(int id)
    {
        LQDataContext dm = new LQDataContext();
        var           q  = (from a in dm.cats
                            where a.id_cat == id
                            select a).SingleOrDefault();

        return(q);
    }
コード例 #26
0
    public category_product_detail getProduct(int id)
    {
        LQDataContext dm = new LQDataContext();
        var           q  = (from a in dm.category_product_details
                            where a.id_pro == id
                            select a).SingleOrDefault();

        return(q);
    }
コード例 #27
0
    public List <category_product_detail> getCateProduct(int cate)
    {
        LQDataContext ctx  = new LQDataContext();
        var           list = (from t in ctx.category_product_details
                              where t.id_cat == cate
                              select t);

        return(list.ToList());
    }
コード例 #28
0
    public img_prod getMainimg(int idprod)
    {
        LQDataContext ctx = new LQDataContext();
        var           azz = (from t in ctx.img_prods
                             where t.id_prod == idprod
                             where t.stt_img == 1
                             select t).SingleOrDefault();

        return(azz);
    }
コード例 #29
0
 public void UpdateCate(category_name ca)
 {
     try
     {
         LQDataContext ctxx = new LQDataContext();
         var           q    = ctxx.category_names.Where(d => d.id_cat == ca.id_cat).SingleOrDefault();
         q.cat_name = ca.cat_name;
         ctxx.SubmitChanges();
     }
     catch (Exception ex)
     {
     }
 }
コード例 #30
0
 public void UpdateCate(cart ca)
 {
     try
     {
         LQDataContext ctxx = new LQDataContext();
         var           q    = ctxx.carts.Where(d => d.id_cart == ca.id_cart).SingleOrDefault();
         q.time_cart = ca.time_cart;
         ctxx.SubmitChanges();
     }
     catch (Exception ex)
     {
     }
 }
コード例 #31
0
 public void SetSttImage(img_prod imp, int mstt)
 {
     try
     {
         LQDataContext ctxx = new LQDataContext();
         var           q    = ctxx.img_prods.Where(d => d.id_img == imp.id_img).SingleOrDefault();
         q.stt_img = mstt;
         ctxx.SubmitChanges();
     }
     catch (Exception ex)
     {
     }
 }
コード例 #32
0
 public void UpdateimgProd(img_prod imp)
 {
     try
     {
         LQDataContext ctxx = new LQDataContext();
         var           q    = ctxx.img_prods.Where(d => d.id_img == imp.id_img).SingleOrDefault();
         q.img_url = imp.img_url;
         ctxx.SubmitChanges();
     }
     catch (Exception ex)
     {
     }
 }
コード例 #33
0
 public void UpdateUserPass(user_detail un)
 {
     try
     {
         LQDataContext ctxx = new LQDataContext();
         var           q    = ctxx.user_details.Where(d => d.user_id == un.user_id).SingleOrDefault();
         q.user_password = un.user_password;
         ctxx.SubmitChanges();
     }
     catch (Exception ex)
     {
     }
 }
コード例 #34
0
 public void UpdateUserPass(user_name un)
 {
     try
     {
         LQDataContext ctxx = new LQDataContext();
         var           q    = ctxx.user_names.Where(d => d.id_user == un.id_user).SingleOrDefault();
         q.password = un.password;
         ctxx.SubmitChanges();
     }
     catch (Exception ex)
     {
     }
 }
コード例 #35
0
    public void UpdateUserPass(user_name un)
    {
        try
        {
            LQDataContext ctxx = new LQDataContext();
            var q = ctxx.user_names.Where(d => d.id_user == un.id_user).SingleOrDefault();
            q.password = un.password;
            ctxx.SubmitChanges();
        }
        catch (Exception ex)
        {

        }
    }
コード例 #36
0
 public int getUser(string name, string pass)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.user_names
              where a.user_name1 == name
              where a.password == pass
              where a.id_usrole == 1
              select a).SingleOrDefault();
     if (q == null)
     {
         return -1;
     }
     else
     {
         return q.id_user;
     }
 }
コード例 #37
0
    public void UpdateUser(user_name un)
    {
        try
        {
            LQDataContext ctxx = new LQDataContext();
            var q = ctxx.user_names.Where(d => d.id_user == un.id_user).SingleOrDefault();
            q.user_name1 = un.user_name1;
            q.usFulname = un.usFulname;
            q.usImg = un.usImg;
            q.usAge = un.usAge;
            q.email = un.email;
            ctxx.SubmitChanges();
        }
        catch (Exception ex)
        {

        }
    }
コード例 #38
0
 public List<cart> getCustomerCart(int idcus)
 {
     LQDataContext ctx = new LQDataContext();
     var list = (from t in ctx.carts
                 where t.id_cus == idcus
                 select t);
     return list.ToList();
 }
コード例 #39
0
 public bool checkalcate(string name)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.cats
              where a.cat_name == name
              select a).SingleOrDefault();
     if (q == null)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #40
0
 public img_prod getMainimg(int idprod)
 {
     LQDataContext ctx = new LQDataContext();
     var azz = (from t in ctx.img_prods
                where t.id_prod == idprod
                where t.stt_img == 1
                select t).SingleOrDefault();
     return azz;
 }
コード例 #41
0
 //all about detail cart
 public List<detail_cart> getAlldtCart()
 {
     LQDataContext ctx = new LQDataContext();
     return ctx.detail_carts.ToList();
 }
コード例 #42
0
    public bool DeleteCustomer(int id)
    {
        try
        {
            LQDataContext dm = new LQDataContext();
            var q = (from a in dm.custs
                     where a.id_cus == id
                     select a).SingleOrDefault();
            dm.custs.DeleteOnSubmit(q);
            dm.SubmitChanges();
            return true;
        }
        catch (Exception ex)
        {
            return false;
        }

    }
コード例 #43
0
    public bool DeleteImgProd(int id)
    {
        try
        {
            LQDataContext dm = new LQDataContext();
            var q = (from a in dm.img_prods
                     where a.id_img == id
                     select a).SingleOrDefault();
            dm.img_prods.DeleteOnSubmit(q);
            dm.SubmitChanges();
            return true;
        }
        catch (Exception ex)
        {
            return false;
        }

    }
コード例 #44
0
    public void UpdateCustomer(cust ca)
    {
        try
        {
            LQDataContext ctxx = new LQDataContext();
            var q = ctxx.custs.Where(d => d.id_cus == ca.id_cus).SingleOrDefault();
            q.cus_name = ca.cus_name;
            q.email = ca.email;
            ctxx.SubmitChanges();
        }
        catch (Exception ex)
        {

        }
    }
コード例 #45
0
 public bool AddCustomer(cust ca)
 {
     LQDataContext ctxs = new LQDataContext();
     ctxs.custs.InsertOnSubmit(ca);
     ctxs.SubmitChanges();
     return true;
 }
コード例 #46
0
    public bool DeletedtCart(int id_dtCart)
    {
        try
        {
            LQDataContext dm = new LQDataContext();
            var q = (from a in dm.detail_carts
                     where a.id_dtcart == id_dtCart
                     select a).SingleOrDefault();
            dm.detail_carts.DeleteOnSubmit(q);
            dm.SubmitChanges();
            return true;
        }
        catch (Exception ex)
        {
            return false;
        }

    }
コード例 #47
0
 public void updatedtCart(detail_cart dtc)
 {
     LQDataContext ctxx = new LQDataContext();
     var q = ctxx.detail_carts.Where(d => d.id_dtcart == dtc.id_dtcart).SingleOrDefault();
     q.id_pro = dtc.id_pro;
     q.quanlity = dtc.quanlity;
     ctxx.SubmitChanges();
 }
コード例 #48
0
 //all about image
 public List<img_prod> getAllimgpro()
 {
     LQDataContext ctx = new LQDataContext();
     return ctx.img_prods.ToList();
 }
コード例 #49
0
 public List<img_prod> getProdImage(int idprod)
 {
     LQDataContext ctx = new LQDataContext();
     var list = (from t in ctx.img_prods
                 where t.id_prod == idprod
                 select t);
     return list.ToList();
 }
コード例 #50
0
 public img_prod getImage(int id)
 {
     LQDataContext ctx = new LQDataContext();
     var n = (from t in ctx.img_prods
              where t.id_img == id
              select t).SingleOrDefault();
     return n;
 }
コード例 #51
0
 public cust getCusbyID(int id)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.custs
              where a.id_cus == id
              select a).SingleOrDefault();
     return q;
 }
コード例 #52
0
 public bool AdddtCart(detail_cart ca)
 {
     LQDataContext ctxs = new LQDataContext();
     ctxs.detail_carts.InsertOnSubmit(ca);
     ctxs.SubmitChanges();
     return true;
 }
コード例 #53
0
 public int checkCus(string name, string email)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.custs
              where a.cus_name == name
              where a.email == email
              select a).SingleOrDefault();
     if (q == null)
     {
         return -1;
     }
     else
     {
         return q.id_cus;
     }
 }
コード例 #54
0
    public void SetSttImage(img_prod imp, int mstt)
    {
        try
        {
            LQDataContext ctxx = new LQDataContext();
            var q = ctxx.img_prods.Where(d => d.id_img == imp.id_img).SingleOrDefault();
            q.stt_img = mstt;
            ctxx.SubmitChanges();
        }
        catch (Exception ex)
        {

        }
    }
コード例 #55
0
    public void UpdateimgProd(img_prod imp)
    {
        try
        {
            LQDataContext ctxx = new LQDataContext();
            var q = ctxx.img_prods.Where(d => d.id_img == imp.id_img).SingleOrDefault();
            q.img_url = imp.img_url;
            ctxx.SubmitChanges();
        }
        catch (Exception ex)
        {

        }
    }
コード例 #56
0
 public List<detail_cart> getDetailCartID(int idcart)
 {
     LQDataContext ctx = new LQDataContext();
     var list = (from t in ctx.detail_carts
                 where t.id_cart == idcart
                 select t);
     return list.ToList();
 }
コード例 #57
0
 public bool checkdtCart(int id_dtCart, int id_proz)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.detail_carts
              where a.id_dtcart == id_dtCart
              where a.id_pro == id_proz
              select a).SingleOrDefault();
     if (q != null)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
コード例 #58
0
 public bool AddimgProd(img_prod imp)
 {
     LQDataContext ctxs = new LQDataContext();
     ctxs.img_prods.InsertOnSubmit(imp);
     ctxs.SubmitChanges();
     return true;
 }
コード例 #59
0
 public detail_cart getdtCart(int id_Cart)
 {
     LQDataContext dm = new LQDataContext();
     var q = (from a in dm.detail_carts
              where a.id_cart == id_Cart
              select a).SingleOrDefault();
     return q;
 }
コード例 #60
0
 //all about category
 public List<cat> getAllCate()
 {
     LQDataContext ctx = new LQDataContext();
     return ctx.cats.ToList();
 }