public static bool UpdateDocument(ATTDocument objDoc)
 {
     try
     {
         DLLDocument.UpdateDocument(objDoc);
         return true;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public static List<ATTDocument> GetDocumentNameList(int? docID, int? unitID, int? orgID)
        {
            List<ATTDocument> LstDocumentName = new List<ATTDocument>();

            foreach (DataRow row in DLLDocument.GetDocumentNameListTable(docID, unitID, orgID).Rows)
            {
                ATTDocument objDocName = new ATTDocument(
                                                            int.Parse(row["UNIT_ID"].ToString()),
                                                            int.Parse(row["DOC_ID"].ToString()),
                                                            row["DOC_NAME"].ToString()
                                                        );

                LstDocumentName.Add(objDocName);
            }

            return LstDocumentName;
        }
        public static List<ATTDocument> SearchDocumentList(int? orgID, int? unitID, int? docID, string docName,string status)
        {
            List<ATTDocument> LstDocSearch = new List<ATTDocument>();
          
            DataTable tblDoc = new DataTable();
            //tblDoc = DLLDocument.SearchDocumentListTable(orgID, unitID, docID, docName, status, 0);
            tblDoc = DLLDocument.SearchDocumentListTable(orgID, unitID, docID, docName, status);

            DataTable tblDocAttach = new DataTable();
            //tblDocAttach = DLLDocument.SearchDocumentListTable(orgID, unitID, docID, docName, status, 1);
            tblDocAttach = BLLDocumentAttachment.SearchDocumentListTable(orgID, unitID, docID, docName, status);

            DataTable tblDocProcess = new DataTable();
            //tblDocProcess = DLLDocument.SearchDocumentListTable(orgID, unitID, docID, docName, status, 2);
            tblDocProcess = BLLDocumentProcess.SearchDocumentListTable(orgID, unitID, docID, docName, status);

            foreach (DataRow row in tblDoc.Rows)
            {
                ATTDocument objDocName = new ATTDocument(   int.Parse(row["Org_id"].ToString()),
                                                            int.Parse(row["UNIT_ID"].ToString()),
                                                            int.Parse(row["DOC_ID"].ToString()),
                                                            row["DOC_NAME"].ToString(),
                                                            row["DESCRIPTION"].ToString(),
                                                            int.Parse(row["FLOW_ID"].ToString()),
                                                            row["DOC_FLOW_NAME"].ToString(),
                                                            int.Parse(row["CAT_ID"].ToString()),
                                                            row["CATEGORY_NAME"].ToString()
                                                        );

                if (tblDocAttach.Rows.Count > 0)
                {
                    objDocName.LstDocAttachment = SetDocAttachment(tblDocAttach, int.Parse(row["Org_id"].ToString()), int.Parse(row["UNIT_ID"].ToString())
                                                                   , int.Parse(row["DOC_ID"].ToString()));
                }

                if (tblDocProcess.Rows.Count > 0)
                {
                    objDocName.LstDocProcess = SetDocProcess(tblDocProcess, int.Parse(row["Org_id"].ToString()), int.Parse(row["UNIT_ID"].ToString())
                                                            ,int.Parse(row["DOC_ID"].ToString()));
                }

                LstDocSearch.Add(objDocName);
            }
            return LstDocSearch;
        }