Ejemplo n.º 1
0
        public ActionResult guest_show(int id)
        {
            Shop_adder s = new Shop_adder();

            s.indx  = new List <int>();
            s.it    = new List <Itemadder>();
            s.sv    = new List <string>();
            s.categ = new List <string>();
            s.shp   = new Shop();


            var q1 = from a in sdb.shopit where a.S_Id == id select a;

            foreach (var sh in q1)
            {
                int   x  = sh.T_Id;
                var   t  = from b in itdb.item where b.T_Id == x select b;
                Items it = t.First();

                s.sv.Add(it.T_Name);
                s.indx.Add(it.T_Id);
                int        c  = it.Cat_Id;
                var        m  = from a in catdb.category where a.Cat_Id == c select a;
                Categories ca = m.First();
                s.categ.Add(ca.Name);
            }
            var q2 = from a in db.shop where a.S_Id == id select a;

            s.shp       = q2.First();
            s.shop_name = q2.First().About;
            s.shop_id   = id;
            return(View(s));
        }
Ejemplo n.º 2
0
        public ActionResult shop_it(int id)
        {
            if (Session["swi"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            if (Session["swi"] != null && Session["isadmin"] == "yes")
            {
                return(RedirectToAction("Index", "Customers"));
            }

            Cust_ShopDBContext csd = new Cust_ShopDBContext();
            var qwee = from o in csd.cust_shop where o.S_Id == id select o;
            int opq  = 0;

            foreach (var item in qwee)
            {
                opq = item.Cust_Id;
            }
            int swint = (int)Session["swi"];

            if (opq != swint)
            {
                return(RedirectToAction("Index", "Customers"));
            }

            Shop_adder s = new Shop_adder();

            s.categ   = new List <string>();
            s.indx    = new List <int>();
            s.it      = new List <Itemadder>();
            s.sv      = new List <string>();
            s.shop_id = id;
            var q1 = from a in sdb.shopit where a.S_Id == id select a;

            foreach (var sh in q1)
            {
                int   x  = sh.T_Id;
                var   t  = from b in itdb.item where b.T_Id == x select b;
                Items it = t.First();

                s.sv.Add(it.T_Name);
                s.indx.Add(it.T_Id);
                int        c  = it.Cat_Id;
                var        m  = from a in catdb.category where a.Cat_Id == c select a;
                Categories ca = m.First();
                s.categ.Add(ca.Name);
            }
            var q2 = from a in db.shop where a.S_Id == id select a;

            s.shop_name = q2.First().About;
            return(View(s));
        }
Ejemplo n.º 3
0
        public ActionResult detmap(int id)
        {
            Shop_adder s  = new Shop_adder();
            var        sh = from a in db.shop where a.S_Id == id select a;
            Shop       sp = sh.First();

            string[] x = sp.Location.Split('|');
            s.first     = x[0];
            s.secound   = x[1];
            s.shop_id   = id;
            s.shop_name = sp.About;



            return(View(s));
        }
Ejemplo n.º 4
0
        // POST: /Shop/Edit/5

        public ActionResult Prop(Shop xx)
        {
            if (Session["swi"] == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            if (Session["swi"] != null && Session["isadmin"] == "yes")
            {
                return(RedirectToAction("Index", "Customers"));
            }
            Shop_adder s  = new Shop_adder();
            var        sh = from a in db.shop where a.S_Id == xx.S_Id select a;
            Shop       sp = sh.First();

            string[] x = sp.Location.Split('|');
            s.first     = x[0];
            s.secound   = x[1];
            s.shop_id   = xx.S_Id;
            s.shop_name = sp.About;



            return(View(s));
        }