public void AddEditDel_Document(DO_ProfileDocuments objDocument, Document flag)
        {
            SqlConnection conn = new SqlConnection();
            SQLManager    co   = new SQLManager();

            conn = co.GetConnection();

            cmd             = new SqlCommand("Scrl_AddEditDelContextDocument", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@FlagNo", SqlDbType.Int).Value                 = flag;
            cmd.Parameters.Add("@DocId", SqlDbType.BigInt).Value               = objDocument.DocId;
            cmd.Parameters.Add("@AddedBy", SqlDbType.BigInt).Value             = objDocument.intAddedBy;
            cmd.Parameters.Add("@FilePath", SqlDbType.VarChar, 200).Value      = objDocument.FilePath;
            cmd.Parameters.Add("@DocumentTitle", SqlDbType.VarChar, 200).Value = objDocument.DocTitle;
            cmd.Parameters.Add("@intModifiedBy", SqlDbType.Int).Value          = objDocument.ModifiedBy;
            cmd.Parameters.Add("@intDocumentTypeID", SqlDbType.Int).Value      = objDocument.intDocumentTypeID;
            cmd.Parameters.Add("@strAuthors", SqlDbType.VarChar, 255).Value    = objDocument.strAuthors;
            cmd.Parameters.Add("@IsDocsSale", SqlDbType.VarChar, 2).Value      = objDocument.IsDocsSale;
            cmd.Parameters.Add("@IsDocsDownload", SqlDbType.VarChar, 2).Value  = objDocument.IsDocsDownload;
            cmd.Parameters.Add("@intDocsSee", SqlDbType.VarChar, 200).Value    = objDocument.intDocsSee;
            cmd.Parameters.Add("@Price", SqlDbType.Float).Value                = objDocument.Price;
            cmd.Parameters.Add("@intSubjectCategoryId", SqlDbType.Int).Value   = objDocument.intSubjectCategoryId;
            cmd.Parameters.Add("@strDocName", SqlDbType.VarChar, 500).Value    = objDocument.strDocName;
            cmd.Parameters.Add("@strDescrition", SqlDbType.VarChar, 500).Value = objDocument.strDescrition;
            cmd.CommandTimeout = 120;// Setting command timeout to 2 minutes
            objDocument.DocId  = Convert.ToInt32(cmd.ExecuteScalar());

            co.CloseConnection(conn);
        }
        public void AddEditDel_OrgSubjCategoryDetails(DO_ProfileDocuments objcategory, DA_ProfileDocuments.OrgDocumenTemp flag)
        {
            SqlConnection conn = new SqlConnection();
            SQLManager    co   = new SQLManager();

            conn = co.GetConnection();

            cmd             = new SqlCommand("Scrl_AddEditDelOrgContextDocument", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@FlagNo", SqlDbType.Int).Value = flag;
            cmd.Parameters.Add("@intSubjectCategoryId", SqlDbType.Int).Value = objcategory.intSubjectCategoryId;
            //  cmd.Parameters.Add("@RegistrationId", SqlDbType.VarChar, 200).Value = objcategory.RegistrationId;
            cmd.Parameters.Add("@AddedBy", SqlDbType.VarChar, 200).Value       = objcategory.AddedBy;
            cmd.Parameters.Add("@intModifiedBy", SqlDbType.VarChar, 200).Value = objcategory.ModifiedBy;
            cmd.ExecuteNonQuery();
            co.CloseConnection(conn);
        }
        public DataTable GetOrgDataTable(DO_ProfileDocuments objcategory, DA_ProfileDocuments.OrgDocumenTemp flag)
        {
            DataTable     dt   = new DataTable();
            SqlConnection conn = new SqlConnection();
            SQLManager    co   = new SQLManager();

            conn = co.GetConnection();
            SqlDataAdapter da = new SqlDataAdapter();

            da.SelectCommand             = new SqlCommand("Scrl_AddEditDelOrgContextDocument", conn);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.Add("@FlagNo", SqlDbType.Int).Value = flag;
            da.SelectCommand.Parameters.Add("@DocId", SqlDbType.Int).Value  = objcategory.DocId;
            da.SelectCommand.Parameters.Add("@intSubjectCategoryId", SqlDbType.Int).Value = objcategory.intSubjectCategoryId;
            da.SelectCommand.Parameters.Add("@AddedBy", SqlDbType.BigInt).Value           = objcategory.AddedBy;

            da.Fill(dt);
            co.CloseConnection(conn);
            return(dt);
        }
        public DataTable GetGrouDocumetDataTable(DO_ProfileDocuments objcategory, DA_ProfileDocuments.GropDocument flag)
        {
            DataTable     dt   = new DataTable();
            SqlConnection conn = new SqlConnection();
            SQLManager    co   = new SQLManager();

            conn = co.GetConnection();
            SqlDataAdapter da = new SqlDataAdapter();

            da.SelectCommand             = new SqlCommand("Scrl_AddEditDelGroupDocument", conn);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.Add("@FlagNo", SqlDbType.Int).Value          = flag;
            da.SelectCommand.Parameters.Add("@intUploadDocId ", SqlDbType.Int).Value = objcategory.UploadDocId;
            da.SelectCommand.Parameters.Add("@intFolderId ", SqlDbType.Int).Value    = objcategory.intFolderId;
            da.SelectCommand.Parameters.Add("@intParentId ", SqlDbType.Int).Value    = objcategory.intParentId;
            da.SelectCommand.Parameters.Add("@intGroupId ", SqlDbType.Int).Value     = objcategory.intGroupId;
            da.SelectCommand.Parameters.Add("@AddedBy", SqlDbType.BigInt).Value      = objcategory.AddedBy;

            da.Fill(dt);
            co.CloseConnection(conn);
            return(dt);
        }
        public void AddEditDel_GroupOrgDocument(DO_ProfileDocuments objDocument, GropOrgDocument flag)
        {
            SqlConnection conn = new SqlConnection();
            SQLManager    co   = new SQLManager();

            conn = co.GetConnection();

            cmd             = new SqlCommand("Scrl_AddEditDelOrgGroupDocument", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@FlagNo", SqlDbType.Int).Value = flag;
            //cmd.Parameters.Add("@intRegistrationId", SqlDbType.Int).Value = objDocument.RegistrationId;
            cmd.Parameters.Add("@intGroupId", SqlDbType.Int).Value              = objDocument.intGroupId;
            cmd.Parameters.Add("@AddedBy", SqlDbType.BigInt).Value              = objDocument.intAddedBy;
            cmd.Parameters.Add("@strDocTitle", SqlDbType.VarChar, 200).Value    = objDocument.DocTitle;
            cmd.Parameters.Add("@FilePath", SqlDbType.VarChar, 200).Value       = objDocument.FilePath;
            cmd.Parameters.Add("@StrDocsDetails", SqlDbType.VarChar, 200).Value = objDocument.StrDocsDetails;
            cmd.Parameters.Add("@intModifiedBy", SqlDbType.Int).Value           = objDocument.ModifiedBy;
            cmd.Parameters.Add("@IsDocsSale", SqlDbType.VarChar, 2).Value       = objDocument.IsDocsSale;
            cmd.Parameters.Add("@IsDocsDownload", SqlDbType.VarChar, 2).Value   = objDocument.IsDocsDownload;
            cmd.Parameters.Add("@Price", SqlDbType.Float).Value = objDocument.Price;
            cmd.Parameters.Add("@strIpAddress", SqlDbType.VarChar, 20).Value   = objDocument.IpAddress;
            cmd.Parameters.Add("@IsFolder", SqlDbType.VarChar, 20).Value       = objDocument.IsFolder;
            cmd.Parameters.Add("@intUploadDocId", SqlDbType.Int).Value         = objDocument.UploadDocId;
            cmd.Parameters.Add("@strFolderName", SqlDbType.VarChar, 100).Value = objDocument.strFolderName;
            cmd.Parameters.Add("@intFolderId", SqlDbType.Int).Value            = objDocument.intFolderId;
            cmd.Parameters.Add("@intParentId", SqlDbType.Int).Value            = objDocument.intParentId;
            cmd.Parameters.Add("@OrgId", SqlDbType.Int).Value                         = objDocument.OrgId;
            cmd.Parameters.Add("@intGroupDocId", SqlDbType.Int).Value                 = objDocument.intGroupDocId;
            cmd.Parameters.Add("@strAuthors", SqlDbType.VarChar, 200).Value           = objDocument.strAuthors;
            cmd.Parameters.Add("@intDocsSee", SqlDbType.VarChar, 20).Value            = objDocument.intDocsSee;
            cmd.Parameters.Add("@intDocumentTypeID", SqlDbType.Int).Value             = objDocument.intDocumentTypeID;
            cmd.Parameters.Add("@strDocName", SqlDbType.VarChar, 500).Value           = objDocument.strDocName;
            cmd.Parameters.Add("@strIsPublic", SqlDbType.VarChar, 500).Value          = objDocument.strIsPublic;
            cmd.Parameters.Add("@strFolderDescription", SqlDbType.VarChar, 500).Value = objDocument.strFolderDescription;
            objDocument.DocId = Convert.ToInt32(cmd.ExecuteScalar());

            co.CloseConnection(conn);
        }