//
        // GET: /Manage/tInstationInfo/Delete/5

        public ActionResult Delete(int id)
        {
            ViewtInstationInfo model = client.GetById(id);

            model.ifDel      = true;
            model.CreateTime = DateTime.Now;
            client.Update(model);
            return(RedirectToAction("Index"));
        }
 public int Add(ViewtInstationInfo model)
 {
     try
     {
         return(tInstationInfoServiceImpl.Add(model));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#3
0
        public List <ViewtInstationInfo> GetByContent(string sContent)
        {
            List <tInstationInfo> list = Repository.GetByContent(sContent);

            List <ViewtInstationInfo> model = new List <ViewtInstationInfo>();

            foreach (var item in list)
            {
                model.Add(ViewtInstationInfo.ToViewModel(item));
            }
            return(model);
        }
示例#4
0
        public List <ViewtInstationInfo> GetPageList(string content, int iType, DateTime?CreateTime, int page, int pagesize, out int count)
        {
            List <tInstationInfo> list = Repository.GetPageList(content, iType, CreateTime, page, pagesize, out count);

            List <ViewtInstationInfo> model = new List <ViewtInstationInfo>();

            foreach (var item in list)
            {
                model.Add(ViewtInstationInfo.ToViewModel(item));
            }
            return(model);
        }
示例#5
0
        public List <ViewtInstationInfo> GetPageList(int uid, int page, int pagesize, out int count)
        {
            List <tInstationInfo> list = Repository.GetPageList(uid, page, pagesize, out count);

            List <ViewtInstationInfo> model = new List <ViewtInstationInfo>();

            foreach (var item in list)
            {
                model.Add(ViewtInstationInfo.ToViewModel(item));
            }
            return(model);
        }
示例#6
0
        public List <ViewtInstationInfo> GetPageListWhereUidAndloginType(int uid, int loginType, out int count)
        {
            List <tInstationInfo> list = Repository.GetPageListWhereUidAndloginType(uid, loginType, out count);

            List <ViewtInstationInfo> model = new List <ViewtInstationInfo>();

            foreach (var item in list)
            {
                model.Add(ViewtInstationInfo.ToViewModel(item));
            }
            return(model);
        }
        //
        // GET: /Manage/tInstationInfo/Details/5

        public ActionResult Details(int id)
        {
            ViewtInstationInfo model = client.GetById(id);

            if (model != null)
            {
                return(View(model));
            }
            else
            {
                return(View());
            }
        }
        public JsonResult Create(ViewtInstationInfo model)
        {
            try
            {
                // TODO: Add insert logic here

                string strUidInfo = "";
                if (!string.IsNullOrEmpty(Request.Form["hidselectType"]))
                {
                    if (Request.Form["hidselectType"].ToString() == "2")
                    {
                        List <ViewYogaUser> listuser = userclient.GetYogaUserPageList(100000).Where(x => x.delState == 0).ToList();
                        strUidInfo = string.Join(",", listuser.Select(a => a.Uid));
                    }
                    else
                    {
                        strUidInfo = Request.Form["hiduserInfo"].ToString().TrimEnd(',');//去掉最后一个字符,
                    }
                }
                if (!string.IsNullOrEmpty(strUidInfo))
                {
                    foreach (var i in strUidInfo.Split(','))
                    {
                        if (!string.IsNullOrEmpty(i))
                        {
                            if (Convert.ToInt32(i) != 10 && Convert.ToInt32(i) != 11)
                            {
                                model.Uid        = Convert.ToInt32(i);
                                model.CreateTime = DateTime.Now;
                                model.ifDel      = false;
                                model.iType      = 2644;
                                model.CreateUser = ConfigurationManager.AppSettings["BACK_POSTER"].ToString();//100316
                                model.loginType  = 0;
                                client.Add(model);
                            }
                        }
                    }
                }

                //return RedirectToAction("Index");
                return(Json(new { code = 0 }));
            }
            catch
            {
                return(Json(new { code = 1 }));
            }
        }
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
                ViewtInstationInfo model = client.GetById(id);
                model.ifDel      = true;
                model.CreateTime = DateTime.Now;
                client.Update(model);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public JsonResult Edit(string hidsContent)
        {
            try
            {
                list = client.GetByContent(hidsContent);

                ViewtInstationInfo model = new ViewtInstationInfo();
                // TODO: Add update logic here

                foreach (ViewtInstationInfo item in list)
                {
                    item.sContent = Request.Form["sContent"].ToString();
                    client.Update(item);
                }

                return(Json(new { code = 0 }));
            }
            catch
            {
                return(Json(new { code = 1 }));
            }
        }
        //
        // GET: /Manage/tInstationInfo/Edit/5

        public ActionResult Edit(int id)
        {
            ViewtInstationInfo model = client.GetById(id);

            return(View(model));
        }
示例#12
0
 public int Update(ViewtInstationInfo model)
 {
     Repository.updateEntity(ViewtInstationInfo.ToEntity(model));
     return(Repository.Save());
 }
示例#13
0
 public ViewtInstationInfo GetByUid(int Uid)
 {
     return(ViewtInstationInfo.ToViewModel(Repository.GetByUid(Uid)));
 }
示例#14
0
 public int Add(ViewtInstationInfo model)
 {
     Repository.Add(ViewtInstationInfo.ToEntity(model));
     return(Repository.Save());
 }