Beispiel #1
0
        private void SetPermissionTitle_Load(object sender, EventArgs e)
        {
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            List <Model.Common.User> query = dc.Users.ToList().Where(q => q.Visible == Setting.User.ThisProgram.GetUserVisible(q.Code, true)).ToList();

            if (query.Any())
            {
                foreach (var item in query.ToList())
                {
                    if (Setting.User.ThisProgram.IsMembershipInAdministartorRole(item))
                    {
                        query.RemoveAll(q => q.Code == item.Code);
                    }
                }
            }
            if (query.Any())
            {
                cmUsers.DataSource    = query;
                cmUsers.DisplayMember = "FullName";
                cmUsers.ValueMember   = "Code";
                System.Data.DataTable tempDataTable = SqlHelper.GetField("Field12");
                if (tempDataTable.Rows.Count > 0)
                {
                    cblTitle.DataSource    = tempDataTable;
                    cblTitle.DisplayMember = "Title";
                    cblTitle.ValueMember   = "ID";
                    ChangePermission(Convert.ToInt32(cmUsers.SelectedValue));
                }
                else
                {
                    MessageBox.Show("هیچ عنوانی برای اسناد در نظر گرفته نشده است");
                }
            }
        }
        internal static void SaveArchivesTrees(Model.Common.ArchiveCommonDataClassesDataContext dc)
        {
            var accessPermissionTreesQuery = dc.AccessPermissionTrees.Where(t => t.Item == Setting.User.ThisProgram.GetAccessPermissionUnitGroupName(Setting.User.AccessPermissionUnits.Archive));

            if (accessPermissionTreesQuery.Count() == 0)
            {
                Model.Common.AccessPermissionTree tree = Model.Common.AccessPermissionTree.GetNewInstance(Setting.User.ThisProgram.GetAccessPermissionUnitGroupName(Setting.User.AccessPermissionUnits.Archive), null, "بایگانی ها", true, false);
                dc.AccessPermissionTrees.InsertOnSubmit(tree);
                dc.SubmitChanges();
            }
            foreach (var item in dc.Archives)
            {
                var query = dc.AccessPermissionTrees.Where(t => t.Item == Setting.User.ThisProgram.GetAccessPermissionUnitGroupName(Setting.User.AccessPermissionUnits.Archive));
                if (query.Count() == 0)
                {
                    Model.Common.AccessPermissionTree tree = Model.Common.AccessPermissionTree.GetNewInstance(Setting.User.ThisProgram.GetAccessPermissionUnitGroupName(Setting.User.AccessPermissionUnits.Archive), null, "بایگانی ها", true, false);
                    dc.AccessPermissionTrees.InsertOnSubmit(tree);
                    dc.SubmitChanges();
                }
                var accessPermissionTreeQuery = dc.AccessPermissionTrees.Where(t => t.Group == Setting.User.ThisProgram.GetAccessPermissionUnitGroupName(Setting.User.AccessPermissionUnits.Archive) && t.Item == item.ID.ToString());
                if (accessPermissionTreeQuery.Count() > 0)
                {
                    Model.Common.AccessPermissionTree originalTree = accessPermissionTreeQuery.Single();
                    Model.Common.AccessPermissionTree tree         = Model.Common.AccessPermissionTree.GetNewInstance(item.ID.ToString(), Setting.User.ThisProgram.GetAccessPermissionUnitGroupName(Setting.User.AccessPermissionUnits.Archive), item.Title, true, false);
                    Model.Common.AccessPermissionTree.Copy(originalTree, tree);
                    dc.SubmitChanges();
                }
                else
                {
                    Model.Common.AccessPermissionTree tree = Model.Common.AccessPermissionTree.GetNewInstance(item.ID.ToString(), Setting.User.ThisProgram.GetAccessPermissionUnitGroupName(Setting.User.AccessPermissionUnits.Archive), item.Title, true, false);
                    dc.AccessPermissionTrees.InsertOnSubmit(tree);
                    dc.SubmitChanges();
                }
            }
        }
