Example #1
0
        private void GetData()
        {
            JAFolders Kart = new JAFolders();

            System.Data.DataTable FolderData = Kart.GetDataTable(_FolderType);
            cmbFolders.DataSource    = FolderData;
            cmbFolders.DisplayMember = "Name";
            cmbFolders.ValueMember   = "Code";
        }
Example #2
0
        //Node
        #region Node
        public ClassLibrary.JNode Box(JAFolderTypeEnum pKartabletype)
        {
            CurrentKartable = pKartabletype;

            JAFolders Folders = new JAFolders();

            JAFolder[] Folder = Folders.GetMainFolders((int)pKartabletype);

            ClassLibrary.JNode Node = new ClassLibrary.JNode(0, "Automation.JKartable");
            Node.Name = pKartabletype.ToString();
            Node.Popup.Insert(new ClassLibrary.JAction("New Folder", "Automation.JAFolder.showDialog", new object[] { (int)pKartabletype, Node.Code }, null));
            if (pKartabletype == JAFolderTypeEnum.Inbox)
            {
                Node.MouseClickAction = new ClassLibrary.JAction(pKartabletype.ToString(), "Automation.JKartable.GetInBoxRefer");
                Node.Icone            = JImageIndex.Kartabl.GetHashCode();
            }
            if (pKartabletype == JAFolderTypeEnum.SendItem)
            {
                Node.MouseClickAction = new ClassLibrary.JAction(pKartabletype.ToString(), "Automation.JKartable.GetReferSend");
                Node.Icone            = JImageIndex.KartablSender.GetHashCode();
            }
            if (pKartabletype == JAFolderTypeEnum.Archive)
            {
                Node.MouseClickAction = new ClassLibrary.JAction(pKartabletype.ToString(), "Automation.JKartable.GetReferArchive");
            }

            Nodes.hidColumns = "R.Code,ObjectCode,externalcode,action,Objecttype";

            Node.Childs = new ClassLibrary.JNode[Folder.Length];
            int count = 0;

            foreach (JAFolder F in Folder)
            {
                Node.Childs[count++] = F.GetNode();
            }
            return(Node);
        }
Example #3
0
        public void InsertReferFolder(JAFolderTypeEnum FolderEnum)
        {
            JDataBase DB = new JDataBase();

            try
            {
                JAFolders tmpFolder = new JAFolders();
                DataTable dt;
                foreach (DataRow dr in tmpFolder.GetFolderByInsert().Rows)
                {
                    string Where = "";
                    if ((dr["object_Type"].ToString() != "0" && dr["object_Type"].ToString() != "") ||
                        dr["Sender_User_post_code"].ToString() != "")
                    {
                        //Where = "status=" + (int)FolderEnum+ " AND ";
                        if (FolderEnum == JAFolderTypeEnum.Inbox)
                        {
                            Where += " R.sender_post_code=" + JMainFrame.CurrentPostCode;
                        }
                        else
                        if (FolderEnum == JAFolderTypeEnum.SendItem)
                        {
                            Where += " R.receiver_post_code=" + JMainFrame.CurrentPostCode;
                        }
                        if (dr["object_Type"].ToString() != "")
                        {
                            Where += " AND O.ClassName+case when O.DynamicClassCode=0 then '' else cast(O.DynamicClassCode as varchar) end like '%'+(Select object_Type From Folders Where Code=" + dr["Code"] + ")+'%'";
                        }
                        if (dr["Subject"].ToString() != "")
                        {
                            Where += " AND O.Title like '%'+(Select Subject From Folders Where Code=" + dr["Code"] + ")+'%'";
                        }
                        if (dr["Sender_User_post_code"].ToString() != "")
                        {
                            Where += " AND R.Sender_post_code = (Select Sender_User_post_code From Folders Where Code=" + dr["Code"] + ") ";
                        }

                        if (Where.Length > 0)
                        {
                            DB.setQuery(@"
                                    Select R.Code from Refer R inner join Objects O on R.object_code=O.Code 
                                    Where R.status=1 AND R.Code not in (Select ReferCode From ReferFolders where ReferFolderCode in (select Code from Folders where FolderType=" + FolderEnum.GetHashCode().ToString() + ") AND PostCode=" + JMainFrame.CurrentPostCode.ToString() + ") And " + Where);
                            dt = DB.Query_DataTable();
                            foreach (DataRow drIns in dt.Rows)
                            {
                                ReferCode       = Convert.ToInt32(drIns["Code"]);
                                ReferFolderCode = Convert.ToInt32(dr["Code"]);
                                Insert();
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                DB.Dispose();
            }
        }