Ejemplo n.º 1
0
        public string SaveRatings(RatingModel model)
        {
            string          msg = "";
            ShomaRMEntities db  = new ShomaRMEntities();

            if (model.TenantId != 0)
            {
                var saveRatings = new tbl_Rating()
                {
                    TenantId = model.TenantId,
                    Rating   = model.Rating
                };
                db.tbl_Rating.Add(saveRatings);
                db.SaveChanges();

                msg = "Ratings Saved Successfully";
            }
            db.Dispose();
            return(msg);
        }
Ejemplo n.º 2
0
        public ActionResult Create(tbl_Rating obj, int id)
        {
            try
            {
                // TODO: Add insert logic here
                List <object> lst = new List <object>();
                lst.Add(obj.R_Name);
                lst.Add(obj.H_Id = id);


                object[] allitems = lst.ToArray();
                int      output   = db.Database.ExecuteSqlCommand("insert into tbl_Rating (r_name,H_id)values(@p0,@p1)", allitems);
                if (output > 0)
                {
                    ViewBag.msg = "Hostel is Rated";
                }
                return(View());
            }
            catch
            {
                return(View());
            }
        }