Example #1
0
        public bool Delete(int pCode)
        {
            JDataBase db = JGlobal.MainFrame.GetDBO();

            try
            {
                if (JMessages.Question(" آیا می خواهید حذف شود ؟ ", "") == System.Windows.Forms.DialogResult.Yes)
                {
                    if (GetChildsNode(pCode).Length == 0)
                    {
                        JFolderTable ActionTable     = new JFolderTable();
                        JReferFolder tmpJReferFolder = new JReferFolder();
                        ActionTable.Code = pCode;
                        db.beginTransaction("DeleteFolder");
                        if (ActionTable.Delete(db))
                        {
                            if (tmpJReferFolder.Delete(pCode, db) >= 0)
                            {
                                if (db.Commit())
                                {
                                    Histroy.Save(this, ActionTable, Code, "Delete");
                                    //Nodes.DeleteNodeInTreeView(Nodes.TreeNodes.CurrentNode);
                                    return(true);
                                }
                                else
                                {
                                    db.Rollback("DeleteFolder");
                                    return(false);
                                }
                            }
                            else
                            {
                                db.Rollback("DeleteFolder");
                                return(false);
                            }
                        }
                        else
                        {
                            db.Rollback("DeleteFolder");
                            return(false);
                        }
                    }
                    else
                    {
                        JMessages.Error(" ابتدا پوشه های داخلی را حذف کنید ", "");
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                JSystem.Except.AddException(ex);
                JMessages.Message("Delete Not Successfully", "Kartabl", JMessageType.Information);
                return(false);
            }
            finally
            {
                db.Dispose();
            }
        }
Example #2
0
        public void GetInBoxRefer(int pFolderCode)
        {
            Timer.Stop();
            JReferFolder tmpJReferFolder = new JReferFolder();

            tmpJReferFolder.InsertReferFolder(JAFolderTypeEnum.Inbox);

            CurrentKartable  = JAFolderTypeEnum.Inbox;
            Nodes.ObjectBase = new ClassLibrary.JAction("GetReferNode", "Automation.JKartable.GetNode", null, null);

            JRowStyles p = new JRowStyles();
            JRowStyle  R = new JRowStyle();

            R.Expression = "[خوانده شده]='False'";
            Janus.Windows.GridEX.GridEXFormatStyle JanusRowStyle = new Janus.Windows.GridEX.GridEXFormatStyle();
            JanusRowStyle.BackColor = System.Drawing.Color.Silver;
            R.JanusRowStyle         = JanusRowStyle;
            p.Add(R);
            Nodes.RowStyles = p;

            Nodes.DataTable = JARefers.GetReferInInbox(ClassLibrary.JMainFrame.CurrentPostCode, pFolderCode);
            if (pFolderCode == 0)
            {
                Nodes.Name = "JKartableInBOX";
            }
            else
            {
                Nodes.Name = "FolderInBOX_" + pFolderCode.ToString();
            }
            Nodes.hidColumns = "View_date_Time,externalcode,ObjectType,Receiver_Full_Title,action,Code,ClassName,ObjectCode ,DynamicClassCode";
            Timer.Start();
        }
Example #3
0
        public void MoveToFolder(System.Data.DataRow pDR)
        {
            JFoldersListForm FFL = new JFoldersListForm(CurrentKartable.GetHashCode());

            FFL.ShowDialog();
            if (FFL.DialogResult == System.Windows.Forms.DialogResult.OK && FFL.CodeSelect > -1)
            {
                JReferFolder _Folder = new JReferFolder();
                _Folder.ReferCode       = (int)pDR["Code"];
                _Folder.ReferFolderCode = FFL.CodeSelect;
                _Folder.Insert();
                JAFolder AF = new JAFolder(FFL.CodeSelect);
                if (AF.DeleteFromKartable)
                {
                    Nodes.Delete(Nodes.CurrentNode);
                }
            }
        }
Example #4
0
        public void GetReferSend(int pFolderCode)
        {
            Timer.Stop();
            JReferFolder tmpJReferFolder = new JReferFolder();

            tmpJReferFolder.InsertReferFolder(JAFolderTypeEnum.SendItem);

            CurrentKartable  = JAFolderTypeEnum.SendItem;
            Nodes.ObjectBase = new ClassLibrary.JAction("GetReferNodeSend", "Automation.JKartable.GetNode", new object[] { JAFolderTypeEnum.SendItem }, null);
            Nodes.DataTable  = JARefers.GetReferSend(ClassLibrary.JMainFrame.CurrentPostCode, 0, pFolderCode);
            Nodes.hidColumns = "Code,ObjectCode,ClassName,View_date_Time,externalObjectcode,Active,ObjectType,action,DynamicClassCode";
            if (pFolderCode == 0)
            {
                Nodes.Name = "JKartableSendBOX";
            }
            else
            {
                Nodes.Name = "FolderInBOX_" + pFolderCode.ToString();
            }

            Timer.Start();
        }
Example #5
0
        public void DeleteFromFolder(int ReferCode)
        {
            JReferFolder _Folder = new JReferFolder();

            _Folder.DeleteReferFromFolder(ReferCode);
        }