Example #1
0
        protected object GetMasterRowKeyValue(ASPxTreeList treeList)
        {
            GridViewBaseRowTemplateContainer container = null;
            Control control = treeList;

            while (control.Parent != null)
            {
                container = control.Parent as GridViewBaseRowTemplateContainer;
                if (container != null)
                {
                    break;
                }
                control = control.Parent;
            }
            return(container.KeyValue);
        }
Example #2
0
        public void InstantiateIn(Control container)
        {
            parent = (GridViewBaseRowTemplateContainer)container;
            //CssPostfix = parent.Grid.CssPostfix;
            //tbControl = new Table();
            tbData = new Table();
            //tbControl.SetTableControlStyle(CssPostfix);
            //tbData.SetTableStyle(CssPostfix);
            //TableRow row = new TableRow();
            //TableCell cell = new TableCell();
            //cell.Controls.Add(tbData);
            //row.Cells.Add(cell);
            //tbControl.Rows.Add(row);
            //tbData.SetPageContentStyle(parent.Grid.CssPostfix);
            int paymentID = (int)DataBinder.Eval(parent.DataItem, "PaymentID");

            payment = context.PersistencySession.Get <iSabaya.Payment>(paymentID);
            if (payment.Type.Equals(typeof(Cheque)))
            {
                Cheque c = payment as Cheque;
                this.AddDataItem(c);
            }
            else if (payment.Type.Equals(typeof(Cash)))
            {
                Cash c = payment as Cash;
                this.AddDataItem("Destination Bank Account:", c.DestinationBankAccount);
                this.AddDataItem("Recipient Name:", c.RecipientName);
            }
            else if (payment.Type.Equals(typeof(BankDeposit)))
            {
                BankDeposit bd = payment as BankDeposit;
                this.AddDataItem(bd.Cheque);
                this.AddDataItem("Bank Account:", bd.BankAccount);
                this.AddDataItem("Recipient Name:", bd.RecipientName);
            }
            else if (payment.Type.Equals(typeof(FundTransfer)))
            {
                FundTransfer ft = payment as FundTransfer;
                this.AddDataItem("Status:", ft.Status.ToString());
                this.AddDataItem("Status Date:", ft.StatusDate);
                this.AddDataItem("From Bank Account:", ft.FromBankAccount);
                this.AddDataItem("To Bank Account:", ft.ToBankAccount);
                this.AddDataItem("Recipient Name:", ft.RecipientName);
            }
            parent.Controls.Add(tbData);
        }