Beispiel #3
0
 public void LoadData()
 {
     if (this.DesignMode)
     {
         return;
     }
     try
     {
         this.SuspendLayout();
         this.Nodes.Clear();
         Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
         var data = dc.ArchiveTrees;
         foreach (var item in data.Where(t => t.ParentID == null).OrderBy(t => t.Index))
         {
             TreeNode node = AddNode(null, item);
             AddNodes(node, data, item);
         }
         if (this.Nodes.Count > 0)
         {
             this.ExpandAll();
             this.SelectedNode = this.Nodes[0];
             this.SelectedNode.EnsureVisible();
         }
     }
     catch (Exception ex)
     {
         PersianMessageBox.Show(this, "خطا در بارگذاری اطلاعات" + "\r\n\r\n" + ex.Message);
         return;
     }
     finally
     {
         this.ResumeLayout(false);
     }
 }
Beispiel #4
0
        protected override void SaveUserData(int code, string fullName, string password, string roleCode, string stateCode, bool isGuest, bool isLogin, DateTime?Expire)
        {
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);

            Model.Common.User newInstance = Model.Common.User.GetNewInstance(code, fullName, password, fullName, "", null, roleCode, stateCode, Setting.User.ThisProgram.GetUserVisible(code, true), isGuest, isLogin, Expire, Setting.Program.GetMacAddress().ToString());
            dc.Connection.Open();
            dc.Transaction = dc.Connection.BeginTransaction();
            try
            {
                Model.Common.User.Insert(dc, newInstance);
                dc.SubmitChanges();
                try
                {
                    Setting.User.ThisProgram.AddLog(dc, Setting.User.UserOparatesPlaceNames.کاربران, Setting.User.UserOparatesNames.ثبت, null, "ثبت اطلاعات کاربر با نام '" + newInstance.FullName + "'");
                }
                catch
                {
                    throw new Exception("خطا در ذخیره عملکرد کاربر جاری");
                }
            }
            catch (Exception ex)
            {
                dc.Transaction.Rollback();
                dc.Connection.Close();
                PersianMessageBox.Show(this, "خطا در ثبت اطلاعات" + Environment.NewLine + Environment.NewLine + ex.Message);
                return;
            }
            dc.Transaction.Commit();
            dc.Connection.Close();
        }
        /// <summary>
        /// لیست پیام ها را می اوردد
        /// </summary>
        /// <param name="StartDate"></param>
        /// <param name="EndDate"></param>
        /// <returns> اگر تاریخ نال نباشد بر اساس تاریخ لیست را برمیگرداند و اگر نال باشد کل پیام های کاربر جاری را برمیگرداند</returns>
        internal static List <MessageViwModel> ListMessage(DateTime?StartDate, DateTime?EndDate)
        {
            int index = 1;

            Model.Common.ArchiveCommonDataClassesDataContext db = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            int id_User = Setting.User.ThisProgram.GetCurrentUser <Model.Common.User>().Code;

            List <Model.Common.MessageUser> Messages = db.MessageUsers.Where(a => a.UserCode == id_User).ToList();

            if (StartDate != null && EndDate != null)//search
            {
                Messages = Messages.Where(a => a.Message.SendDate > StartDate && a.Message.SendDate < EndDate).ToList();
            }

            List <MessageViwModel> ListMessages = new List <MessageViwModel>();

            foreach (var item in Messages)
            {
                var message = new MessageViwModel();
                message.Counter  = index++;
                message.DateSand = ConvertTo_PersianOREnglish_Date.GetPersianDate(item.Message.SendDate);
                message.Id       = item.ID;
                message.Title    = item.Message.Title;
                message.Text     = item.Message.Text;
                message.Sender   = item.Message.User.FullName;
                message.State    = item.State == (int)StateTypeMessage.خوانده_شده ? "خوانده شده" : "خوانده نشده";
                ListMessages.Add(message);
            }
            return(ListMessages);
        }
        internal static int GetCountMessageForUser()
        {
            int id_User = Setting.User.ThisProgram.GetCurrentUser <Model.Common.User>().Code;

            Model.Common.ArchiveCommonDataClassesDataContext db = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            return(db.MessageUsers.Where(a => a.UserCode == id_User).Count());
        }
        internal static int NumberMessageNoRead()
        {
            Model.Common.ArchiveCommonDataClassesDataContext db = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            int id_User = Setting.User.ThisProgram.GetCurrentUser <Model.Common.User>().Code;

            return(db.MessageUsers.Where(a => a.UserCode == id_User && a.State == (int)NjitSoftware.Enums.StateTypeMessage.خوانده_نشده).Count());
        }
