Exemplo n.º 1
0
 public static bool IsDelete(string myObject)
 {
     return(MyRule.Check(MyRule.EnumRule.AllowDelete, myObject));
 }
Exemplo n.º 2
0
 public static bool IsImport(string myObject)
 {
     return(MyRule.Check(MyRule.EnumRule.AllowImport, myObject));
 }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public static bool IsAdd(string myObject)
 {
     return(MyRule.Check(MyRule.EnumRule.AllowAdd, myObject));
 }
Exemplo n.º 5
0
 public static string Get(SqlConnection myConnection)
 {
     return(MyRule.Get(myConnection, MyRule.Goup_ID, MyRule.Object_ID));
 }
Exemplo n.º 6
0
 public static string Get(SqlTransaction myTransaction)
 {
     return(MyRule.Get(myTransaction, MyRule.Goup_ID, MyRule.Object_ID));
 }
Exemplo n.º 7
0
 public static bool Exist(SqlTransaction myTransaction)
 {
     return(MyRule.Exist(myTransaction, MyRule.m_Goup_ID, MyRule.m_Object_ID));
 }
Exemplo n.º 8
0
 public static bool Check(string myObject)
 {
     return(MyRule.Check(MyRule.EnumRule.All, myObject));
 }
Exemplo n.º 9
0
 public static string Delete(SqlTransaction myTransaction)
 {
     return(MyRule.Delete(MyRule.m_Goup_ID, MyRule.m_Object_ID));
 }
Exemplo n.º 10
0
 public static bool Exist()
 {
     return(MyRule.Exist(MyRule.m_Goup_ID, MyRule.m_Object_ID));
 }
Exemplo n.º 11
0
 public static string Delete(SqlConnection myConnection)
 {
     return(MyRule.Delete(myConnection, MyRule.m_Goup_ID, MyRule.m_Object_ID));
 }
Exemplo n.º 12
0
 public static string Delete()
 {
     return(MyRule.Delete(MyRule.m_Goup_ID, MyRule.m_Object_ID));
 }
Exemplo n.º 13
0
 public static string CreateKey()
 {
     return(MyRule.CreateKey(""));
 }
Exemplo n.º 14
0
 public static bool IsPrint(string myObject)
 {
     return(MyRule.Check(MyRule.EnumRule.AllowPrint, myObject));
 }
Exemplo n.º 15
0
 public static string Get()
 {
     return(MyRule.Get(MyRule.Goup_ID, MyRule.Object_ID));
 }
Exemplo n.º 16
0
        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);
        }
Exemplo n.º 17
0
        //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);
        }