Exemplo n.º 1
0
 public User(int id, string fName, string mName, string lName, string imgPath, string degree, string email, string summery, bool administrator)
 {
     db                 = new DBServices();
     this.id            = id;
     this.fName         = fName;
     this.mName         = mName;
     this.lName         = lName;
     this.imgPath       = imgPath;
     this.degree        = degree;
     this.email         = email;
     this.summery       = summery;
     this.administrator = administrator;
 }
Exemplo n.º 2
0
        // GET: Inventory
        public ActionResult Inventory()
        {
            var inventory = new List <InventoryModel>();

            var invData = DBServices.GetTblView("exce sampleprocedure");

            if (invData.Count > 0)
            {
                inventory = DBServices.ToList <InventoryModel>(invData);
            }

            return(View(inventory));
        }
Exemplo n.º 3
0
        public static int DeleteItem(int userid, int itemid)
        {
            int check = DBServices.DeleteItem(userid, itemid);

            if (check == 0)
            {
            }
            else
            {
            }

            return(check);
        }
 private void buttonGuardar_Click(object sender, EventArgs e)
 {
     DBServices = new DBServices();
     Models.Person p = new Models.Person();
     p.Born  = fborn.Value;
     p.Cuit  = textBoxCuit.Text;
     p.Dni   = textBoxDNI.Text;
     p.Genre = genre.Text;
     p.Name  = textBoxNombre.Text;
     p.Tipo  = ype.Text;
     DBServices.AddPersona(p);
     this.Close();
 }
Exemplo n.º 5
0
        public static int UpdateItem(string itemid, string userId, string userName, string userPhone, string itemType, string itemName, string city, string region, string itemAbout, string itemImg)
        {
            int check = DBServices.UpdateItem(itemid, userId, userName, userPhone, itemType, itemName, city, region, itemAbout, itemImg);

            if (check == 1)
            {
            }
            else
            {
            }

            return(check);
        }
Exemplo n.º 6
0
        public static string GetPlacesFromFavorite(int userid)
        {
            List <Place> p = DBServices.GetPlacesFromFavorite(userid);

            if (p != null)
            {
                return(new JavaScriptSerializer().Serialize(p));
            }
            else
            {
                return(new JavaScriptSerializer().Serialize("No Places"));
            }
        }
Exemplo n.º 7
0
        public static string GetPlacesHouses(string rb)
        {
            List <Place> p = DBServices.GetPlacesHouses(rb);

            if (p != null)
            {
                return(new JavaScriptSerializer().Serialize(p));
            }
            else
            {
                return(new JavaScriptSerializer().Serialize("No Places"));
            }
        }
Exemplo n.º 8
0
        public static String RegisterWithGoogle(string firstName, string lastName, string email, string password)
        {
            User u = DBServices.RegisterWithGoogle(firstName, lastName, email, password);

            if (u != null)
            {
            }
            else
            {
            }

            return(new JavaScriptSerializer().Serialize(u));
        }
Exemplo n.º 9
0
        public static string EditProfile(string id, string firstName, string lastName, string email, string password)
        {
            User u = DBServices.EditProfile(id, firstName, lastName, email, password);

            if (u != null)
            {
            }
            else
            {
            }

            return(new JavaScriptSerializer().Serialize(u));
        }
Exemplo n.º 10
0
        public static String Register(string firstName, string lastName, string email, string password, string gender, string birthday)
        {
            User u = DBServices.Register(firstName, lastName, email, password, gender, birthday);

            if (u != null)
            {
            }
            else
            {
            }

            return(new JavaScriptSerializer().Serialize(u));
        }
Exemplo n.º 11
0
    public List <Product> getProducts()
    {
        DBServices     datab = new DBServices();
        List <Product> pl    = datab.getList();
        List <Product> pl1   = new List <Product>();

        foreach (Product p in pl)
        {
            pl1.Add(p);
        }

        return(pl1);
    }
Exemplo n.º 12
0
        public ActionResult GetQueryResults(QueryResults model)
        {
            var inventory = new List <InventoryModel>();

            var invData = DBServices.GetTblView("exce sampleprocedure");

            if (invData.Count > 0)
            {
                inventory = DBServices.ToList <InventoryModel>(invData);
            }

            return(PartialView("_QueryResults", inventory));
        }
Exemplo n.º 13
0
        public static int AddReminder(string itemName, int userid, string token)
        {
            int check = DBServices.AddReminder(itemName, userid, token);

            if (check == 1)
            {
            }
            else
            {
            }

            return(check);
        }
Exemplo n.º 14
0
        public static string GetItemTypes()
        {
            List <ItemTypes> itemTypes = DBServices.GetItemTypes();

            if (itemTypes != null)
            {
                return(new JavaScriptSerializer().Serialize(itemTypes));
            }
            else
            {
                return(new JavaScriptSerializer().Serialize("No itemType"));
            }
        }
Exemplo n.º 15
0
        public static int InsertFavorite(int userid, int itemid)
        {
            int check = DBServices.InsertFavorite(userid, itemid);

            if (check == 1)
            {
            }
            else
            {
            }

            return(check);
        }
Exemplo n.º 16
0
        public static string GetAssociationTypes()
        {
            List <AssociationType> associationTypes = DBServices.GetAssociationTypes();

            if (associationTypes != null)
            {
                return(new JavaScriptSerializer().Serialize(associationTypes));
            }
            else
            {
                return(new JavaScriptSerializer().Serialize("No AssociationTypes"));
            }
        }
