Thursday, 30 January 2014

grid.locale-en.js (jqgrid)

;(function($){
/**
 * jqGrid English Translation
 * Tony Tomov tony@trirand.com
 * http://trirand.com/blog/
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
**/
$.jgrid = $.jgrid || {};
$.extend($.jgrid,{
    defaults : {
        recordtext: "View {0} - {1} of {2}",
        emptyrecords: "No records to view",
        loadtext: "Loading...",
        pgtext : "Page {0} of {1}"
    },
    search : {
        caption: "Search...",
        Find: "Find",
        Reset: "Reset",
        odata: [{ oper:'eq', text:'equal'},{ oper:'ne', text:'not equal'},{ oper:'lt', text:'less'},{ oper:'le', text:'less or equal'},{ oper:'gt', text:'greater'},{ oper:'ge', text:'greater or equal'},{ oper:'bw', text:'begins with'},{ oper:'bn', text:'does not begin with'},{ oper:'in', text:'is in'},{ oper:'ni', text:'is not in'},{ oper:'ew', text:'ends with'},{ oper:'en', text:'does not end with'},{ oper:'cn', text:'contains'},{ oper:'nc', text:'does not contain'}],
        groupOps: [    { op: "AND", text: "all" },    { op: "OR",  text: "any" }    ]
    },
    edit : {
        addCaption: "Add Record",
        editCaption: "Edit Record",
        bSubmit: "Submit",
        bCancel: "Cancel",
        bClose: "Close",
        saveData: "Data has been changed! Save changes?",
        bYes : "Yes",
        bNo : "No",
        bExit : "Cancel",
        msg: {
            required:"Field is required",
            number:"Please, enter valid number",
            minValue:"value must be greater than or equal to ",
            maxValue:"value must be less than or equal to",
            email: "is not a valid e-mail",
            integer: "Please, enter valid integer value",
            date: "Please, enter valid date value",
            url: "is not a valid URL. Prefix required ('http://' or 'https://')",
            nodefined : " is not defined!",
            novalue : " return value is required!",
            customarray : "Custom function should return array!",
            customfcheck : "Custom function should be present in case of custom checking!"
           
        }
    },
    view : {
        caption: "View Record",
        bClose: "Close"
    },
    del : {
        caption: "Delete",
        msg: "Delete selected record(s)?",
        bSubmit: "Delete",
        bCancel: "Cancel"
    },
    nav : {
        edittext: "",
        edittitle: "Edit selected row",
        addtext:"",
        addtitle: "Add new row",
        deltext: "",
        deltitle: "Delete selected row",
        searchtext: "",
        searchtitle: "Find records",
        refreshtext: "",
        refreshtitle: "Reload Grid",
        alertcap: "Warning",
        alerttext: "Please, select row",
        viewtext: "",
        viewtitle: "View selected row"
    },
    col : {
        caption: "Select columns",
        bSubmit: "Ok",
        bCancel: "Cancel"
    },
    errors : {
        errcap : "Error",
        nourl : "No url is set",
        norecords: "No records to process",
        model : "Length of colNames <> colModel!"
    },
    formatter : {
        integer : {thousandsSeparator: ",", defaultValue: '0'},
        number : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, defaultValue: '0.00'},
        currency : {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "", suffix:"", defaultValue: '0.00'},
        date : {
            dayNames:   [
                "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
                "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
            ],
            monthNames: [
                "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
                "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
            ],
            AmPm : ["am","pm","AM","PM"],
            S: function (j) {return j < 11 || j > 13 ? ['st', 'nd', 'rd', 'th'][Math.min((j - 1) % 10, 3)] : 'th';},
            srcformat: 'Y-m-d',
            newformat: 'n/j/Y',
            parseRe : /[Tt\\\/:_;.,\t\s-]/,
            masks : {
                // see http://php.net/manual/en/function.date.php for PHP format used in jqGrid
                // and see http://docs.jquery.com/UI/Datepicker/formatDate
                // and https://github.com/jquery/globalize#dates for alternative formats used frequently
                // one can find on https://github.com/jquery/globalize/tree/master/lib/cultures many
                // information about date, time, numbers and currency formats used in different countries
                // one should just convert the information in PHP format
                ISO8601Long:"Y-m-d H:i:s",
                ISO8601Short:"Y-m-d",
                // short date:
                //    n - Numeric representation of a month, without leading zeros
                //    j - Day of the month without leading zeros
                //    Y - A full numeric representation of a year, 4 digits
                // example: 3/1/2012 which means 1 March 2012
                ShortDate: "n/j/Y", // in jQuery UI Datepicker: "M/d/yyyy"
                // long date:
                //    l - A full textual representation of the day of the week
                //    F - A full textual representation of a month
                //    d - Day of the month, 2 digits with leading zeros
                //    Y - A full numeric representation of a year, 4 digits
                LongDate: "l, F d, Y", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy"
                // long date with long time:
                //    l - A full textual representation of the day of the week
                //    F - A full textual representation of a month
                //    d - Day of the month, 2 digits with leading zeros
                //    Y - A full numeric representation of a year, 4 digits
                //    g - 12-hour format of an hour without leading zeros
                //    i - Minutes with leading zeros
                //    s - Seconds, with leading zeros
                //    A - Uppercase Ante meridiem and Post meridiem (AM or PM)
                FullDateTime: "l, F d, Y g:i:s A", // in jQuery UI Datepicker: "dddd, MMMM dd, yyyy h:mm:ss tt"
                // month day:
                //    F - A full textual representation of a month
                //    d - Day of the month, 2 digits with leading zeros
                MonthDay: "F d", // in jQuery UI Datepicker: "MMMM dd"
                // short time (without seconds)
                //    g - 12-hour format of an hour without leading zeros
                //    i - Minutes with leading zeros
                //    A - Uppercase Ante meridiem and Post meridiem (AM or PM)
                ShortTime: "g:i A", // in jQuery UI Datepicker: "h:mm tt"
                // long time (with seconds)
                //    g - 12-hour format of an hour without leading zeros
                //    i - Minutes with leading zeros
                //    s - Seconds, with leading zeros
                //    A - Uppercase Ante meridiem and Post meridiem (AM or PM)
                LongTime: "g:i:s A", // in jQuery UI Datepicker: "h:mm:ss tt"
                SortableDateTime: "Y-m-d\\TH:i:s",
                UniversalSortableDateTime: "Y-m-d H:i:sO",
                // month with year
                //    Y - A full numeric representation of a year, 4 digits
                //    F - A full textual representation of a month
                YearMonth: "F, Y" // in jQuery UI Datepicker: "MMMM, yyyy"
            },
            reformatAfterEdit : false
        },
        baseLinkUrl: '',
        showAction: '',
        target: '',
        checkbox : {disabled:true},
        idName : 'id'
    }
});
})(jQuery);

