/// <summary>
 /// Danh sách tất cả các Module
 /// </summary>
 /// <returns>List</returns>
 public List <clsModule> getAll()
 {
     try
     {
         List <clsModule> objList = new List <clsModule>();
         SqlCommand       com     = new SqlCommand("iBet_tblModule_Gets", conn.GetConn());
         com.CommandType = System.Data.CommandType.StoredProcedure;
         conn.OpenConn();
         SqlDataReader dr = com.ExecuteReader();
         while (dr.Read())
         {
             clsModule obj = new clsModule();
             if (dr["Id"] != DBNull.Value)
             {
                 obj.Id = Convert.ToInt32(dr["Id"]);
             }
             if (dr["ModuleName"] != DBNull.Value)
             {
                 obj.ModuleName = Convert.ToString(dr["ModuleName"]);
             }
             if (dr["ModuleTitle"] != DBNull.Value)
             {
                 obj.ModuleTitle = Convert.ToString(dr["ModuleTitle"]);
             }
             if (dr["ModuleDescription"] != DBNull.Value)
             {
                 obj.ModuleDescription = Convert.ToString(dr["ModuleDescription"]);
             }
             if (dr["ModuleURL"] != DBNull.Value)
             {
                 obj.ModuleURL = Convert.ToString(dr["ModuleURL"]);
             }
             if (dr["IsVisible"] != DBNull.Value)
             {
                 obj.IsVisible = Convert.ToBoolean(dr["IsVisible"]);
             }
             if (dr["Priority"] != DBNull.Value)
             {
                 obj.Priority = Convert.ToInt32(dr["Priority"]);
             }
             if (dr["Identifier"] != DBNull.Value)
             {
                 obj.Identifier = Convert.ToString(dr["Identifier"]);
             }
             objList.Add(obj);
         }
         return(objList);
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         conn.CloseConn();
     }
 }
Example #2
0
        private void repositoryItemButtonEdit1_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            TreeListNode CurrentNode = treeList1.FocusedNode;
            clsModule    mdl         = ListModule[CurrentNode.GetDisplayText(
                                                      treeListColumn1)];

            IModuleAccessForm ifs = (IModuleAccessForm)
                                    Activator.CreateInstance(
                mdl.Ma.FormSettingType ??
                typeof(frmSecurityDocument));

            if (ifs.ShowDialog(mdl.Ma, mdl.ListKey, ref mdl.AllDocumentData))
            {
                CurrentNode.SetValue(treeListColumn2, mdl.Ma.ToString());
                if (simpleButton3.Enabled == false) // Peran Baru
                {
                    simpleButton6_Click(null, null);
                }
                else
                {
                    string newSecurityData = BaseUtility.Dictionary2String(
                        mdl.Ma.Variables);

                    BaseSecurity.CurrentLogin.Admin
                    .RoleModule.Update(textEdit4.Text,
                                       mdl.Ma.ModuleName, newSecurityData, mdl.AllDocumentData);

                    foreach (ModuleDataField mdf in mdl.Ma.ListDataField)
                    {
                        BaseSecurity.CurrentLogin.Admin
                        .RoleModule.UpdateDocumentVariable(
                            textEdit4.Text, mdl.Ma.ModuleName,
                            mdf.DataFieldName, mdf.EntityName,
                            mdl.ListKey[mdf.DataFieldName]);
                    }
                }
            }
        }