Example #1
0
        public static OpenCartConnector UploadQuantityChanges()
        {
            KeyValuePair <string, string> result = Cache.Current.ReadyForOpenCartUpdate.ExportActivityToCSV();

            OpenCartConnector retVal = null;

            if (!string.IsNullOrEmpty(result.Value))
            {
                retVal = new OpenCartConnector();
                if (retVal.LastProcessSuccess)
                {
                    retVal.UploadFilesToRemoteUrl(string.Format(QuantityUploadURLFormat, Configuration.Current.OpenCartAdminURL, retVal.Token), result.Value,
                                                  QuantityUpdateFormName, CSVType, new NameValueCollection(), QuantityUpdateSuccessString,
                                                  string.Format("POSQuantityUpdateUpload_{0}.csv", DateTime.Now.ToString("yyyyMMddHHmmss")));
                }
            }
            if (!string.IsNullOrEmpty(result.Key))
            {
                if (string.IsNullOrEmpty(retVal.ErrorMessage))
                {
                    retVal.ErrorMessage = result.Key;
                }

                else
                {
                    retVal.ErrorMessage += "\r\n\r\n" + result.Key;
                }
            }
            return(retVal);
        }
        public static OpenCartConnector UploadQuantityChanges()
        {

            KeyValuePair<string, string> result = Cache.Current.ReadyForOpenCartUpdate.ExportActivityToCSV();

            OpenCartConnector retVal = null;
            if (!string.IsNullOrEmpty(result.Value))
            {
                retVal = new OpenCartConnector();
                if (retVal.LastProcessSuccess)
                {
                    retVal.UploadFilesToRemoteUrl(string.Format(QuantityUploadURLFormat, Configuration.Current.OpenCartAdminURL, retVal.Token), result.Value,
                            QuantityUpdateFormName, CSVType, new NameValueCollection(), QuantityUpdateSuccessString,
                            string.Format("POSQuantityUpdateUpload_{0}.csv", DateTime.Now.ToString("yyyyMMddHHmmss")));
                }
            }
            if (!string.IsNullOrEmpty(result.Key))
            {
                if (string.IsNullOrEmpty(retVal.ErrorMessage))
                {
                    retVal.ErrorMessage = result.Key;
                }

                else
                {
                    retVal.ErrorMessage += "\r\n\r\n" + result.Key;
                }
            }
            return retVal;
        }