Exemplo n.º 17
0
        public static string Login(string email, string password)
        {
            User u = DBServices.Login(email, password);

            if (u != null)
            {
            }
            else
            {
            }

            return(new JavaScriptSerializer().Serialize(u));
        }
Exemplo n.º 18
0
        public static string UploadImage(string base64, string imageName, int userid)
        {
            string check = DBServices.UploadImage(base64, imageName, userid);

            if (check != null)
            {
            }
            else
            {
            }

            return(new JavaScriptSerializer().Serialize(check));
        }
Exemplo n.º 19
0
        public static string GetReminders(int userid)
        {
            List <Reminder> p = DBServices.GetReminders(userid);

            if (p != null)
            {
                return(new JavaScriptSerializer().Serialize(p));
            }
            else
            {
                return(new JavaScriptSerializer().Serialize("No reminder"));
            }
        }
Exemplo n.º 20
0
        public static string GetItemsByID(int userid)
        {
            List <Item> p = DBServices.GetItemsByID(userid);

            if (p != null)
            {
                return(new JavaScriptSerializer().Serialize(p));
            }
            else
            {
                return(new JavaScriptSerializer().Serialize("No Items"));
            }
        }
Exemplo n.º 21
0
        public static int DeleteReminder(int userid, string itemName)
        {
            int check = DBServices.DeleteReminder(userid, itemName);

            if (check == 0)
            {
            }
            else
            {
            }

            return(check);
        }
Exemplo n.º 22
0
        public ActionResult Delete()
        {
            RemoveAllRoom(Request["id"]);
            SqlConnection con     = new SqlConnection();
            SqlCommand    command = new SqlCommand();

            con = DBServices.openConnection();
            command.Connection  = con;
            command.CommandText = @"Delete from Motel where ID=@Id ";
            command.Parameters.Add("@Id", SqlDbType.VarChar, 10).Value = Request["id"];
            command.ExecuteNonQuery();
            con.Close();
            return(RedirectToAction("ViewMotel", "Motel"));
        }
Exemplo n.º 23
0
    public Manager readSpecificUserManager(double username_id, string password)
    {
        DBServices dbs    = new DBServices();
        Manager    DBuser = dbs.readSpecificUserManagerDB(username_id, password, "studentDBConnectionString", "Manager");

        if (DBuser == null)
        {
            return(null);
        }
        else
        {
            return(DBuser);
        }
    }
Exemplo n.º 24
0
        public ActionResult Update()
        {
            SqlConnection con     = new SqlConnection();
            SqlCommand    command = new SqlCommand();

            con = DBServices.openConnection();
            command.Connection  = con;
            command.CommandText = @"Update Motel set Information =@Info where  ID=@Id";
            command.Parameters.Add("@Info", SqlDbType.NVarChar, 500).Value = (string)Request["UpdateInformation"];
            command.Parameters.Add("@Id", SqlDbType.VarChar, 10).Value     = Request["id"];
            command.ExecuteNonQuery();
            con.Close();
            return(RedirectToAction("ViewMotel", "Motel"));
        }
Exemplo n.º 25
0
        public List <List <OrderData> > Get([FromBody] int[] spaces)
        {
            List <List <OrderData> > orderdata = new List <List <OrderData> >();
            DBServices dbs   = new DBServices();
            string     today = DateTime.Today.ToString("dd/MM/yyyy");

            foreach (int item in spaces)
            {
                List <OrderData> o = dbs.readOrdersDataBySpaceId(item);

                orderdata.Add(o);
            }
            return(orderdata);
        }
Exemplo n.º 26
0
    public List <string> readfromyDS(string tablNeame)
    {
        DBServices dbs = new DBServices();

        dbs = dbs.ReadFromDataBase("DBConnectionString", tablNeame);
        List <string> readfromyDS = new List <string>();

        foreach (DataRow dr in dbs.dt.Rows)
        {
            string drdbs = (string)dr[tablNeame + "_Name"];
            readfromyDS.Add(drdbs.ToString());
        }
        return(readfromyDS);
    }
Exemplo n.º 27
0
    public List <Student> getStuListCAL(string id, string date)
    {
        DBServices     dbs     = new DBServices();
        List <Student> stuList = dbs.getStuListCAL(id, date);

        if (stuList == null)
        {
            return(null);
        }
        else
        {
            return(stuList);
        }
    }
Exemplo n.º 28
0
    public ActualLesson readSpecificActualLesson(int actl_num)
    {
        DBServices   dbs    = new DBServices();
        ActualLesson DBuser = dbs.readSpecificActualLesson(actl_num, "studentDBConnectionString", "ActualLesson");

        if (DBuser == null)
        {
            return(null);
        }
        else
        {
            return(DBuser);
        }
    }
Exemplo n.º 29
0
        public ActionResult Edit(int recipeid)
        {
            Recipe recipe = DBServices.GetRecipe(recipeid);

            if (recipe.Owner.Equals(this.User?.Identity.GetUserId()))
            {
                ViewBag.Recipe = recipe;

                return(View());
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
Exemplo n.º 30
0
    public Tigburim getTigburById(string tigID)
    {
        int        TigID    = Convert.ToInt16(tigID);
        DBServices dbs      = new DBServices();
        Tigburim   DBTigbur = dbs.getTigburById(TigID, "studentDBConnectionString", "Lesson");

        if (DBTigbur == null)
        {
            return(null);
        }
        else
        {
            return(DBTigbur);
        }
    }