private void button1_Click(object sender, EventArgs e)
        {
            FolderVO temp = new FolderVO();

            temp.Id   = file.Id;
            temp.Name = FolderTB.Text.Trim();

            if (FolderTB.Text.Trim() == "")
            {
                Error("اسم الملف لا يمكن أن يكون فارغاً");
                return;
            }

            if (!gManager.IsFolderNew(temp))
            {
                Error("هناك ملف آخر له نفس الاسم أو الرقم", "فشل تعديل الملف");
                return;
            }

            else
            {
                if (gManager.Update(temp))
                {
                    file.Name = temp.Name;
                    Message("تم تعديل الملف بنجاح");
                    DialogResult = System.Windows.Forms.DialogResult.OK;
                }
                else
                {
                    Error();
                }
            }
        }
Пример #2
0
        public List <DocumentVO> GetDocumentsOfFolder(FolderVO folder)
        {
            List <DocumentVO> documents = ((IDocumentDAO)dataAccessObject).GetDocumentsOfFolder(folder);

            dataAccessObject.CloseConnection();
            return(documents);
        }
Пример #3
0
        public List <DocumentVO> GetDocumentsOfFolder(FolderVO folder)
        {
            string          condition = string.Format("{0}={1}", documentFolderId, folder.Id);
            string          statement = SqlStatememtGenerator.Select_ReadAllColumnsByCondition(tableName, condition);
            SqlCeDataReader reader    = executer.ExecuteSelectStatement(statement, null);

            return(ReadAllRecords(reader));
        }
Пример #4
0
        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="folder">数据实体</param>
        public void Update(FolderVO folder)
        {
            // check
            FolderEntity entity = folder.ToFolderEntity();

            this.CheckEntity(entity);
            FolderDA.Update(entity);
        }
Пример #5
0
 public JsonResult FolderInsert(FolderVO folderVO)
 {
     FolderBasisService.Insert(folderVO);
     return(Json(new AjaxResult()
     {
         Success = true, Data = true
     }));
 }
        public FolderEditForm(FolderVO f, FoldersManager m)
            : this()
        {
            file        = f;
            gManager    = m;
            isAutomatic = true;
            //IdFoldersNumericUpDown.Value = file.Number;
            FolderTB.Text = file.Name;

            isAutomatic = false;
        }
        private void UpdateFilebutton2_Click(object sender, EventArgs e)
        {
            FolderVO current = bindingSource1.Current as FolderVO;

            if (current != null)
            {
                FolderEditForm form = new FolderEditForm(current, gManager);

                if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    FoldersDataGridView.Refresh();
                    Log(OperationsManager.EDIT_GENERAL_FILES);
                }
            }
        }
Пример #8
0
        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="folder">数据实体</param>
        public void Insert(FolderVO folder)
        {
            FolderEntity entity = folder.ToFolderEntity();

            this.CheckEntity(entity);
            if (!entity.ParentId.HasValue)
            {
                throw new BusinessException("父节点Id不允许为空");
            }
            else if (CheckParentIsDeleted(entity.ParentId.Value))
            {
                throw new BusinessException("父节点已被删除,请重新刷新页面进行操作");
            }
            FolderDA.Insert(entity);
        }
        private void RemovFilebutton3_Click(object sender, EventArgs e)
        {
            FolderVO current = bindingSource1.Current as FolderVO;

            if (current != null)
            {
                if (Question("هل أنت متأكد من الحذف؟ هذا سيؤدي إلى حذف الوثائق و الملفات المرتبطة") == System.Windows.Forms.DialogResult.Yes)
                {
                    if (gManager.Delete(current))
                    {
                        bindingSource1.Remove(current);
                        FoldersDataGridView.Refresh();
                        Message("تم الحذف بنجاح");
                        Log(OperationsManager.EDIT_GENERAL_FILES);
                    }
                    else
                    {
                        Error();
                    }
                }
            }
        }
        private void InsertFilebutton1_Click(object sender, EventArgs e)
        {
            FolderVO file = new FolderVO();

            file.Name = FolderTB.Text.Trim();
            //file.Number = (int)IdFoldersNumericUpDown.Value;
            //file.Party = FoldercomboBox.SelectedItem as PartyVO;

            //if (file.Party == null)
            //{
            //    Error("لا بمكن إضافة ملف عام بدون ربطه بجهة معينة");
            //    return;
            //}

            if (!gManager.IsFolderNew(file))
            {
                Error("اسم الملف أو رقمه موجود سابقاً", "تعذر إضافة ملف جديد");
                return;
            }
            if (FolderTB.Text.Trim() == "")
            {
                Error("اسم الملف لا يمكن أن يكون فارغاً");
                return;
            }
            if (gManager.Insert(file) < 0)
            {
                Error("حدث خطأ أثناء عملية إضافة الملف", "فشل عملية الإضافة");
            }
            else
            {
                bindingSource1.Add(file);
                Message("تم إضافة الملف بنجاح", "عملية ناجحة");
                IdFoldersNumericUpDown.Value++;
                FolderTB.Text = "";
                FolderTB.Focus();
                Log(OperationsManager.EDIT_GENERAL_FILES);
            }
        }
Пример #11
0
        private void Form1_Load(object sender, EventArgs e)
        {
            FolderVO folder = manager.GetRootFolder();

            treeControl1.SetTree(folder);
        }
Пример #12
0
 public List <DocumentVO> GetSubDocumentsOfFolder(FolderVO folder)
 {
     return(GetAllByColumnValue(documentFolderId, folder.Id, SqlDbType.Int));
 }