Home Page

<%@ Assembly Name="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WikiEditPage" MasterPageFile="~masterurl/default.master" MainContentID="PlaceHolderMain" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Import Namespace="Microsoft.SharePoint.WebPartPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server" Visible="false">
    <SharePoint:ListItemProperty Property="BaseName" maxlength="40" runat="server"/>
    <SharePoint:ProjectProperty property="Title" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
    <meta name="GENERATOR" content="Microsoft SharePoint" />
    <meta name="ProgId" content="SharePoint.WebPartPage.Document" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="CollaborationServer" content="SharePoint Team Web Site" />   
    <!-- <link rel="stylesheet" type="text/css" media="screen" href="../SiteAssets/Roost/css/ui.jqgrid.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="../SiteAssets/Roost/css/jquery.mCustomScrollbar.css" /> -->
    <SharePoint:CssRegistration ID="CssRegistration1" name="../SiteAssets/css/jqgrid/jquery-ui.css"  After="corev5.css"  runat="server"/>
    <SharePoint:CssRegistration ID="CssRegistration2" name="../SiteAssets/css/jqgrid/ui.jqgrid.css" After="corev5.css"  runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderSearchArea" runat="server">
    <WebPartPages:spproxywebpartmanager runat="server" id="spproxywebpartmanager">
   
</WebPartPages:spproxywebpartmanager>
    <SharePoint:DelegateControl runat="server"
        ControlId="SmallSearchInputBox"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
    <SharePoint:ProjectProperty Property="Description" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

<script>
 function openQBAppDialog(URL, strwidth, strheight,strTitle) {      
        //var strwidth = 850;
        //var strheight = 580;
        var options =
        {
            url: URL,
            width: strwidth,
            height: strheight,
            title: strTitle,
            dialogReturnValueCallback: function (dialogResult) {
                SP.UI.ModalDialog.RefreshPage(dialogResult)
            }
        };

        SP.UI.ModalDialog.showModalDialog(options);
    }

</script>
<style>

th#WULinks_Item_Name , #WULinks tr.jqgfirstrow td:first-child , th#WMLinks_Item_Name , #WMLinks tr.jqgfirstrow td:first-child   {
width:148px !important;
}

th#WULinks_Date , #WULinks  tr.jqgfirstrow td:nth-child(2), th#WMLinks_Date , #WMLinks  tr.jqgfirstrow td:nth-child(2){
width:108px !important;
}

th#WULinks_Presenter , #WULinks  tr.jqgfirstrow td:nth-child(3), th#WMLinks_Presenter , #WMLinks  tr.jqgfirstrow td:nth-child(3){
width:84px !important;
}




#RefLibtabs .ui-tabs-panel{
overflow: hidden !important;
}


th#WULinks_Date, #WULinks tr.jqgfirstrow td:nth-child(2){
width: 85px !important;
}

#projectLinks #ProjectsLinksTbl tr.jqgfirstrow td:first-child ,#projectLinks th#ProjectsLinksTbl_ , th#OpportunitiesTbl_, #OpportunitiesTbl tr.jqgfirstrow td:first-child  {
width:25px !important;
}

#projectLinks #ProjectsLinksTbl_IMP_Score,#projectLinks #ProjectsLinksTbl tr.jqgfirstrow td:nth-child(2){
width:59px !important;
}

#projectLinks #ProjectsLinksTbl_Project_Type,#projectLinks #ProjectsLinksTbl tr.jqgfirstrow td:nth-child(3){
width:80px !important;
}

#projectLinks #ProjectsLinksTbl_Project_Name,#projectLinks #ProjectsLinksTbl tr.jqgfirstrow td:nth-child(4){
width:283px !important;
}

#projectLinks #ProjectsLinksTbl_Company_Name,#projectLinks #ProjectsLinksTbl tr.jqgfirstrow td:nth-child(5){
width:198px !important;
}

#gview_OpportunitiesTbl, #gview_OpportunitiesTbl div.ui-jqgrid-hdiv{

width:674px !important;
}



#gs_{

