public static bool IsDelete(string myObject) { return(MyRule.Check(MyRule.EnumRule.AllowDelete, myObject)); }
public static bool IsImport(string myObject) { return(MyRule.Check(MyRule.EnumRule.AllowImport, myObject)); }
public static string Insert(SqlConnection myConnection) { string str = MyRule.Insert(myConnection, MyRule.m_Goup_ID, MyRule.m_Object_ID, MyRule.m_Rule_ID, MyRule.m_AllowAdd, MyRule.m_AllowDelete, MyRule.m_AllowEdit, MyRule.m_AllowAccess, MyRule.m_AllowPrint, MyRule.m_AllowExport, MyRule.m_AllowImport, MyRule.m_Active); return(str); }
public static bool IsAdd(string myObject) { return(MyRule.Check(MyRule.EnumRule.AllowAdd, myObject)); }
public static string Get(SqlConnection myConnection) { return(MyRule.Get(myConnection, MyRule.Goup_ID, MyRule.Object_ID)); }
public static string Get(SqlTransaction myTransaction) { return(MyRule.Get(myTransaction, MyRule.Goup_ID, MyRule.Object_ID)); }
public static bool Exist(SqlTransaction myTransaction) { return(MyRule.Exist(myTransaction, MyRule.m_Goup_ID, MyRule.m_Object_ID)); }
public static bool Check(string myObject) { return(MyRule.Check(MyRule.EnumRule.All, myObject)); }
public static string Delete(SqlTransaction myTransaction) { return(MyRule.Delete(MyRule.m_Goup_ID, MyRule.m_Object_ID)); }
public static bool Exist() { return(MyRule.Exist(MyRule.m_Goup_ID, MyRule.m_Object_ID)); }
public static string Delete(SqlConnection myConnection) { return(MyRule.Delete(myConnection, MyRule.m_Goup_ID, MyRule.m_Object_ID)); }
public static string Delete() { return(MyRule.Delete(MyRule.m_Goup_ID, MyRule.m_Object_ID)); }
public static string CreateKey() { return(MyRule.CreateKey("")); }
public static bool IsPrint(string myObject) { return(MyRule.Check(MyRule.EnumRule.AllowPrint, myObject)); }
public static string Get() { return(MyRule.Get(MyRule.Goup_ID, MyRule.Object_ID)); }
public static string Update(SqlTransaction myTransaction) { string str = MyRule.Update(myTransaction, MyRule.m_Goup_ID, MyRule.m_Object_ID, MyRule.m_Rule_ID, MyRule.m_AllowAdd, MyRule.m_AllowDelete, MyRule.m_AllowEdit, MyRule.m_AllowAccess, MyRule.m_AllowPrint, MyRule.m_AllowExport, MyRule.m_AllowImport, MyRule.m_Active); return(str); }
//public static void AddCombo(System.Windows.Forms.ComboBox combo) //{ // MyLib.TableToComboBoxcombo, MyRule.GetList(), "SYS_USER_RULEName", "SYS_USER_RULEID"); //} //public static void AddComboAll(System.Windows.Forms.ComboBox combo) //{ // DataTable dataTable = new DataTable(); // dataTable = MyRule.GetList(); // DataRow dataRow = dataTable.NewRow(); // dataRow["SYS_USER_RULEID"] = "All"; // dataRow["SYS_USER_RULEName"] = "Tất cả"; // dataTable.Rows.InsertAt(dataRow, 0); // MyLib.TableToComboBox(combo, dataTable, "SYS_USER_RULEName", "SYS_USER_RULEID"); //} public static bool Check(MyRule.EnumRule rule, string myObject) { bool allowAccess; if (!(MyRule.Get(MyLogin.RoleId, myObject) != "OK")) { switch (rule) { case MyRule.EnumRule.AllowAccess: { allowAccess = MyRule.AllowAccess; break; } case MyRule.EnumRule.AllowAdd: { allowAccess = MyRule.AllowAdd; break; } case MyRule.EnumRule.AllowDelete: { allowAccess = MyRule.AllowDelete; break; } case MyRule.EnumRule.AllowEdit: { allowAccess = MyRule.AllowEdit; break; } case MyRule.EnumRule.AllowPrint: { allowAccess = MyRule.AllowPrint; break; } case MyRule.EnumRule.AllowExport: { allowAccess = MyRule.AllowExport; break; } case MyRule.EnumRule.AllowImport: { allowAccess = MyRule.AllowImport; break; } default: { allowAccess = true; break; } } } else { allowAccess = false; } return(allowAccess); }