Beispiel #1
0
        public static bool getActToXML(Company myCompany)
        {
            if (myCompany != null && myCompany.Connected)
            {
                //metodo precedente all'introduzione del CRM in sap
                ActivitiesService acts  = myCompany.GetCompanyService().GetBusinessService(ServiceTypes.ActivitiesService) as ActivitiesService;
                Activity          myAct = acts.GetDataInterface(ActivitiesServiceDataInterfaces.asActivity);

                //get dei dati
                string    TodayDateQuery = DateTime.Now.ToString("yyyy-MM-dd");
                Recordset RecSet         = myCompany.GetBusinessObject(BoObjectTypes.BoRecordset);
                RecSet.DoQuery("select * from \"OCLG\",\"DUMMY\" WHERE \"CntctDate\"= TO_TIMESTAMP ('" + TodayDateQuery + " 00:00:00', 'YYYY-MM-DD HH24:MI:SS')");


                string pathToXml = Path.GetDirectoryName(Application.ExecutablePath);
                string TodayDate = DateTime.Now.ToString("dd-MM-yyyy");

                RecSet.SaveXML(TodayDate + "_activities.xml");
                MessageBox.Show("File saved in '" + pathToXml + "' ", "Export to XML", MessageBoxButtons.OK, MessageBoxIcon.Information);

                /*
                 * var o = RecSet.RecordCount;
                 * while (!RecSet.EoF)
                 * {
                 *  var CardCode = RecSet.Fields.Item("CardCode");
                 *  RecSet.MoveNext();
                 * }
                 */
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public void SaveXML(ref string fileName)
 {
     recordset.SaveXML(fileName);
 }