Beispiel #1
0
 public void EditUserType(int id, string type, string username)
 {
     if (id == 0)
     {
         var info = new advt_users_type();
         info.username = username;
         info.type     = type;
         Data.advt_users_type.Insert_advt_users_type(info, null, new string[] { "id" });
     }
     else
     {
         var ids  = Convert.ToInt32(id);
         var info = Data.advt_users_type.Get_advt_users_type(ids);
         info.type = type;
         Data.advt_users_type.Update_advt_users_type(info, null, new string[] { "id" });
     }
     GetUser();
 }
Beispiel #2
0
        public ActionResult EditUser(advt_users_type model)
        {
            var result = false;
            var isuser = Data.advt_users_type.Get_advt_users_type(model.username);

            if (isuser == null)
            {
                advt_users_type v = new advt_users_type();
                v.username = model.username;
                var info = Data.advt_users_type.Insert_advt_users_type(v, null, new string[] { "id" });
            }
            var list = Data.advt_users_type.Update_advt_users_type_username(model);

            if (list == 1)
            {
                result = true;
            }
            return(Json(new { result = result }, JsonRequestBehavior.AllowGet));
        }