Ejemplo n.º 1
0
        protected void ASPxGridViewMobileTransaction_CommandButtonInitialize(object sender, ASPxGridViewCommandButtonEventArgs e)
        {
            object isBuyer       = ASPxGridViewMobileTransaction.GetRowValues(e.VisibleIndex, "InventoryDeliveriesLocationID.LocationToID.IsBuyer");
            object needsMatching = ASPxGridViewMobileTransaction.GetRowValues(e.VisibleIndex, "InventoryDeliveriesLocationID.NeedsMatching");

            if (CommonMethods.ParseBool(isBuyer) && CommonMethods.ParseBool(needsMatching))
            {
                e.Visible = true;
            }
            else
            {
                e.Visible = false;
            }
        }
Ejemplo n.º 2
0
        protected void CallbackPanelMobileTransaction_Callback(object sender, CallbackEventArgsBase e)
        {
            if (e.Parameter == "RefreshGrid")
            {
                ASPxGridViewMobileTransaction.DataBind();
            }
            else if (e.Parameter == "TransferToIssueDocument")
            {
                //pridobimo seznam izbranih lokacij
                List <int> selectedItems = ASPxGridViewMobileTransaction.GetSelectedFieldValues("InventoryDeliveriesLocationID.LocationToID.BuyerID.ClientID").OfType <int>().ToList();

                //preverimi če imajo vse izbrane transkacije enakega kupca
                int count = selectedItems.Count(si => si == selectedItems[0]);
                if (selectedItems.Count > 0 && selectedItems.Count == count)
                {
                    List <int> selectedItemsID = ASPxGridViewMobileTransaction.GetSelectedFieldValues("MobileTransactionID").OfType <int>().ToList();
                    issueDocumentRepo.CreateIssueDocumentFromMobileTransactions(selectedItemsID, PrincipalHelper.GetUserID(), selectedItems[0]);
                    ASPxGridViewMobileTransaction.Selection.UnselectAll();
                    CallbackPanelMobileTransaction.JSProperties["cpErrorIssueDocumentCreated"] = true;
                }
                else
                {
                    CallbackPanelMobileTransaction.JSProperties["cpErrorDifferentBuyers"] = true;
                    ASPxGridViewMobileTransaction.Selection.UnselectAll();
                    return;
                }
            }
            else
            {
                object mobileTransaction = ASPxGridViewMobileTransaction.GetRowValues(ASPxGridViewMobileTransaction.FocusedRowIndex, "MobileTransactionID");
                bool   openPopup         = SetSessionsAndOpenPopUp(e.Parameter, Enums.MobileTransactionSession.MobileTransactionID, mobileTransaction);

                if (openPopup)
                {
                    PopupControlMobileTransaction.ShowOnPageLoad = true;
                }
            }
        }