Ejemplo n.º 1
0
        public int validation_pass(center_tb aCenterTb)
        {
            var highScores = from ocenterTb in  db.center_tb
                             where ocenterTb.centerName == aCenterTb.centerName
                             where ocenterTb.password == aCenterTb.password
                             select ocenterTb;
            int i = highScores.Count();

            if (i != 1)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
Ejemplo n.º 2
0
        public string getCenterNamebyCenterId(int str)
        {
            center_tb aTb        = new center_tb();
            string    name       = "";
            var       highScores = from ocenterTb in db.center_tb
                                   where ocenterTb.centerId == str
                                   select ocenterTb;

            if (highScores.Count() == 1)
            {
                foreach (var VAR1 in highScores)
                {
                    name = VAR1.centerName;
                }
            }
            return(name);
        }
Ejemplo n.º 3
0
        public List <center_tb> get_centerdata()
        {
            List <center_tb> aCenterTbs = new List <center_tb>();
            var highScores = db.center_tb;

            foreach (var VAR1 in highScores)
            {
                center_tb aCenterTb = new center_tb();
                aCenterTb.centerId     = VAR1.centerId;
                aCenterTb.centerName   = VAR1.centerName;
                aCenterTb.districtID   = VAR1.districtID;
                aCenterTb.districtName = VAR1.districtName;
                aCenterTb.thanaID      = VAR1.thanaID;
                aCenterTb.thanaName    = VAR1.thanaName;
                aCenterTbs.Add(aCenterTb);
            }

            return(aCenterTbs);
        }
Ejemplo n.º 4
0
        public int getcenterid(center_tb aCenterTb)
        {
            var highScores = from ocenterTb in db.center_tb
                             where ocenterTb.centerName == aCenterTb.centerName
                             where ocenterTb.password == aCenterTb.password
                             select ocenterTb;
            int i = highScores.Count();
            int c = 0;

            foreach (var VAR1 in highScores)
            {
                c = VAR1.centerId;
            }

            if (i == 1)
            {
                return(c);
            }
            return(0);
        }
Ejemplo n.º 5
0
 public void insert_data(center_tb aCenterTb)
 {
     db.center_tb.Add(aCenterTb);
     db.SaveChanges();
 }