display: none !important;
}
.ui-jqgrid-bdiv{
width:100% !important;
}
#UsersGrid{
width:100% !important;
}
#QBAppPager{
width:100% !important;
}
#gbox_UsersGrid{
width:100% !important;
}
#gview_UsersGrid{
width:100% !important;
}
</style>
<style>
#tblAllImages{
    width:243px !important;
}
#tblAllImages .ui-jqgrid-btable{
    width:240px !important;
}
#gview_tblAllDocs{
    width:243px !important;
}
#gbox_tblAllDocs{
    width:243px !important;
}
#gview_tblAllImages{
    width:243px !important;
}
#gview_tblAllImages .ui-jqgrid-hdiv{
    width:240px !important;
}
/*#gview_tblAllImages .ui-jqgrid-htable{
    width:150px !important;
}*/
#gview_tblAllImages .ui-jqgrid-bdiv{
    height:222px !important;
}
#gview_tblAllImages{
    height:213px !important;
}
#gbox_tblAllImages{
    width:240px !important;
}
#tblAllDocs
{
    width:243px !important;
}
#gview_tblAllDocs .ui-jqgrid-htable{
    width:250px !important;
}
#gview_tblAllDocs .ui-jqgrid-bdiv{
    height:222px !important;
}
#gview_tblAllDocs{
    height:213px !important;
}
#gview_tblAllImages .ui-jqgrid-labels{
    display:none;
}
#gview_tblAllDocs .ui-jqgrid-labels{
    display:none;
}


#gview_OpportunitiesTbl , #gview_OpportunitiesTbl  div.ui-jqgrid-hdiv {

width : 674px !important;
}

#gview_tblAllDocs .ui-jqgrid-bdiv {
height: 190px !important;
}
/* Styles added for new layout */
#contentRow{
        padding-top:0px !important;
        }

#DeltaPageStatusBar{
display:none !important;

}
body #s4-leftpanel {
    display:none;
}

body #contentBox {
    margin-left:15px !important;
}

body #sideNavBox {
    display:none;
}

#detailPopup{
z-index:99999 !important;
}
#WebPartctl00_ctl44_g_f29f2d95_0dff_487f_9bbb_2d25660c6e60{
border: 1px solid rgb(226, 226, 215) !important;
}