Beispiel #8
0
        protected override void SaveUserData(int code, string fullname, string roleCode, string stateCode, bool _isguest, bool isLogin, DateTime?_Expire)
        {
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            Model.Common.User originalMembership = dc.Users.Where(t => t.Code == code).Single();
            string            originalFullName   = originalMembership.FullName;

            Model.Common.User newInstance = Model.Common.User.GetNewInstance(code, fullname, originalMembership.Password, fullname, originalMembership.NikName, originalMembership.LastLogin, roleCode, stateCode, Setting.User.ThisProgram.GetUserVisible(code, true), _isguest, false, _Expire, Setting.Program.GetMacAddress().ToString());
            dc.Connection.Open();
            dc.Transaction = dc.Connection.BeginTransaction();
            try
            {
                Model.Common.User.Copy(originalMembership, newInstance);
                dc.SubmitChanges();
                try
                {
                    Setting.User.ThisProgram.AddLog(dc, Setting.User.UserOparatesPlaceNames.کاربران, Setting.User.UserOparatesNames.ویرایش, null, "ویرایش اطلاعات کاربر با نام '" + originalFullName + "'");
                }
                catch
                {
                    throw new Exception("خطا در ذخیره عملکرد کاربر جاری");
                }
            }
            catch (Exception ex)
            {
                dc.Transaction.Rollback();
                dc.Connection.Close();
                PersianMessageBox.Show(this, "خطا در ثبت اطلاعات" + Environment.NewLine + Environment.NewLine + ex.Message);
                return;
            }
            dc.Transaction.Commit();
            dc.Connection.Close();

            Setting.User.ThisProgram.SetCurrentUser(dc.Users.Where(t => t.Code == Setting.User.ThisProgram.GetCurrentUser <Model.Common.User>().Code).Single());
        }
        public static void Update_ArchiveTabIndex(Model.Common.ArchiveGroupTab _ArchiveGroupTab)
        {
            List <System.Data.Common.DbTransaction>            _DbTransactionAllArchive = new List <System.Data.Common.DbTransaction>();
            List <Model.Archive.ArchiveDataClassesDataContext> dcAllArchive             = new List <Model.Archive.ArchiveDataClassesDataContext>();

            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            dc.Connection.Open();
            dc.Transaction = dc.Connection.BeginTransaction();
            try
            {
                //---------------ArchiveGroupTab تغییر نام گروه اطلاعاتی در
                Model.Common.ArchiveGroupTab.Copy(dc.ArchiveGroupTabs.Where(t => t.ID == _ArchiveGroupTab.ID).Single(), _ArchiveGroupTab);
                dc.SubmitChanges();
                dc.Transaction.Commit();
            }
            catch (Exception ex)//----- بازگرداندن تمام تراکنش ها
            {
                dc.Transaction.Rollback();
                throw new Exception("خطا در بروزرسانی اطلاعات" + "\r\n\r\n" + ex.Message);
            }
            finally//--------------- بستن تمام کانکشن ها
            {
                dc.Connection.Close();
            }
        }
Beispiel #10
0
        public void SearchAll()
        {
            Model.Archive.ArchiveTab firstTab = Controller.Archive.ArchiveTabController.GetFirstDossierTab();
            if (firstTab == null)
            {
                PersianMessageBox.Show(this, "هنوز هیچ گروه اطلاعاتی تعریف نشده است");
            }
            else
            {
                radGridViewAll.DataSource          = Controller.Archive.DossierController.GetDossierList(firstTab, null);
                radGridViewAll.ContextMenuOpening += radGridViewAdvanced_ContextMenuOpening;
                radGridViewAll.CellMouseMove      += radGridViewExtended1_CellMouseMove;
                //مخفی کردن ستونهایی که نمی خواسته نمایش بده
                for (int i = 0; i < radGridViewAll.ColumnCount; i++)
                {
                    Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
                    var query = dc.FormStates.Where(t => t.MachineName == Environment.MachineName && t.WindowState == 9 && t.FormName == radGridViewAll.Columns[i].FieldName);
                    if (query.Count() == 1)
                    {
                        radGridViewAll.Columns[i].IsVisible = false;
                    }
                }
                radGridViewAll.ColumnWidthChanging += radGridViewAll_ColumnWidthChanging;

                radGridViewAll.BestFitColumnsSmart();
            }
        }
