public void OnEndEdit(DG.Tweening.DOTweenAnimation anim) { InputField field = anim.GetComponent <InputField>(); if (!User.Roles.Contains(role)) { role = roleField.text = _role; anim.onComplete.AddListener(() => { anim.endValueColor = Color.HSVToRGB(120 / 360f, 32 / 255f, 1f); anim.CreateTween(); anim.onComplete.RemoveAllListeners(); }); anim.endValueColor = Color.HSVToRGB(0, 32 / 255f, 1f); anim.CreateTween(); anim.DORestart(); return; } using (SqliteCommand command = new SqliteCommand(Database.DB)) { if (field == usernameField) { command.CommandText = string.Format( "UPDATE hours SET username = \"{0}\" WHERE username = (SELECT username FROM users WHERE role = \"{1}\" AND full_name = \"{2}\");" + "UPDATE leaves SET username = \"{0}\" WHERE username = (SELECT username FROM users WHERE role = \"{1}\" AND full_name = \"{2}\");" + "UPDATE users SET username = \"{0}\" WHERE role = \"{1}\" AND full_name = \"{2}\";", username, role, fullName); } else if (field == roleField) { command.CommandText = string.Format( "UPDATE users SET role = \"{1}\" " + "WHERE username = \"{0}\"" + "AND full_name = \"{2}\"", username, role, fullName); } else if (field == fullNameField) { command.CommandText = string.Format( "UPDATE users SET full_name = \"{2}\" " + "WHERE role = \"{1}\" " + "AND username = \"{0}\"", username, role, fullName); } command.ExecuteNonQuery(); } anim.DORestart(); User.Instance.SetUser(username); }
static int CreateTween(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); DG.Tweening.DOTweenAnimation obj = (DG.Tweening.DOTweenAnimation)ToLua.CheckObject <DG.Tweening.DOTweenAnimation>(L, 1); obj.CreateTween(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }