Exemple #1
0
        public IList <INVTransferItemEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <INVTransferItemEntity> iNVTransferItemEntityList = new List <INVTransferItemEntity>();

            try
            {
                if (pageSize == -1)
                {
                    pageSize = 1000000000;
                }

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = INVTransferItemEntity.FLD_NAME_TransferItemID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

                startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1;

                iNVTransferItemEntityList = FCCINVTransferItem.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

                if (iNVTransferItemEntityList != null && iNVTransferItemEntityList.Count > 0)
                {
                    totalRowCount = iNVTransferItemEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(iNVTransferItemEntityList ?? new List <INVTransferItemEntity>());
        }
Exemple #2
0
        private void AddItemToINVTransferItemEntity()
        {
            try
            {
                INVTransferItemEntity iNVTransferItemEntity = CurrentINVTransferItemEntity;

                iNVTransferItemEntity.TransferID = INVTransferID;
                iNVTransferItemEntity.ItemID     = Int64.Parse(hdEmpID.Value);

                String fe_StoreUnitID   = SqlExpressionBuilder.PrepareFilterExpression("INVStoreUnit.StoreID", CurrentINVTransferEntity.TransferFromStoreID.ToString(), SQLMatchType.Equal);
                String fe_ItemID        = SqlExpressionBuilder.PrepareFilterExpression("INVStoreUnitItem.ItemID", iNVTransferItemEntity.ItemID.ToString(), SQLMatchType.Equal);
                String fe_StoreUnitItem = SqlExpressionBuilder.PrepareFilterExpression(fe_StoreUnitID, SQLJoinType.AND, fe_ItemID);
                IList <INVStoreUnitItem_DetailedEntity> lst = FCCINVStoreUnitItem_Detailed.GetFacadeCreate().GetIL(10000, 1, String.Empty, fe_StoreUnitItem);

                if (lst != null && lst.Count > 0)
                {
                    iNVTransferItemEntity.BrandID   = lst[0].BrandID;
                    iNVTransferItemEntity.RegionID  = lst[0].RegionID;
                    iNVTransferItemEntity.CountryID = lst[0].CountryID;
                }

                iNVTransferItemEntity.RequestQty = 0;

                Int64 result = -1;

                result = FCCINVTransferItem.GetFacadeCreate().Add(iNVTransferItemEntity, DatabaseOperationType.Add, TransactionRequired.No);

                BindList();
            }

            catch (Exception ex)
            {
            }
        }
Exemple #3
0
        private void UpdateAllINVTransferItemEntity()
        {
            try
            {
                IList <ListViewDataItem> list = lvINVTransferItem.Items;

                if (list != null && list.Count > 0)
                {
                    Int32 tempDataItemIndex = 0;

                    foreach (ListViewDataItem lvdi in list)
                    {
                        DataKey currentDataKey    = lvINVTransferItem.DataKeys[tempDataItemIndex++];
                        Int64   intTransferItemID = (Int64)currentDataKey["TransferItemID"];

                        TextBox txtRequestQtyLV = (TextBox)lvdi.FindControl("txtRequestQtyLV");
                        TextBox txtRemarksLV    = (TextBox)lvdi.FindControl("txtRemarksLV");

                        Decimal requestedQty;

                        Decimal.TryParse(txtRequestQtyLV.Text.Trim(), out requestedQty);

                        INVTransferItemEntity _INVTransferItem = FCCINVTransferItem.GetFacadeCreate().GetByID(intTransferItemID);

                        _INVTransferItem.RequestQty = requestedQty;

                        if (txtRemarksLV.Text.IsNotNullOrEmpty())
                        {
                            _INVTransferItem.Remarks = txtRemarksLV.Text.Trim().ToString();
                        }
                        else
                        {
                            _INVTransferItem.Remarks = null;
                        }

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(INVTransferItemEntity.FLD_NAME_TransferItemID, intTransferItemID.ToString(), SQLMatchType.Equal);

                        FCCINVTransferItem.GetFacadeCreate().Update(_INVTransferItem, fe, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    MiscUtil.ShowMessage(lblMessage, "Transfer Item Information has been updated successfully.", false);
                    BindList();
                }
            }

            catch (Exception ex)
            {
                MiscUtil.ShowMessage(lblMessage, "Failed to to update Transfer Item Information.", true);
            }
        }
Exemple #4
0
        public IList <INVTransferItemEntity> GetData()
        {
            IList <INVTransferItemEntity> iNVTransferItemEntityList = new List <INVTransferItemEntity>();

            try
            {
                iNVTransferItemEntityList = FCCINVTransferItem.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

                if (iNVTransferItemEntityList != null && iNVTransferItemEntityList.Count > 0)
                {
                    totalRowCount = iNVTransferItemEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(iNVTransferItemEntityList ?? new List <INVTransferItemEntity>());
        }
Exemple #5
0
        protected void lvINVTransferItem_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 TransferItemID;

            Int64.TryParse(e.CommandArgument.ToString(), out TransferItemID);

            if (TransferItemID > 0)
            {
                if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(INVTransferItemEntity.FLD_NAME_TransferItemID, TransferItemID.ToString(), SQLMatchType.Equal);

                        INVTransferItemEntity iNVTransferItemEntity = new INVTransferItemEntity();


                        result = FCCINVTransferItem.GetFacadeCreate().Delete(iNVTransferItemEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _TransferItemID        = 0;
                            _INVTransferItemEntity = new INVTransferItemEntity();
                            PrepareInitialView();
                            BindINVTransferItemList();

                            MiscUtil.ShowMessage(lblMessage, "Transfer Item has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Transfer Item.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }