Esempio n. 1
0
        public static bool DeleteAllListings()
        {
            String sql = string.Format("delete * from [ActiveListing]");

            DataFactory.ExecuteSql(sql);
            return(true);
        }
Esempio n. 2
0
        public static bool MarkMessageAsReplied(String ebayMessageId)
        {
            String sql = string.Format("update [Message] set IsReplied=true where EbayMessageId='{0}'", ebayMessageId);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
Esempio n. 3
0
        }   // DeleteOneItem

        public static bool ModifyItemCategory(int itemId, int newCatId)
        {
            String sql = string.Format("update [Item] set CategoryId={0} where ItemId={1}", newCatId, itemId);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
Esempio n. 4
0
        public static bool DecreaseItem(string sku, int count)
        {
            InventoryItemType item = GetItemBySKU(sku);

            if (item == null)
            {
                return(false);
            }

            if (count > item.ItemStockNum)
            {
                return(false);
            }

            int newStock = item.ItemStockNum - count;

            if (newStock < 0)
            {
                return(false);
            }

            String sql = string.Format("update [Item] set ItemStockNum={0} where ItemSKU='{1}'", newStock, sku);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
        public static bool UpdateTransactionsShippingService(List <string> orderLineItemIds, string shippingServiceCode, string shippingServiceDesc)
        {
            // if transIds = (1001, 1002, 1003), then
            // transIdsStr = 1001, 1002, 1003
            String orderLineItemIdsStr = "";
            bool   first = true;

            foreach (string orderLineItemId in orderLineItemIds)
            {
                if (first == false)
                {
                    orderLineItemIdsStr += ",";
                }
                orderLineItemIdsStr += "'" + orderLineItemId.ToString() + "'";
                if (first == true)
                {
                    first = false;
                }
            }

            String sql = "update [Transaction] set ShippingServiceCode='" + shippingServiceCode + "', ShippingService='"
                         + shippingServiceDesc + "' where OrderId in (" + orderLineItemIdsStr + ")";

            DataFactory.ExecuteSql(sql);
            return(true);
        }
        public static bool UpdateTransactionItemSKU(int transId, string SKU)
        {
            String sql = "update [Transaction] set ItemSKU='" + SKU + "' where TransactionId=" + transId;

            DataFactory.ExecuteSql(sql);
            return(true);
        }
        public static bool UpdateTransactionShippingTrackingNo(int transId, String trackingNo)
        {
            String sql = string.Format("update [Transaction] set ShippingTrackingNo={0} where TransactionId={1}",
                                       trackingNo, transId);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
        public static bool UpdateTransactionBuyerLeftFeedback(int transId, bool bBuyerLeftFeedback)
        {
            String sql = string.Format("update [Transaction] set IsBuyerLeftFeedback={0} where TransactionId={1}",
                                       bBuyerLeftFeedback ? 1 : 0, transId);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
        public static bool UpdateTransactionShippedStatus(int transId, bool shipped, DateTime shippedDate)
        {
            String sql = string.Format("update [Transaction] set IsShipped={0}, ShippedDate='{1}' where TransactionId={2}",
                                       shipped ? 1 : 0, StringUtil.GetSafeDateTime(shippedDate), transId);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
Esempio n. 10
0
        public static bool updateTransactionShippingCost(int transId, double shippingCost)
        {
            String sql = string.Format("update [Transaction] set ShippingCost={0} where TransactionId={1}",
                                       shippingCost, transId);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
Esempio n. 11
0
        public static bool UpdateTransactionMessageStatus(int transId, TransactionMessageStatus messageStatus)
        {
            String sql = string.Format("update [Transaction] set MessageStatus={0} where TransactionId={1}",
                                       (int)messageStatus, transId);

            DataFactory.ExecuteSql(sql);
            return(true);
        }
Esempio n. 12
0
        public static bool DeleteItemSuppliers(int itemId)
        {
            bool result = false;

            String sql = string.Format("delete from [ItemSupplier] where ItemId={0}", itemId);

            DataFactory.ExecuteSql(sql);
            result = true;

            return(result);
        }
Esempio n. 13
0
        public static bool DeleteItemSupplier(ItemSupplierType itemSupplier)
        {
            bool result = false;

            String sql = string.Format("delete from [ItemSupplier] where ItemId={0} and SupplierId={1}",
                                       itemSupplier.ItemId, itemSupplier.SupplierId);

            DataFactory.ExecuteSql(sql);
            result = true;

            return(result);
        }
Esempio n. 14
0
        public static bool DeleteOneSupplier(int supplierId)
        {
            bool result = false;

            SupplierType supplier = GetSupplierById(supplierId);

            if (supplier == null)
            {
                return(false);
            }

            String sql = string.Format("delete from [Supplier] where Supplierid={0}", supplierId);

            DataFactory.ExecuteSql(sql);
            result = true;

            return(result);
        }
Esempio n. 15
0
        public static bool DeleteOneItemStockInNote(String noteId)
        {
            bool result = false;

            ItemStockInNoteType note = ItemStockInNoteDAL.GetOneItemStockInNote(noteId);

            if (note == null)
            {
                return(false);
            }

            String sql = string.Format("delete from [ItemStockInNote] where NoteId={0}", noteId);

            DataFactory.ExecuteSql(sql);
            result = true;

            return(result);
        }
Esempio n. 16
0
        public static bool DeleteOneSourcingNote(int noteId)
        {
            bool result = false;

            SourcingNoteType note = GetSourcingNoteById(noteId);

            if (note == null)
            {
                return(false);
            }

            String sql = string.Format("delete from [SourcingNote] where SourcingId={0}", noteId);

            DataFactory.ExecuteSql(sql);
            result = true;

            return(result);
        }
Esempio n. 17
0
        public static bool UpdateTransactionDeliveryStatus(String transId, bool isDelivered, int deliveryNoteId)
        {
            String sql = "";

            if (isDelivered)
            {
                sql = string.Format("update [Transaction] set IsDelivered={0}, DeliveryNoteId={1} where TransactionId={2}",
                                    1, deliveryNoteId, transId);
            }
            else
            {
                sql = string.Format("update [Transaction] set IsDelivered={0}, DeliveryNoteId={1} where TransactionId={2}",
                                    0, -1, transId);
            }

            DataFactory.ExecuteSql(sql);
            return(true);
        }
Esempio n. 18
0
        public static bool DeleteOneListing(String itemID)
        {
            bool result = false;

            String sql = string.Format("delete from [ActiveListing] where ItemID='{0}'", itemID);

            try
            {
                DataFactory.ExecuteSql(sql);
                result = true;
            }
            catch (System.Exception ex)
            {
                Logger.WriteSystemLog(String.Format("Delete listing with ItemID={0} failed, error msg={1}", itemID, ex.Message));
            }

            return(result);
        } // DeleteOneListing
Esempio n. 19
0
        public static bool DeleteOneDeliveryNote(String noteId)
        {
            bool result = false;

            DeliveryNoteType deliveryNote = DeliveryNoteDAL.GetOneDeliveryNote(noteId);

            if (deliveryNote == null)
            {
                return(false);
            }

            String sql = string.Format("delete from [DeliveryNote] where DeliveryNoteId={0}", noteId);

            DataFactory.ExecuteSql(sql);
            result = true;

            return(result);
        }
Esempio n. 20
0
        public static bool DeleteOneItem(int itemId)
        {
            bool result = false;

            InventoryItemType itemInfo = GetItemById(itemId);

            if (itemInfo == null || itemInfo.ItemId <= 0)
            {
                return(false);
            }

            String sql = string.Format("delete from [Item] where ItemId={0}", itemId);

            DataFactory.ExecuteSql(sql);
            result = true;

            return(result);
        }   // DeleteOneItem