.JQ_GRID_Header{
    background: #ffffff;
background: -moz-linear-gradient(top,  #ffffff 0%, #f6f6f6 47%, #ededed 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed));
background: -webkit-linear-gradient(top,  #ffffff 0%,#f6f6f6 47%,#ededed 100%);
background: -o-linear-gradient(top,  #ffffff 0%,#f6f6f6 47%,#ededed 100%);
background: -ms-linear-gradient(top,  #ffffff 0%,#f6f6f6 47%,#ededed 100%);
background: linear-gradient(to bottom,  #ffffff 0%,#f6f6f6 47%,#ededed 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 );
 padding:4px; border:1px solid #E2E2D7;

}
.viewall
        {
            position: absolute;
            padding-top: 10px;         
            margin: -10px 0px 0px;
            height: 10px;          
        }


#gs_Type{

display: none !important;
}

.ms-listMenu-editLink{
display: none !important;   
}

#tblAllvideos_FileName
{
    display:none;
}
#gview_tblAllvideos
{
    width:235px !important;
}
#gview_tblAllvideos .ui-jqgrid-hdiv
{
    width:235px !important;
}
#tblAllvideos
{
    width:235px !important;
}



</style>
<script language="javascript" type="text/javascript">
  function resizeIframe(obj) {alert("Reached");
    //obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
    //var iframe = window.parent.document.getElementById(obj);
    //var iframe = window.parent.document.body.scrollHeight + 'px';
    var iframe = document.getElementById('iframe').contentWindow.document.body.scrollHeight;
    alert(iframe);
    alert("1");
  }
</script>
<script type="text/javascript">
    var clientContext;
    var web;
    var currentUserDoc;


    //Initial method
    function initgetCurrentRSUser() {
        var siteUrl = '/';
        clientContext = new SP.ClientContext(siteUrl);
        web = clientContext.get_web();
        getCurrentRSUser();
    }


    //Method to get the current user name
    function getCurrentRSUser() {

        currentUserDoc = web.get_currentUser();
        clientContext.load(currentUserDoc);
        clientContext.executeQueryAsync(onGetCurrentRSUserNameSucces, onGetRSCurrentUserNameFail);
    }

    function onGetCurrentRSUserNameSucces() {
        var userADvalue = currentUserDoc.get_loginName();
        var trimADValue = userADvalue.split('|').pop();

        var finalURL = "https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=249&user=" + trimADValue ;

        openResourceChartZoomDialog(finalURL, '1500', '700', 'Add Project Resources');
    }

    function onGetRSCurrentUserNameFail(sender, args) {
        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    } 

    function openResourceChartZoomDialog(URL, strwidth, strheight, strTitle) {
        //var strwidth = 850;
        //var strheight = 580;
        var options =
            {
                url: URL,
                width: strwidth,
                height: strheight,
                title: strTitle,
                dialogReturnValueCallback: function (dialogResult) {
                    SP.UI.ModalDialog.RefreshPage(dialogResult)
                }
            };

        SP.UI.ModalDialog.showModalDialog(options);
    }
</script>
<!--<script type="text/javascript" src="/SiteAssets/Roost/js/Annoucement_Callout.js"></script> -->
<!-- <script src="../SiteAssets/Roost/js/pretty.js" type="text/javascript"></script>    -->
 <!-- The jQuery UI theme that will be used by the grid -->
    <!--<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.11/themes/redmond/jquery-ui.css" />-->
    <!-- The jQuery UI theme extension jqGrid needs -->
   <!-- <script src="../SiteAssets/Roost/js/jqgrid/grid.locale-en.js" type="text/javascript"></script> -->
    <!-- The jqGrid client-side javascript -->
   <!-- <script src="../SiteAssets/Roost/js/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script> -->
   <script src="../SiteAssets/js/jqgrid/i18n/grid.locale-en.js" type="text/javascript"></script> 
    <script src="../SiteAssets/js/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript" data-app-id="WuUiJjt59Q6U94gOGVdj0g" src="../SiteAssets/Roost/js/yam.js"></script>

            <link href="../SiteAssets/css/jqgrid/jquery-ui.css" type="text/css" rel="stylesheet" />
                    <link href="../SiteAssets/css/jqgrid/ui.jqgrid.css" type="text/css" rel="stylesheet" />
<!--<link href="../SiteAssets/Roost/css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../SiteAssets/Roost/css/jquery.mCustomScrollbar.min.js"></script>-->
     <script type="text/javascript" src="../SiteAssets/Roost/js/SP_RoostImages.js"></script>

    <link rel="stylesheet" type="text/css" href="../SiteAssets/Roost/css/jcarousel.basic.css">

        <script type="text/javascript" src="../SiteAssets/Roost/js/jquery.jcarousel.min.js"></script>
    <script type="text/javascript" src="../SiteAssets/Roost/js/lightbox-2.6.min.js"></script>
    <link href="../SiteAssets/Roost/css/lightbox.css" rel="stylesheet" />

<!-- <script  type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> -->

    <!-- three Column layout content here-->
<div class="full_hold">

  <div class="laycols01">
  <div class="padder">
  <!-- First Column content here-->

  <div id="Roosttabs">
                      <ul>
                        <li><a href="#Rboard-2">Roost Board</a></li>                         
                      </ul>
                              <div id="#Rboard-2" >
                                                           
                              </div>                                 
                    </div>

 
   <div id="QbOpenChart">
       <ul>
                               
                                <li><a href="#RefLibtabs-3">Weekly Meeting Links</a></li>
                                <li><a href="#RefLibtabs-4">Weekly Use Case
                                Links</a></li>
                                <!--<li><a href="#KnowledgeBase-3">dojo</a></li>-->
                                                                 
                              </ul>
                              <div id="RefLibtabs-3" class="cust_scroll">
                                                           
                              </div>   
                              <div id="RefLibtabs-4" class="cust_scroll">
                                                           
                              </div>                                      <div id="KnowledgeBase-3" class="cust_scroll">
                             
                              </div>   
    </div>
                             
    <!--<div id="QbOpenChart-1">
    <div id="QBOpenChartContainer">
        <iframe width="100%" height="100%" style="border:0px;" scrolling="no" src="https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=268">
                          <p>Your browser does not support iframes.</p>
                        </iframe></div>

</div>-->
   <WebPartPages:WebPartZone id="g_08A11B0E9E1E4841BFA3FC81ADF46879" runat="server" title="Zone 8"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
       </div>       

   </div>               
   </div>
  </div>

  <div class="laycols02">
  <div class="padder">
  <!-- Second Column content here-->
 
  <div id="QBtabs">
                      <ul>
                      <li><a href="#projectLinks">Projects</a></li>
                      <li><a href="#opportunityLinks">Opportunities</a></li>
                      </ul>
                       <!--<div id="QBtabs-1"  class="cust_scroll">                              
                               <iframe width="100%" height="320" style="border:0px;" scrolling="no" src="https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=275" >
                              <p>Your browser does not support iframes.</p>
                            </iframe> -->
                        <div id="projectLinks">                           
                        </div>
                        <div id="opportunityLinks">                           
                        </div>

  </div>
    <!-- <div id="QBtabs">
                      <ul>
                      <li><a href="#QBtabs-1">Resource Weekly Hours</a></li>   
                      <li><a href="#QBtabs-2">QuickBase Open Tickets</a></li>                       
                        <li><a href="#QBtabs-3">QuickBase Watching Tickets</a></li>                             
                      </ul>
                           <div id="QBtabs-1"  class="cust_scroll">
                           <div style="border:1px solid #c0c0c0;background:transparent;">

    <div class="ui-jqgrid-titlebar JQ_GRID_Header ui-corner-top ui-helper-clearfix" style="position: relative;" id="resourceChartZoomInDiv">
    <a class="viewall" href="#" onclick="openQBAppDialog('https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&amp;pageID=252&amp;vType=1','1000','700','Resource Log Hours');" style="cursor: pointer; right: 160px;">Log Hours</a>&nbsp;
        <a class="viewall" href="#" onclick="initgetCurrentRSUser();" style="cursor: pointer; right: 10px;">Add Project Resources</a>
   
</div>
<iframe width="100%" height="320" style="border:0px;" scrolling="no" src="https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=265" >
                          <p>Your browser does not support iframes.</p>
                        </iframe>

    <WebPartPages:WebPartZone id="g_B3AF35AE93084390B8D46D9C4C63EBBD" runat="server" title="Zone 10" __designer:Preview="&lt;Regions&gt;&lt;Region Name=&quot;0&quot; Editable=&quot;True&quot; Content=&quot;&quot; NamingContainer=&quot;True&quot; /&gt;&lt;/Regions&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; id=&quot;g_B3AF35AE93084390B8D46D9C4C63EBBD&quot;&gt;
    &lt;tr&gt;
        &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;width:100%;&quot;&gt;
            &lt;tr&gt;
                &lt;td style=&quot;white-space:nowrap;&quot;&gt;Zone 10&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;&lt;/td&gt;
    &lt;/tr&gt;&lt;tr&gt;
        &lt;td style=&quot;height:100%;&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;border-color:Gray;border-width:1px;border-style:Solid;width:100%;height:100%;&quot;&gt;
            &lt;tr valign=&quot;top&quot;&gt;
                &lt;td _designerRegion=&quot;0&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;width:100%;&quot;&gt;
                    &lt;tr&gt;
                        &lt;td style=&quot;height:100%;&quot;&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;" __designer:Values="&lt;P N=&#39;ID&#39; ID=&#39;1&#39; T=&#39;g_B3AF35AE93084390B8D46D9C4C63EBBD&#39; /&gt;&lt;P N=&#39;HeaderText&#39; ID=&#39;2&#39; T=&#39;Zone 10&#39; /&gt;&lt;P N=&#39;DisplayTitle&#39; R=&#39;2&#39; /&gt;&lt;P N=&#39;Title&#39; R=&#39;2&#39; /&gt;&lt;P N=&#39;Page&#39; ID=&#39;3&#39; /&gt;&lt;P N=&#39;TemplateControl&#39; R=&#39;3&#39; /&gt;&lt;P N=&#39;AppRelativeTemplateSourceDirectory&#39; R=&#39;-1&#39; /&gt;" __designer:Templates="&lt;Group Name=&quot;ZoneTemplate&quot;&gt;&lt;Template Name=&quot;ZoneTemplate&quot; Content=&quot;&quot; /&gt;&lt;/Group&gt;"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
    </div>

    </div>           
                      <div id="QBtabs-2" class="cust_scroll">
                          <div class="ui-jqgrid-titlebar ui-corner-top ui-helper-clearfix JQ_GRID_Header" ><a role="link" href="javascript:void(0)" class="ui-jqgrid-titlebar-close HeaderButton" style="right: 0px;"><span class="ui-icon ui-icon-circle-triangle-n"></span></a><span class="ui-jqgrid-title">&nbsp; <a class="viewall" href="#" onclick="openQBAppDialog('https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=273','1500', '700','QuickBase Open Tickets');" style="cursor:pointer;right:30px;">View All Tickets</a></span></div>
                          <iframe width="100%" height="320" style="border:0px;" scrolling="no" src="https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=255">
                          <p>Your browser does not support iframes.</p>
                        </iframe>
                            <WebPartPages:WebPartZone id="g_8E61AA51D4F94489BCFAE13F59FD9520" runat="server" title="Zone 2" __designer:Preview="&lt;Regions&gt;&lt;Region Name=&quot;0&quot; Editable=&quot;True&quot; Content=&quot;&quot; NamingContainer=&quot;True&quot; /&gt;&lt;/Regions&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; id=&quot;g_8E61AA51D4F94489BCFAE13F59FD9520&quot;&gt;
    &lt;tr&gt;
        &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;width:100%;&quot;&gt;
            &lt;tr&gt;
                &lt;td style=&quot;white-space:nowrap;&quot;&gt;Zone 2&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;&lt;/td&gt;
    &lt;/tr&gt;&lt;tr&gt;
        &lt;td style=&quot;height:100%;&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;border-color:Gray;border-width:1px;border-style:Solid;width:100%;height:100%;&quot;&gt;
            &lt;tr valign=&quot;top&quot;&gt;
                &lt;td _designerRegion=&quot;0&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;width:100%;&quot;&gt;
                    &lt;tr&gt;
                        &lt;td style=&quot;height:100%;&quot;&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;" __designer:Values="&lt;P N=&#39;ID&#39; ID=&#39;1&#39; T=&#39;g_8E61AA51D4F94489BCFAE13F59FD9520&#39; /&gt;&lt;P N=&#39;HeaderText&#39; ID=&#39;2&#39; T=&#39;Zone 2&#39; /&gt;&lt;P N=&#39;DisplayTitle&#39; R=&#39;2&#39; /&gt;&lt;P N=&#39;Title&#39; R=&#39;2&#39; /&gt;&lt;P N=&#39;Page&#39; ID=&#39;3&#39; /&gt;&lt;P N=&#39;TemplateControl&#39; R=&#39;3&#39; /&gt;&lt;P N=&#39;AppRelativeTemplateSourceDirectory&#39; R=&#39;-1&#39; /&gt;" __designer:Templates="&lt;Group Name=&quot;ZoneTemplate&quot;&gt;&lt;Template Name=&quot;ZoneTemplate&quot; Content=&quot;&quot; /&gt;&lt;/Group&gt;"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>              
                          
                      </div>
                         
                      <div id="QBtabs-3" class="cust_scroll">
                            <div class="ui-jqgrid-titlebar ui-corner-top ui-helper-clearfix JQ_GRID_Header"><a role="link" href="javascript:void(0)" class="ui-jqgrid-titlebar-close HeaderButton" style="right: 0px;"><span class="ui-icon ui-icon-circle-triangle-n"></span></a><span class="ui-jqgrid-title">&nbsp;<a class="viewall" href="#" onclick="openQBAppDialog('https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=274','1500', '700','QuickBase Watch Tickets');" style="cursor:pointer;right:30px;">View All</a></span></div>                     
                            <iframe width="100%" height="320" style="border:0px;" scrolling="no" src="https://mcftech.quickbase.com/db/bgufmd626?a=dbpage&pageID=263">
                          <p>Your browser does not support iframes.</p>
                        </iframe>
                           
                                 <WebPartPages:WebPartZone id="g_CD1AE1E920CF4E9EBED623168F59414E" runat="server" title="Zone 5" __designer:Preview="&lt;Regions&gt;&lt;Region Name=&quot;0&quot; Editable=&quot;True&quot; Content=&quot;&quot; NamingContainer=&quot;True&quot; /&gt;&lt;/Regions&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; id=&quot;g_CD1AE1E920CF4E9EBED623168F59414E&quot;&gt;
    &lt;tr&gt;
        &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;width:100%;&quot;&gt;
            &lt;tr&gt;
                &lt;td style=&quot;white-space:nowrap;&quot;&gt;Zone 5&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;&lt;/td&gt;
    &lt;/tr&gt;&lt;tr&gt;
        &lt;td style=&quot;height:100%;&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;border-color:Gray;border-width:1px;border-style:Solid;width:100%;height:100%;&quot;&gt;
            &lt;tr valign=&quot;top&quot;&gt;
                &lt;td _designerRegion=&quot;0&quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;0&quot; style=&quot;width:100%;&quot;&gt;
                    &lt;tr&gt;
                        &lt;td style=&quot;height:100%;&quot;&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;" __designer:Values="&lt;P N=&#39;ID&#39; ID=&#39;1&#39; T=&#39;g_CD1AE1E920CF4E9EBED623168F59414E&#39; /&gt;&lt;P N=&#39;HeaderText&#39; ID=&#39;2&#39; T=&#39;Zone 5&#39; /&gt;&lt;P N=&#39;DisplayTitle&#39; R=&#39;2&#39; /&gt;&lt;P N=&#39;Title&#39; R=&#39;2&#39; /&gt;&lt;P N=&#39;Page&#39; ID=&#39;3&#39; /&gt;&lt;P N=&#39;TemplateControl&#39; R=&#39;3&#39; /&gt;&lt;P N=&#39;AppRelativeTemplateSourceDirectory&#39; R=&#39;-1&#39; /&gt;" __designer:Templates="&lt;Group Name=&quot;ZoneTemplate&quot;&gt;&lt;Template Name=&quot;ZoneTemplate&quot; Content=&quot;&quot; /&gt;&lt;/Group&gt;"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>             
                      </div>                             
                    </div>-->

                   
                    <div id="RefLibtabs">
                    <ul>
           <!--<li><a href="#QbOpenChart-0">Resource Weekly Hours</a></li>-->
        <li><a href="#Rvideo" >MCF Video Gallery </a></li>
        <li><a href="#Imagetabs" onclick="javascript:getImages();">MCF Image Gallery</a></li>
    </ul>
    <!--<div id="Rvideo" style="padding-left: 2px; padding-top:2px;width:100%;height:255px">                              
                              </div>-->
                             
            <div id="Rvideo">
            <table cellpadding="0" cellspacing="0" width="100%">
              <tr>
                  <td style="vertical-align:top;width:15%" >
                      <div id="Videos-1" class="cust_scroll"></div>                                                                   
                  </td> 

                  <td id="VideoPlayer" style="vertical-align:top;padding-left:5px;width:85%">
                  </td>
              </tr>
              <tr>
                  <td>
                </td>
            </tr>
    </table>

            </div>   
                     
    <div id="Imagetabs" style="width:100%; height:265px;">
    <table cellpadding="0" cellspacing="0" width="100%">
              <tr>
                  <td style="vertical-align:top;width:250px" >
                      <div id="Imagetabs-1" class="cust_scroll"></div>                                                                   
                  </td> 

                  <td id="Imageslider" style="vertical-align:top;margin-left: -265px;padding-left:10px;">
                  </td>
              </tr>
              <tr>
                  <td>
                </td>
            </tr>
    </table>
    <table cellpadding="0" cellspacing="0" width="100%" id="ImagesFolder" style="margin-top: -10px; background-color:#f2f2f2;padding-bottom:5px;padding-left:2px;display:none">
          <tr>
              <td></td>
          </tr>
    </table>

                   
                    </div>

   
                                                       
                            </div>

                   
                   
   </div>
  </div>

  <div class="laycols03">
  <div class="padder">
  <!-- Third Column content here-->
  <div id="tabs">
                              <ul>
                                <li><a href="#tabs-1">Systems</a></li>
                                <li><a href="#tabs-2">Tools</a></li>
                                 <!-- <li><a href="#projectLinks">Projects</a></li>-->
                             
                              </ul>
                              <div id="tabs-1" class="cust_scroll">
                              
                              </div>
                              <div id="tabs-2" class="cust_scroll">
                                                           
                              </div>
                               <!--<div id="projectLinks">
                           
                            </div>    -->
                         
                            </div>
           <div id="Contenttabs">
                              <ul>
                                <li><a href="#Contenttabs-1">Project Documents</a></li>
                                <li><a href="#Contenttabs-2">Project Links</a></li>   
                                <!-- <li><a href="#Contenttabs-3">Sales Notes</a></li>-->                     
                              </ul>
                              <div id="Contenttabs-1" class="cust_scroll">
                              
                              </div>
                              <div id="Contenttabs-2" class="cust_scroll">
                                                           
                              </div>
                               <div id="Contenttabs-3" class="cust_scroll">
                                          <WebPartPages:WebPartZone id="g_EEF8B9FF473947EDACD643B07BF5B3B2" runat="server" title="Zone 7"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>                 
                              </div>                             
                        </div>                       
                               

 
   </div>
  </div>
</div> 

     <script type="text/javascript" src="../SiteAssets/Roost/js/RoostBoard.js"></script> 
      <script type="text/javascript" src="../SiteAssets/Roost/js/OpportunitiesLinks.js"></script>
     <script type="text/javascript" src="../SiteAssets/Roost/js/ProjectsLinks.js"></script>
<!--<script type="text/javascript" src="../SiteAssets/Roost/js/Roostvideoplayer.js"></script>-->
     <script type="text/javascript" src="../SiteAssets/Roost/js/RoostWeeklyUseCaseLinks.js"></script>
    <script type="text/javascript" src="../SiteAssets/Roost/js/RoostWeeklyMeetingLinks.js"></script>
 <script type="text/javascript" src="../SiteAssets/Roost/js/ROOST_OpenTickets_PieChart.js"></script>
     
     <script type="text/javascript" src="../SiteAssets/Roost/js/RoostAppLinksTabs.js "></script>
    
      <script type="text/javascript" src="../SiteAssets/Roost/js/ProjectsDocsServiceScript.js"></script>
      <script type="text/javascript" src="../SiteAssets/Roost/js/ProjectsLinksServiceScript.js"></script>
 <script type="text/javascript" src="../SiteAssets/Roost/js/SP_RoostVideos.js"></script>


     
            
    <!-- The localization file we need, English in this case
    <script src="../SiteAssets/Roost/js/i18n/grid.locale-en.js" type="text/javascript"></script>-->
    <!-- The jqGrid client-side javascript
    <script src="../SiteAssets/Roost/js/jquery.jqGrid.min.js" type="text/javascript"></script> -->
   <!-- <script type="text/javascript" src="../SiteAssets/Roost/js/jquery.mCustomScrollbar.min.js"></script> -->
    <script type="text/javascript">
     $(document).ready(function(){   
       
        $('#tabs').tabs();
        $('#QBtabs').tabs();
        $('#Roosttabs').tabs();
        $('#RefLibtabs').tabs();
        $('#Contenttabs').tabs();
        $('#QbOpenChart').tabs();
     });
    

     ExecuteOrDelayUntilScriptLoaded(initDocService, "sp.js");

</script>
 <script type="text/javascript">
function getImages()
{
ExecuteOrDelayUntilScriptLoaded(getRoostImages, "sp.js");
}

</script> 

</asp:Content>

Adding Document in Document Library Web part Using Sequential Workflow in Sharepoint with C# to simultaneously add Document in to another Document Library Web part in different Site Collection

using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;
using Microsoft.SharePoint.WorkflowActions;
using System.Diagnostics;
using System.Collections.Specialized;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Administration;
using System.Net.Mail;
using System.Net;
using System.IO;
namespace REGTPDocuments.AddREGTPDocumentsWorkflow
{
    public sealed partial class AddREGTPDocumentsWorkflow : SequentialWorkflowActivity
    {
        public AddREGTPDocumentsWorkflow()
        {
            InitializeComponent();
        }
        private EventLog _eventLog;
        public Guid workflowId = default(System.Guid);
        public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
        public string WMICountry, WMISharedGroups, Title, WMITags;
        private void onWorkflowItemChanged1_Invoked(object sender, ExternalDataEventArgs e)
        {
            try
            {
                WMICountry = workflowProperties.Item["WMICountry"] != null ? workflowProperties.Item["WMICountry"].ToString() : "";
                Title = workflowProperties.Item["Title"] != null ? workflowProperties.Item["Title"].ToString() : "";
                //WMITags = workflowProperties.Item["Tags"] != null ? workflowProperties.Item["Tags"].ToString() : "";

                SPListItem item = workflowProperties.Item;
                SPFile spFile = workflowProperties.Item.File;

                if (WMICountry != "")
                {
                    SPFieldLookupValueCollection countries = new SPFieldLookupValueCollection(WMICountry);

                    //loop all new collection (if new country is added)
                    foreach (SPFieldLookupValue country in countries)
                    {
                        //get country details
                        SPListItem countryItem = workflowProperties.Web.Lists["Country Sites"].GetItemById(country.LookupId);

                        string email = Convert.ToString(countryItem["Contact Email"]);
                        string contactName = Convert.ToString(countryItem["Contact Name"]);
                        string siteURL = Convert.ToString(countryItem["Site URL"]);
                        string active = Convert.ToString(countryItem["Active?"]);

                        //insert into record here
                        if (!string.IsNullOrEmpty(siteURL) && active.Trim().ToLower() == "true")
                        {
                            // Open the site
                            SPSecurity.RunWithElevatedPrivileges(delegate()
                            {
                                using (SPSite site = new SPSite(siteURL))
                                {
                                    using (SPWeb web = site.OpenWeb())
                                    {
                                        string libName = "Document";

                                        //get Document Library
                                        SPDocumentLibrary library = (SPDocumentLibrary)web.Lists[libName];
                                        SPFolder parentFolder = spFile.ParentFolder;

                                        //file inside a Folder
                                        if (false)
                                        {
                                            string foldername = string.Format(@"{0}/{1}", libName, parentFolder.Name);

                                            //ensure folder
                                            if (!web.GetFolder(foldername).Exists)
                                            {
                                                //add folder
                                                string url = library.RootFolder.ServerRelativeUrl.ToString();
                                                SPFolderCollection folders = web.GetFolder(url).SubFolders;
                                                folders.Add(foldername);
                                            }

                                            //currentFolder
                                            SPFolder currentFolder = library.RootFolder.SubFolders[foldername];

                                            //add file to folder
                                            SPFile uploadFile = currentFolder.Files.Add(item.Name, item.File.OpenBinary(), item.Properties, true);

                                            string application = Convert.ToString(item["Application"]);
                                            string docType = Convert.ToString(item["Document Type"]);

                                            if (!string.IsNullOrEmpty(application))
                                            {
                                                SPFieldLookupValue applicationLook = new SPFieldLookupValue(application);
                                                uploadFile.Item["Application"] = new SPFieldLookupValue(applicationLook.LookupId, applicationLook.LookupValue);
                                            }

                                            if (!string.IsNullOrEmpty(docType))
                                            {
                                                uploadFile.Item["Document Type"] = docType;
                                            }

                                            uploadFile.Item["PublisherItemID"] = item.ID;

                                            uploadFile.Update();
                                            uploadFile.Item.Update();
                                            currentFolder.Update();
                                        }
                                        else
                                        {
                                            SPFolder docLib = web.Folders["Document"];
                                            SPFile spFileItem = docLib.Files.Add(item.Name, item.File.OpenBinary(), item.Properties, true);

                                            //therefore, we manually CheckIN CheckOut file
                                            if (spFileItem.CheckOutType == SPFile.SPCheckOutType.None)
                                            {
                                                spFileItem.CheckOut();
                                                spFileItem.CheckIn("checkin");
                                            }
                                            else
                                            {
                                                spFileItem.CheckOut();
                                                spFileItem.CheckIn("checkin");
                                            }

                                            docLib.Update();
                                            spFileItem.Update();
                                            spFileItem.Item.Update();

                                            string application = Convert.ToString(item["Application"]);
                                            string docType = Convert.ToString(item["Document Type"]);

                                            if (!string.IsNullOrEmpty(application))
                                            {
                                                SPFieldLookupValue applicationLook = new SPFieldLookupValue(application);
                                                spFileItem.Item["ApplicationType"] = applicationLook.LookupValue;
                                            }

                                            if (!string.IsNullOrEmpty(docType))
                                            {
                                                spFileItem.Item["Document Type"] = docType;
                                            }

                                            spFileItem.Item["PublisherItemID"] = item.ID;

                                            docLib.Update();
                                            spFileItem.Update();
                                            spFileItem.Item.Update();

                                            //therefore, we manually CheckIN CheckOut file
                                            if (spFileItem.CheckOutType == SPFile.SPCheckOutType.None)
                                            {
                                                spFileItem.CheckOut();
                                                spFileItem.CheckIn("", SPCheckinType.MajorCheckIn);
                                            }
                                            else
                                            {
                                                spFileItem.CheckOut();
                                                spFileItem.CheckIn("", SPCheckinType.MajorCheckIn);
                                            }
                                        }

                                    }
                                }
                            });
                        }

                        else if (!string.IsNullOrEmpty(email))
                        {
                            //drop a mail
                            SendMail("", email, workflowProperties.Web, spFile.Name, spFile, contactName);
                        }
                    }
                }
            }
            catch (System.Exception Ex)
            {
                //Log exceptions in the Event Log
                InsertError(string.Format(@"https://wmiregtpportal.mcfcloud.com/country/CentroAmerica"), "Regtp Documents Error Message " + workflowProperties.ItemId, Ex.Message + "~" + Ex.StackTrace, "");
                _eventLog.WriteEntry("Workflow Error :" + Ex.Message.ToString(), EventLogEntryType.Information);
            }
        }

        public void SendMail(string siteURL, string mailAddress, SPWeb web, string fileName, SPFile spFile, string contactName)
        {
            //Get the Sharepoint SMTP information from the SPAdministrationWebApplication
            string smtpServer = SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address;

            string smtpFrom = SPAdministrationWebApplication.Local.OutboundMailSenderAddress;

            //Create the mail message and supply it with from and to info
            MailMessage mailMessage = new MailMessage(smtpFrom, mailAddress);

            //Set the subject and body of the message
            mailMessage.Subject = string.Format(@"{0} - WMI BVHO Document", fileName);
            mailMessage.Body = string.Format(@"Hi {0},
                                                    {1} Attached you would find the document {2} that is shared through Walmart international BVHO", contactName, Environment.NewLine, fileName);

            //Download the content of the file with a WebClient
            WebClient webClient = new WebClient();

            //Supply the WebClient with the network credentials of our user
            webClient.Credentials = CredentialCache.DefaultNetworkCredentials;

            //Download the byte array of the file
            //byte[] data = webClient.DownloadData(insert_attachment_url);

            //Dump the byte array in a memory stream because
            //we can write it to our attachment
            MemoryStream memoryStreamOfFile = new MemoryStream(spFile.OpenBinary());

            //Add the attachment
            mailMessage.Attachments.Add(new System.Net.Mail.Attachment(memoryStreamOfFile, fileName));

            //Create the SMTP client object and send the message
            SmtpClient smtpClient = new SmtpClient(smtpServer);
            smtpClient.Send(mailMessage);


            //            Microsoft.SharePoint.Utilities.SPUtility.SendEmail(web, true, false, mailAddress,
            //                                                                         string.Format(@"{0} - WMI BVHO Document", fileName),
            //                                                                         string.Format(@"Hi, <br/> <br/> Attached you would find the document {0} that is
            //                                                                        shared through Walmart international BVHO", fileName));
        }


        public void InsertError(string spSiteURL, string title, string body, string Expires)
        {
            DateTime? dateExpires = null;
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite site = new SPSite(spSiteURL))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        SPList list = web.Lists["Errors"];

                        SPListItem item = list.Items.Add();

                        item["Title"] = title;
                        item["Body"] = body;

                        if (Expires != "")
                        {
                            item["Expires"] = Expires;
                        }
                        else
                        {
                            item["Expires"] = dateExpires;
                        }

                        item.Update();
                    }
                }
            });
        }


    }
}