Beispiel #11
0
 public void AddLog(UserOparatesPlaceNames operatingPlaceCode, UserOparatesNames operatingCode, string code, string description)
 {
     using (Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString))
     {
         AddLog(dc, operatingPlaceCode, operatingCode, code, description);
     }
 }
Beispiel #12
0
 public override void CloseUser()
 {
     Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
     Model.Common.User membership = dc.Users.Where(t => t.Code == Setting.User.ThisProgram.GetCurrentUser <Model.Common.User>().Code).Single();
     membership.isLogin   = false;
     membership.IPAddress = Setting.Program.GetMacAddress().ToString();
     dc.SubmitChanges();
 }
Beispiel #13
0
 public override bool Logout()
 {
     Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
     AddLog(dc, UserOparatesPlaceNames.None, UserOparatesNames.خروج_کاربر, null, null);
     Setting.User.ThisProgram.SetCurrentUser <Model.Common.User>(null);
     Setting.Archive.ThisProgram.SelectedArchiveTree = null;
     return(Login());
 }
        public static IEnumerable <Model.Common.ArchiveGroup> GetBaseArchiveGroups(int archiveGroupID)
        {
            List <Model.Common.ArchiveGroup> list = new List <Model.Common.ArchiveGroup>();

            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            AddBaseArchiveGroupTabsToList(list, dc.ArchiveGroups.Where(t => t.ID == archiveGroupID).Single());
            return(list);
        }
 private static void AddChildArchiveGroupsToList(Model.Common.ArchiveCommonDataClassesDataContext dc, List <Model.Common.ArchiveGroup> list, Model.Common.ArchiveGroup archiveGroup)
 {
     foreach (var item in dc.ArchiveGroups.Where(t => t.ParentID == archiveGroup.ID))
     {
         list.Add(item);
         AddChildArchiveGroupsToList(dc, list, item);
     }
 }
Beispiel #16
0
        public UserRoleAddEdit(int originalKey)
            : this(true)
        {
            Model.Common.ArchiveCommonDataClassesDataContext mdc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            this.UserRole         = mdc.UserRoles.Where(t => t.ID == originalKey).Single();
            this.OriginalUserRole = mdc.UserRoles.Where(t => t.ID == originalKey).Single();

            this.userRoleBindingSource.DataSource = this.UserRole;
        }
Beispiel #17
0
 internal DateTime GetFirstUserLogDate()
 {
     Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
     if (dc.UserLogs.Count() > 0)
     {
         return(Njit.Common.PersianCalendar.ToDateTime(GetUserLogView(dc.UserLogs.First()).Date));
     }
     return(DateTime.Now);
 }
        internal static IEnumerable <Model.Common.ArchiveGroup> GetChildArchiveGroups(int archiveGroupID)
        {
            List <Model.Common.ArchiveGroup> list = new List <Model.Common.ArchiveGroup>();

            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            Model.Common.ArchiveGroup archiveGroup = dc.ArchiveGroups.Where(t => t.ID == archiveGroupID).Single();
            AddChildArchiveGroupsToList(dc, list, archiveGroup);
            return(list);
        }
Beispiel #19
0
 internal static void UpdateFieldsIndex(Dictionary <int, int> list)
 {
     Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
     foreach (var id in list.Keys)
     {
         var item = dc.ArchiveGroupFields.Where(t => t.ID == id).Single();
         item.Index = list[id];
     }
     dc.SubmitChanges();
 }
Beispiel #20
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     LoadTree();
     Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
     comboBoxUserRole.SelectedValueChanged -= ComboBoxUserRoleSelectedValueChanged;
     userRoleBindingSource.DataSource       = dc.UserRoles.Where(t => t.ID != 1);
     comboBoxUserRole.SelectedValueChanged += ComboBoxUserRoleSelectedValueChanged;
     ComboBoxUserRoleSelectedValueChanged(this, EventArgs.Empty);
 }
Beispiel #21
0
        internal static IEnumerable <Field> GetFields(int archiveGroupFieldID)
        {
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            List <Field> list = new List <Field>();

            foreach (var item in dc.ArchiveGroupSubGroupFields.Where(t => t.ArchiveGroupFieldID == archiveGroupFieldID).OrderBy(t => t.Index))
            {
                list.Add(new Field(item.ID, item.Label, item.FieldName, item.FieldTypeCode, item.FieldType.Title, item.StatusCode, item.FieldStatus.Title, item.BoxTypeCode, item.BoxType.Title, item.AutoComplete, item.MinLength, item.MaxLength, item.MinValue, item.MaxValue, null, item.Index, item.DefaultValue));
            }
            return(list);
        }
