예제 #1
0
        public object InsertUpdateInventoryItem([FromBody] InsertUpdateParameter <InventoryItem> item)
        {
            ServiceResult result = new ServiceResult();

            try
            {
                var objBL = new BLInventoryItem();
                if (objBL.CheckCodeExists(item.Data.InventoryItemID, item.Data.InventoryItemCode))
                {
                    result.Success   = false;
                    result.ErrorCode = ErrorCode.DuplicateCode;
                }
                else
                {
                    result.Success = objBL.InsertUpdateInventoryItem(item.Data);
                    //if (objBL.InactiveObject("InventoryItem", "InventoryItemID", item.OldID))
                    //{
                    //    result.Success = objBL.InsertUpdateInventoryItem(item.Data);
                    //}
                    //else
                    //{
                    //    result.Success = false;
                    //    result.ErrorCode = ErrorCode.ItemNotInactive;
                    //}
                }
            }
            catch (Exception ex)
            {
                CommonFunction.WriteLog(ex, SerializeUtil.Serialize(item), Request.RequestUri.ToString());
                result.Success   = false;
                result.ErrorCode = ex.Message;
            }
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Load thông tin hóa đơn
        /// </summary>
        private void LoadSAInvoice()
        {
            dsDictionary.Clear();
            dsDictionary.SAInvoice.Merge(oBLSAInvoice.GetDataByID(SAInvoiceID), false, MissingSchemaAction.Ignore);
            dsDictionary.SAInvoiceDetail.Merge(oBLSAInvoice.GetDataDetailByID(SAInvoiceID), false, MissingSchemaAction.Ignore);
            BLInventoryItem oBLInventoryItem = new BLInventoryItem();

            foreach (var item in dsDictionary.SAInvoiceDetail)
            {
                if (dsDictionary.InventoryItem.FindByInventoryItemID(item.ItemID) == null)
                {
                    dsDictionary.InventoryItem.Merge(oBLInventoryItem.GetByID_SAInvoice(item.ItemID));
                }
            }
        }
예제 #3
0
        public object GetInventoryItemByID(Guid itemID)
        {
            ServiceResult        result = new ServiceResult();
            List <InventoryItem> items;

            try
            {
                items          = new BLInventoryItem().GetInventoryItem(itemID);
                result.Success = true;
                result.Data    = items;
            }
            catch (Exception ex)
            {
                CommonFunction.WriteLog(ex, SerializeUtil.Serialize(itemID), Request.RequestUri.ToString());
                result.Success   = false;
                result.ErrorCode = ex.Message;
            }
            return(result);
        }
 protected override void InitBusinessObject()
 {
     base.InitBusinessObject();
     oBL = new BLInventoryItem();
 }