public ActionResult EditRow(int? id, string Name, string Type, string NickName, string oper)
        {

            if (oper == JqGridOperations.add.ToString())
            {
                Supporter sp = new Supporter() {
                    Name = Name,
                    NickName = NickName,
                    Status = EntityStatuses.Actived.ToString(),
                    Type = string.IsNullOrEmpty(Type)? SupportTypes.Yahoo.ToString() : Type,
                    };
                new SupporterService().Add(sp);
                return Content("true");
            }
            if (oper == JqGridOperations.edit.ToString())
            {
                new SupporterService().Edit(id.Value, NickName, Name);
            }

            if(oper == JqGridOperations.del.ToString()){
                new SupporterService().Delete(id.Value);
            }

            return Content("true");
        }
        public ActionResult EditRow(int? id, string Name, string Type, string NickName, string oper)
        {

            if (oper == JqGridOperations.add.ToString())
            {
                Supporter sp = new Supporter() {
                Name = Name,
                NickName = NickName,
                Status = EntityStatuses.Actived.ToString(),
                Type = Type,
                };
                SupporterService.Add(sp);
                return Content("true");
            }
            if(oper == JqGridOperations.del.ToString()){
                SupporterService.Delete(id.Value);
            }

            return Content("true");
        }
Ejemplo n.º 3
0
 public ActionResult EditSupporter(int id, Supporter supporter)
 {
     DBNLDataContext db = new DBNLDataContext();
     Supporter sp = db.Supporters.Where(p => p.Id == id).SingleOrDefault();
     sp.Name = supporter.Name;
     sp.NickName = supporter.NickName;
     sp.Status = supporter.Status;
     sp.Type = supporter.Type;
     db.SubmitChanges();
     return RedirectToAction("ListSupporter");
 }
Ejemplo n.º 4
0
 public ActionResult DeleteSupporter(Supporter supporter)
 {
     DBNLDataContext db = new DBNLDataContext();
     db.Supporters.DeleteOnSubmit(supporter);
     db.SubmitChanges();
     return RedirectToAction("ListSupporters");
 }
 public ActionResult Create(Supporter supporter)
 {
     new SupporterService().Create(supporter);
     return RedirectToAction("Index");
 }
Ejemplo n.º 6
0
 partial void DeleteSupporter(Supporter instance);
Ejemplo n.º 7
0
 partial void UpdateSupporter(Supporter instance);
Ejemplo n.º 8
0
 partial void InsertSupporter(Supporter instance);