Beispiel #22
0
        internal static Model.Common.ArchiveGroupField GetByID(int id)
        {
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            var query = dc.ArchiveGroupFields.Where(t => t.ID == id);

            if (query.Count() == 0)
            {
                return(null);
            }
            return(query.Single());
        }
Beispiel #23
0
        protected override void ValidateContent()
        {
            base.ValidateContent();
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            int count = dc.Users.Where(t => t.FullName == fullNameTextBox.Text && t.FullName != usersComboBox.Text).Select(t => t).Count();

            if (count > 0)
            {
                throw new Njit.Common.ValidateException(fullNameTextBox, "کاربر با نام ' " + fullNameTextBox.Text + " ' قبلا ثبت شده است");
            }
        }
Beispiel #24
0
        private void SendgMessage_Load(object sender, EventArgs e)
        {
            var user = Model.Common.ArchiveCommonDataClassesDataContext.GetNewInstance().Users.ToList();
            var us   = ToDataTable(user);

            cblTitle.DataSource    = us;
            cblTitle.DisplayMember = "UserName";
            cblTitle.ValueMember   = "Code";

            Model.Common.ArchiveCommonDataClassesDataContext sdc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            id_User = Setting.User.ThisProgram.GetCurrentUser <Model.Common.User>().Code;
        }
        private void ChangePasswordWithAdmin_Load(object sender, EventArgs e)
        {
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            List <Model.Common.User> query = dc.Users.ToList().Where(q => q.Visible == Setting.User.ThisProgram.GetUserVisible(q.Code, true)).ToList();

            if (query.Any())
            {
                cmUsers.DataSource    = query;
                cmUsers.DisplayMember = "FullName";
                cmUsers.ValueMember   = "Code";
            }
        }
Beispiel #26
0
        public override bool Authenticate(string username, string password)
        {
            Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
            var memberships = dc.Users.Where(t => t.UserName == username);

            if (memberships.Count() != 1)
            {
                return(false);
            }
            Model.Common.User member = memberships.Single();
            return(member.Password == this.HashData(member.Code.ToString() + password) && member.StateCode == this.HashData(member.Code.ToString() + ((int)UserStates.Active).ToString()));
        }
 public static Model.Common.ArchiveGroupTab Select(int id)
 {
     Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
     try
     {
         return(dc.ArchiveGroupTabs.Where(t => t.ID == id).Single());
     }
     catch (Exception ex)
     {
         throw new Exception("خطا در خواندن اطلاعات از پایگاه داده" + "\r\n\r\n" + ex.Message);
     }
 }
 public static List <Model.Common.ArchiveGroupTab> SelectAllTabDocuments()
 {
     Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
     try
     {
         return(dc.ArchiveGroupTabs.Where(t => t.TypeCode == (int)Enums.TabTypes.Document).OrderBy(t => t.Index).ToList());
     }
     catch (Exception ex)
     {
         throw new Exception("خطا در خواندن اطلاعات از پایگاه داده" + "\r\n\r\n" + ex.Message);
     }
 }
 public static IEnumerable <NjitSoftware.Model.Common.ArchiveGroupTab> GetBaseTabs(int ArchiveGroupTabID)
 {
     try
     {
         Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
         return(GetBaseTabs(dc.ArchiveGroupTabs.Where(t => t.ID == ArchiveGroupTabID).Single()));
     }
     catch (Exception ex)
     {
         throw new Exception("خطا در خواندن اطلاعات از پایگاه داده" + "\r\n\r\n" + ex.Message);
     }
 }
 public static bool TabExistNameCheck(string Title, int TypeCode)
 {
     try
     {
         Model.Common.ArchiveCommonDataClassesDataContext dc = new Model.Common.ArchiveCommonDataClassesDataContext(Setting.Sql.ThisProgram.DatabaseConnection.ConnectionString);
         return(dc.ArchiveGroupTabs.Where(t => t.TypeCode == TypeCode && t.Title == Title).Count() == 0 ? false : true);
     }
     catch (Exception ex)
     {
         throw new Exception("خطا در خواندن اطلاعات از پایگاه داده" + "\r\n\r\n" + ex.Message);
     }
 }