Beispiel #1
0
        void FncTickPermissions(Int64 RoleID)
        {
            try
            {
                DataTable dt = ClsPermission.GetPermByRoleID(RoleID);

                for (int i = 0; i < trvMain.Items.Count; i++)
                {
                    TreeViewItem tviTemp = ((TreeViewItem)trvMain.Items[i]);
                    for (int j = 0; j < tviTemp.Items.Count; j++)
                    {
                        for (int r = 0; r < dt.Rows.Count; r++)
                        {
                            if (Int64.Parse(((TreeViewItem)tviTemp.Items[j]).Tag.ToString()) == Int64.Parse(dt.Rows[r][1].ToString()))
                            {
                                ((CheckBox)((TreeViewItem)tviTemp.Items[j]).Header).IsChecked = true;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "FncTickPermissions", "CtlRole.xaml.cs");
            }
        }
Beispiel #2
0
        private void FncSavePermissions(Int64 RoleID)
        {
            try
            {
                ClsPermission.Delete(RoleID);

                for (int i = 0; i < trvMain.Items.Count; i++)
                {
                    TreeViewItem tviTemp = ((TreeViewItem)trvMain.Items[i]);
                    for (int j = 0; j < tviTemp.Items.Count; j++)
                    {
                        if (((CheckBox)((TreeViewItem)tviTemp.Items[j]).Header).IsChecked == true)
                        {
                            ClsPermission objper = new ClsPermission();
                            objper.Save(Int64.Parse(((TreeViewItem)tviTemp.Items[j]).Tag.ToString()), RoleID);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "FncSavePermissions", "CtlRole.xaml.cs");
            }
        }
        private void FncSavePermissions(Int64 RoleID)
        {
            try
            {
                ClsPermission.Delete(RoleID);

                for (int i = 0; i < trvMain.Items.Count; i++)
                {
                    TreeViewItem tviTemp = ((TreeViewItem)trvMain.Items[i]);
                    for (int j = 0; j < tviTemp.Items.Count; j++)
                    {
                        if (((CheckBox)((TreeViewItem)tviTemp.Items[j]).Header).IsChecked == true)
                        {
                            ClsPermission objper = new ClsPermission();
                            objper.Save(Int64.Parse(((TreeViewItem)tviTemp.Items[j]).Tag.ToString()), RoleID);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "FncSavePermissions", "CtlRole.xaml.cs");
            }
        }