Exemplo n.º 1
0
 private void detach_BidaTableMaps(BidaTableMap entity)
 {
     this.SendPropertyChanging();
     entity.BidaTabledb = null;
 }
Exemplo n.º 2
0
 partial void DeleteBidaTableMap(BidaTableMap instance);
Exemplo n.º 3
0
 partial void UpdateBidaTableMap(BidaTableMap instance);
Exemplo n.º 4
0
 partial void InsertBidaTableMap(BidaTableMap instance);
Exemplo n.º 5
0
        public void addmess(string a)
        {
            Thread.Sleep(100);

            string[] amount = new string[10];
            amount = a.Split(',');
            if (amount[0].ToString() == "IP")
            {
                textBoxIP.Text = amount[0].ToString() + amount[1].ToString() + amount[2].ToString();
                // Senditem("0");
                dbfromsqlDataContext db = new dbfromsqlDataContext(lg.Connection);
                var selectcus           = from i in db.GetTable <Customersdb>()
                                          where i.Cuser == amount[1].ToString() && i.Cpass == amount[2].ToString()
                                          select i;
                if (selectcus.Count() > 0)
                {
                    var selectbida = from j in db.GetTable <BidaTabledb>()
                                     select j;
                    string i = "IP,1,";
                    foreach (var zz in selectcus)
                    {
                        i += "," + zz.CustomerID.ToString() + "," + zz.CName.ToString();
                    }
                    foreach (var z in selectbida)
                    {
                        i += "," + z.BidaTableID.ToString();
                    }
                    Senditem(i);
                }
                else
                {
                    string i = "IP,0";
                    Senditem(i);
                }
            }
            else if (amount[0].ToString() == "DK")
            {
                dbfromsqlDataContext db  = new dbfromsqlDataContext(lg.Connection);
                Customersdb          cus = new Customersdb();
                cus.CName     = amount[1].ToString();
                cus.Cphone    = amount[2].ToString();
                cus.CBrithday = Convert.ToDateTime(amount[3].ToString());
                cus.Csex      = amount[4].ToString();
                cus.Cuser     = amount[5].ToString();
                cus.Cpass     = amount[6].ToString();
                db.Customersdbs.InsertOnSubmit(cus);
                db.SubmitChanges();
                var selectcus = from i in db.GetTable <Customersdb>()
                                where i.Cuser == amount[5].ToString() && i.Cpass == amount[6].ToString()
                                select i;
                if (selectcus.Count() > 0)
                {
                    string i = "DK,1";
                    Senditem(i);
                }
                else
                {
                    string i = "DK,0";
                    Senditem(i);
                }
            }
            else if (amount[0].ToString() == "BT")
            {
                dbfromsqlDataContext db = new dbfromsqlDataContext(lg.Connection);
                var selectbidass        = from i in db.GetTable <BidaTableMap>()
                                          where i.BidaTableID == Convert.ToInt32(amount[1].ToString())
                                          select i;
                if (selectbidass.Count() > 0)
                {
                    string i = "BT,1,";
                    foreach (var z in selectbidass)
                    {
                        i += "," + z.TimeBegin.ToString() + "," + z.TimeEnd.ToString();
                    }
                    Senditem(i);
                }
                else
                {
                    string i = "BT,0";
                    Senditem(i);
                }
            }
            else if (amount[0].ToString() == "DB")
            {
                dbfromsqlDataContext db  = new dbfromsqlDataContext(lg.Connection);
                BidaTableMap         map = new BidaTableMap();
                map.BidaTableID = Convert.ToInt32(amount[1].ToString());
                map.Status      = Convert.ToInt32(amount[2].ToString());
                map.Customer    = Convert.ToInt32(amount[3].ToString());
                map.TimeBegin   = Convert.ToDateTime(amount[4].ToString());
                map.TimeEnd     = Convert.ToDateTime(amount[5].ToString());
                db.BidaTableMaps.InsertOnSubmit(map);
                db.SubmitChanges();
                var selectmap = from i in db.GetTable <BidaTableMap>()
                                where i.BidaTableID == Convert.ToInt32(amount[1].ToString()) && i.TimeBegin ==
                                Convert.ToDateTime(amount[4].ToString()) && i.TimeEnd ==
                                Convert.ToDateTime(amount[5].ToString()) &&
                                i.Customer == Convert.ToInt32(amount[3].ToString())

                                select i;
                if (selectmap.Count() > 0)
                {
                    string i = "DB,1";
                    Senditem(i);
                }
                else
                {
                    string i = "DB,0";
                    Senditem(i);
                }
            }
        }
 private void attach_BidaTableMaps(BidaTableMap entity)
 {
     this.SendPropertyChanging();
     entity.Customersdb = this;
 }