private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            var messageQueue = SnackbarThree.MessageQueue;

            if (TextBoxName.Text == string.Empty)
            {
                TextBoxName.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe o nome"));
                return;
            }

            if (TextBoxValue.Text == string.Empty)
            {
                TextBoxValue.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe o valor"));
                return;
            }

            string   name     = TextBoxName.Text;
            Double   value    = Double.Parse(TextBoxValue.Text, NumberStyles.Currency);
            DateTime deadline = DatePickerDeadline.SelectedDate ?? DateTime.Now;

            control.SaveGoal(name, value, deadline);
            LoadGoals();

            TextBoxName.Text        = string.Empty;
            TextBoxValue.Text       = string.Empty;
            DatePickerDeadline.Text = string.Empty;

            LoadBox();
        }
Ejemplo n.º 2
0
/*
 *      private bool IncomeCategory;
 */

        public AddTransaction(List <Category> categories, List <Account> accounts,
                              List <Currency> currencies)
        {
            InitializeComponent();
            ComboBoxAccount.ItemsSource  = accounts;
            ComboBoxCategory.ItemsSource = categories;
            if (accounts.Any())
            {
                ComboBoxAccount.SelectedIndex = 0;
            }
            if (categories.Any())
            {
                ComboBoxCategory.SelectedIndex = 0;
            }

            //_curremcyRs = currencyExchangeRs;
            _currencyList             = currencies;
            ButtonExpanse.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 209, 43));
            ButtonIncome.BorderBrush  = new SolidColorBrush(Color.FromArgb(0, 255, 209, 43));;
            IsSuccesful  = false;
            _initialized = true;
            IsIncome     = false;
            ValidateCurrencyVal();
            TextBoxValue.Focus();
            if (TextBoxValueCat.Text == "0" || TextBoxValueCat.Text == "0.00")
            {
                TextBoxValueCat.BorderBrush = Brushes.Red;
            }
            else
            {
                TextBoxValueCat.BorderBrush = Brushes.Black;
            }
        }
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            var messageQueue = SnackbarThree.MessageQueue;

            if (TextBoxValue.Text == string.Empty)
            {
                TextBoxValue.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe o valor da transferência"));
                return;
            }

            if (DatePickerData.Text == string.Empty)
            {
                DatePickerData.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe a data da transferência"));
                return;
            }

            if (ComboBoxOut.Text == string.Empty)
            {
                ComboBoxOut.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe a conta de saída"));
                return;
            }

            if (ComboBoxIn.Text == string.Empty)
            {
                ComboBoxIn.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe a conta de entrada"));
                return;
            }

            Double   value      = Double.Parse(TextBoxValue.Text, NumberStyles.Currency);
            DateTime date       = DatePickerData.SelectedDate ?? DateTime.Now;
            var      accountOut = ComboBoxOut.SelectedItem;
            var      accountIn  = ComboBoxIn.SelectedItem;

            if (accountIn == accountOut)
            {
                ComboBoxIn.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("A conta de saída deve ser diferente da conta de entrada!"));
                return;
            }

            control.SaveTransferCash(value, date, accountOut, accountIn);
            LoadTransfers();

            TextBoxValue.Text         = string.Empty;
            ComboBoxOut.SelectedIndex = -1;
            ComboBoxIn.SelectedIndex  = -1;
            DatePickerData.Text       = string.Empty;
        }
        private void ButtonAddExpense_Click(object sender, RoutedEventArgs e)
        {
            var messageQueue = SnackbarThree.MessageQueue;

            if (TextBoxValue.Text == string.Empty)
            {
                TextBoxValue.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe o valor da saída"));
                return;
            }

            if (DatePickerData.Text == string.Empty)
            {
                DatePickerData.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe a data saída"));
                return;
            }

            if (ComboBoxCategory.Text == string.Empty)
            {
                ComboBoxCategory.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe a categoria da saída"));
                return;
            }

            if (ComboBoxAccounts.Text == string.Empty)
            {
                ComboBoxAccounts.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Informe a conta da saída"));
                return;
            }

            Double   value    = Double.Parse(TextBoxValue.Text, NumberStyles.Currency);
            DateTime date     = DatePickerData.SelectedDate ?? DateTime.Now;
            var      account  = ComboBoxAccounts.SelectedItem;
            var      goal     = ComboBoxGoals.SelectedItem;
            var      category = ComboBoxCategory.SelectedItem;

            if (goal != null)
            {
                control.DebitGoal(goal, value);
            }

            control.SaveExpense(value, date, account, category);
            LoadExpenses();

            TextBoxValue.Text = string.Empty;
            ComboBoxAccounts.SelectedIndex = -1;
            DatePickerData.Text            = string.Empty;
            ComboBoxGoals.SelectedIndex    = -1;
            ComboBoxCategory.SelectedIndex = -1;
        }
Ejemplo n.º 5
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance == this)
        {
            Destroy(gameObject);
        }

        shifter      = GetComponent <LetterShifter>();
        generator    = GetComponent <LetterGenerator>();
        textBoxValue = GetComponent <TextBoxValue>();
    }
Ejemplo n.º 6
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            var messageQueue = SnackbarThree.MessageQueue;

            if (TextBoxValue.Text == string.Empty)
            {
                TextBoxValue.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Entrez la valeur de transfert"));
                return;
            }

            if (DatePickerData.Text == string.Empty)
            {
                DatePickerData.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Indiquez la date de transfert"));
                return;
            }

            if (ComboBoxOut.Text == string.Empty)
            {
                ComboBoxOut.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Déclarer le compte de sortie"));
                return;
            }

            if (ComboBoxIn.Text == string.Empty)
            {
                ComboBoxIn.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Saisir le compte d'entrée"));
                return;
            }

            Double   value      = Double.Parse(TextBoxValue.Text, NumberStyles.Currency);
            DateTime date       = DatePickerData.SelectedDate ?? DateTime.Now;
            var      accountOut = ComboBoxOut.SelectedItem;
            var      accountIn  = ComboBoxIn.SelectedItem;

            control.SaveTransferCash(value, date, accountOut, accountIn);
            LoadTransfers();

            TextBoxValue.Text         = string.Empty;
            ComboBoxOut.SelectedIndex = -1;
            ComboBoxIn.SelectedIndex  = -1;
            DatePickerData.Text       = string.Empty;
        }
        private void ButtonAddIncoming_Click(object sender, RoutedEventArgs e)
        {
            var messageQueue = SnackbarThree.MessageQueue;

            if (TextBoxValue.Text == string.Empty)
            {
                TextBoxValue.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Saisir la valeur de l'entrée"));
                return;
            }

            if (DatePickerData.Text == string.Empty)
            {
                DatePickerData.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Saisir la date d'entrée"));
                return;
            }

            if (ComboBoxCategory.Text == string.Empty)
            {
                ComboBoxCategory.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Entrez la catégorie d'entrée"));
                return;
            }

            if (ComboBoxAccounts.Text == string.Empty)
            {
                ComboBoxAccounts.Focus();
                Task.Factory.StartNew(() => messageQueue.Enqueue("Saisissez la facture d'entrée"));
                return;
            }

            Double   value    = Double.Parse(TextBoxValue.Text, NumberStyles.Currency);
            DateTime date     = DatePickerData.SelectedDate ?? DateTime.Now;
            var      account  = ComboBoxAccounts.SelectedItem;
            var      category = ComboBoxCategory.SelectedItem;

            control.SaveIncoming(value, date, account, category);
            LoadIncomings();

            TextBoxValue.Text = string.Empty;
            ComboBoxAccounts.SelectedIndex = -1;
            DatePickerData.Text            = string.Empty;
            ComboBoxCategory.SelectedIndex = -1;
        }
        public ModifySpawnDelayWindow(int spawnCount)
        {
            InitializeComponent();

            SpawnsLabel.Content = $"Modify delay for {spawnCount} spawn{(spawnCount == 1 ? "" : "s")}";

            Data.DataContext = this;

            TextBoxValue.Text = Value.ToString();
            TextBoxValue.Focus();
            TextBoxValue.SelectAll();

            foreach (DelayModificationFunction dmf in (DelayModificationFunction[])Enum.GetValues(typeof(DelayModificationFunction)))
            {
                FunctionComboBox.Items.Add(new ComboBoxItem {
                    Content = dmf.ToString()
                });
            }
        }
Ejemplo n.º 9
0
        private void SetControls(bool isEnabled)
        {
            if (InvokeRequired)
            {
                Invoke(new SetControlsDelegate(SetControls), isEnabled);
            }
            else
            {
                TextBoxKey.Enabled        = isEnabled;
                TextBoxValue.Enabled      = isEnabled;
                ButtonAddVariable.Enabled = isEnabled;

                if (isEnabled)
                {
                    TextBoxKey.Clear();
                    TextBoxValue.Clear();
                }
            }
        }
Ejemplo n.º 10
0
        private void ButtonAdd_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TextBoxValue.Text))
            {
                TextBoxValue.Focus();
                return;
            }

            DnEntryDefinition dnEntryDefinition = ((ComboBoxDnEntryTypeItem)ComboBoxType.SelectedItem).DnEntryDefinition;
            DnEntry           dnEntry           = new DnEntry(dnEntryDefinition, TextBoxValue.Text);

            ListViewSubject.Items.Add(new ListViewItem()
            {
                Tag = dnEntry
            });

            TextBoxValue.Text = null;

            ReloadListView();
        }
Ejemplo n.º 11
0
 public AddTransaction(List <Category> categories, List <Account> accounts,
                       List <Currency> currencies, long categoryId, bool isIncome, string info, decimal value, long accountId, string payee, decimal transValue)
 {
     InitializeComponent();
     ComboBoxAccount.ItemsSource    = accounts;
     ComboBoxCategory.ItemsSource   = categories;
     ComboBoxAccount.SelectedIndex  = accounts.FindIndex(x => x.Id.Equals(accountId));
     ComboBoxCategory.SelectedIndex = categories.FindIndex(x => x.Id.Equals(categoryId));
     TextBoxPayee.Text    = payee;
     TextBoxNote.Text     = info;
     ValueCat             = transValue;
     TextBoxValue.Text    = value.ToString(CultureInfo.CurrentCulture);
     TextBoxValueCat.Text = ValueCat.ToString(CultureInfo.CurrentCulture);
     //_curremcyRs = currencyExchangeRs;
     _currencyList = currencies;
     IsIncome      = isIncome;
     if (IsIncome)
     {
         ButtonExpanse.BorderBrush  = new SolidColorBrush(Color.FromArgb(0, 255, 209, 43));;
         ButtonIncome.BorderBrush   = new SolidColorBrush(Color.FromArgb(255, 255, 209, 43));
         ComboBoxCategory.IsEnabled = false;
         LabelCategory.IsEnabled    = false;
     }
     else
     {
         ButtonExpanse.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 209, 43));
         ButtonIncome.BorderBrush  = new SolidColorBrush(Color.FromArgb(0, 255, 209, 43));;
     }
     ValidateCurrencyVal();
     _initialized = true;
     TextBoxValue.Focus();
     if (TextBoxValueCat.Text == "0" || TextBoxValueCat.Text == "0.00")
     {
         TextBoxValueCat.BorderBrush = Brushes.Red;
     }
     else
     {
         TextBoxValueCat.BorderBrush = Brushes.Black;
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// As result of text property change, set actual value to "Value" dependency property
 /// </summary>
 /// <param name="sender">Event sender</param>
 /// <param name="e">Event arguments</param>
 private void numericBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (string.IsNullOrEmpty(TextBoxValue))
     {
         // Set only the dependancy property and leave the text box empty
         Value = 0;
     }
     else if ((TextBoxValue.StartsWith("-") || TextBoxValue.StartsWith("+")) && TextBoxValue.Length == 1)
     {
         // Set only the dependancy property and accept the '-' or '+' character as correct
         Value = 0;
     }
     else if (!double.TryParse(TextBoxValue, out double numericBoxValue))
     {
         // Rollback the value
         SetTextBoxValue(Value);
     }
     else
     {
         // Set the actual value
         Value = numericBoxValue;
     }
 }
Ejemplo n.º 13
0
        private void AddCommodity_Click(object sender, RoutedEventArgs e)
        {
            double value;

            try
            {
                value = Convert.ToDouble(TextBoxValue.Text);
            }
            catch (FormatException)
            {
                ErrorDialog("Mængden er ikke korrekt indtastet");
                return;
            }

            // We need to figure out if the Commodity added already exists or if it
            // just a text string.
            // First we will try to cast it as a Commodity object...
            Commodity commodity = null;

            try
            {
                commodity = (Commodity)CommodityName.SelectedItem;
            }
            catch (InvalidCastException exp)
            {
                // This isn't a severe exception
                Console.Write($@"Couldn't cast: {exp}");
            }

            if (commodity != null)
            {
                // Commodity could not be casted. therefore it must be a string...
                _shawdowCommodities.Add(new CommodityShadow
                {
                    Id        = 1,
                    Commodity = commodity,
                    Name      = commodity.Name,
                    Value     = value,
                    Unit      = (Units)ComboBoxUnit.SelectionBoxItem
                });
            }
            else
            {
                var name = CommodityName.Text;
                if (name.Length < 1)
                {
                    ErrorDialog("Råvare navnet er ikke gyldigt.");
                    return;
                }

                _shawdowCommodities.Add(new CommodityShadow
                {
                    Id    = 1,
                    Name  = name,
                    Value = value,
                    Unit  = (Units)ComboBoxUnit.SelectionBoxItem
                });
            }

            TextBoxValue.Clear();
            CommodityName.SelectedIndex = -1;
            CommodityName.Text          = "";

            ListBoxCommodities.ItemsSource = _shawdowCommodities;
            ListBoxCommodities.Items.Refresh();
        }
Ejemplo n.º 14
0
 private void InitializeControls()
 {
     TextBoxValue.SetTextDataBinding(_identity, nameof(_identity.Value));
     CmbType.DataSource = Enum.GetValues(typeof(CustomerIdentity.IdentityTypes));
     CmbType.SetSelectedItemDataBinding(_identity, nameof(_identity.IdentityType));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Tries to set the keyboard focus (cursor) to the first content field
 /// </summary>
 public void ContentFocus()
 {
     TextBoxValue.Focus();
 }
        //MAIG - CH1 - END -  Adding region which contains un-used code
        /// <summary>
        /// Get the details for Email content
        /// </summary>

        private void CreateRequestAndGetResponse(Boolean result, string status)
        {
            if (result)
            {
                List <string> response = new List <string>();
                //MAIG - CH2 - BEGIN -  Adding variable and set the value based on the entered poicy is valid or invalid
                string invalidUnEnrollFlow = string.Empty;

                if ((((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._InvalidUnEnrollFlow) != null)
                {
                    invalidUnEnrollFlow = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._InvalidUnEnrollFlow;
                }


                // Included MAIG Iteration2 - start - for getting the UserInfo details
                //OrderClasses.Service.Order authUserObj = new OrderClasses.Service.Order();
                //UserInfo userInfoObj = new UserInfo();

                //userInfoObj = authUserObj.Authenticate(HttpContext.Current.User.Identity.Name, string.Empty, CSAAWeb.Constants.PC_APPID_PAYMENT_TOOL);
                // Included MAIG Iteration2 - end - for getting the UserInfo details
                //MAIG - CH2 - END -  Adding variable and set the value based on the entered poicy is valid or invalid
                PCEnrollmentMapping pCEnroll = new PCEnrollmentMapping();
                //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Renamed the Autpay Enrollment request to Payment Enrollment request
                RecordPaymentEnrollment.recordPaymentEnrollmentStatusRequest statusRequest = new RecordPaymentEnrollment.recordPaymentEnrollmentStatusRequest();
                statusRequest.applicationContext = new RecordPaymentEnrollment.ApplicationContext();
                //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Renamed the Autpay Enrollment request to Payment Enrollment request
                statusRequest.applicationContext.application = Config.Setting(CSAAWeb.Constants.PC_ApplicationContext_Payment_Tool);
                statusRequest.applicationContext.address     = CSAAWeb.AppLogger.Logger.GetIPAddress();
                statusRequest.userId = HttpContext.Current.User.Identity.Name;
                //MAIG - CH3 - BEGIN -  Logic added to pass the Blaze rule if it is an valid flow
                if (!(invalidUnEnrollFlow.Equals("True")))
                {
                    statusRequest.enrollmentEffectiveDateSpecified = true;
                    statusRequest.enrollmentEffectiveDate          = Convert.ToDateTime(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment[2]);
                    statusRequest.enrollmentReasonCode             = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment[3];
                }
                //MAIG - CH3 - END -  Logic added to pass the Blaze rule if it is an valid flow
                //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Added the namespace
                statusRequest.policyInfo = new RecordPaymentEnrollment.PolicyProductSource();
                //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Added the namespace
                statusRequest.policyInfo.policyNumber = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page)).PolicyNumber;
                statusRequest.policyInfo.type         = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ProductType_PC;



                //MAIG - CH4 - BEGIN -  Including Agent ID, Agency ID & SourceSystem to the Enrollment Request
                if (string.IsNullOrEmpty(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoAgencyID) || ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoAgencyID.ToString().Equals("0"))
                {
                    statusRequest.agency = string.Empty;
                }
                else
                {
                    statusRequest.agency = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoAgencyID.ToString();
                }


                //////if (string.IsNullOrEmpty(userInfoObj.RepId.ToString()) || userInfoObj.RepId.ToString().Equals("0"))
                //////    statusRequest.agentIdentifier = string.Empty;
                //////else
                //////    statusRequest.agentIdentifier = userInfoObj.RepId.ToString();

                if (this.Page.User.Identity.Name.Length > 9)
                {
                    statusRequest.agentIdentifier = Convert.ToString(this.Page.User.Identity.Name).Substring(1);
                }
                else if (string.IsNullOrEmpty(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoRepID) || !((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoRepID.ToString().Equals("0"))
                {
                    statusRequest.agentIdentifier = Convert.ToString(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoRepID);
                }
                else
                {
                    statusRequest.agentIdentifier = null;
                }


                /*if ((((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._InvalidPolicyFlow == null) && (!(invalidUnEnrollFlow.Equals("True"))))
                 * {
                 *  statusRequest.policyInfo.dataSource = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidPolicySourceSystem;
                 * }
                 * else
                 * {
                 *  IssueDirectPaymentWrapper wrap = new IssueDirectPaymentWrapper();
                 *  statusRequest.policyInfo.dataSource = wrap.DataSource(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ProductType_PT, statusRequest.policyInfo.policyNumber.Length);
                 * }*/
                statusRequest.policyInfo.dataSource = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidPolicySourceSystem;
                //MAIG - CH4 - END -  Including Agent ID, Agency ID & SourceSystem to the Enrollment Request
                //MAIG - CH5 - BEGIN -  Condition added to check if it is an valid policy number
                if (!(invalidUnEnrollFlow.Equals("True")))
                {
                    //MAIG - CH5 - END -  Condition added to check if it is an valid policy number

                    //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Added the namespace
                    statusRequest.paymentItem = new RecordPaymentEnrollment.PaymentItemHeader();
                    //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Added the namespace
                    if (((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment[1].Equals(CSAAWeb.Constants.PC_YES_NOTATION) ||
                        ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment[1].Equals(string.Empty))
                    {
                        if (paymentType.Equals(CSAAWeb.Constants.PC_Payment_CC))
                        {
                            statusRequest.paymentItem.paymentMethod = Config.Setting(CSAAWeb.Constants.PC_CreditCard_Code);
                            //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Added the namespace
                            statusRequest.paymentItem.card = new RecordPaymentEnrollment.PaymentCard();
                            //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Added the namespace
                            statusRequest.paymentItem.card.number = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._CCNumber;
                            statusRequest.paymentItem.card.type   = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._CCType;
                        }
                        else
                        {
                            statusRequest.paymentItem.paymentMethod = Config.Setting(CSAAWeb.Constants.PC_ElectronicFund_Code);
                            //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Added the namespace
                            statusRequest.paymentItem.account = new RecordPaymentEnrollment.PaymentAccount();
                            //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Added the namespace
                            statusRequest.paymentItem.account.accountNumber = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ECAccountNo;
                            statusRequest.paymentItem.account.type          = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ECaacType;
                        }

                        //MAIG - CH6 - BEGIN -  Adding Email ID value to the REQUEST
                        if (!string.IsNullOrEmpty(TextBoxValue))
                        {
                            statusRequest.emailTo = TextBoxValue.ToString();
                        }
                        //MAIG - CH6 - END -  Adding Email ID value to the REQUEST

                        Logger.Log("Request sent to un-Enroll for policy number " + statusRequest.policyInfo.policyNumber);
                        //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Renamed the new service method
                        response = pCEnroll.PCPaymentEnrollService(statusRequest);
                        //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Renamed the new service method
                        if (response != null)
                        {
                            if (response[0].ToString().ToUpper().Equals(CSAAWeb.Constants.PC_SUCESS.ToUpper()))
                            {
                                Logger.Log("Success Response to un-Enroll for policy number " + statusRequest.policyInfo.policyNumber);

                                //MAIG - CH7 - BEGIN -  Disabling the PT Email trigger
                                ////if (status.Equals(CSAAWeb.Constants.PC_SUCESS) && !string.IsNullOrEmpty(TextBoxValue))
                                ////{
                                ////    SendMail(TextBoxValue, status);
                                ////}
                                //MAIG - CH7 - END -  Disabling the PT Email trigger

                                Context.Items.Add(Constants.PC_VLD_UNENROLL, ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment);
                                Server.Transfer(CSAAWeb.Constants.PC_UNENROLL_CONFIRM_PATH, false);
                            }

                            else
                            {
                                Logger.Log(Constants.PC_LOG_EMAIL_POPUP + statusRequest.policyInfo.policyNumber);
                                //MAIG - CH12 - BEGIN - Modified code to display the Error Code only once
                                //lblError.Text = response[1].ToString() + " (" + response[0].ToString() + ")";
                                lblError.Text = response[1].ToString();
                                //MAIG - CH12 - END - Modified code to display the Error Code only once
                                content.Visible  = false;
                                lblError.Visible = false;
                                Label Error = (Label)this.Parent.FindControl(Constants.PC_LBLERRORMSG);
                                if (Error != null)
                                {
                                    Error.Visible = true;
                                    Error.Text    = lblError.Text;
                                }
                                Logger.Log(lblError.Text.ToString());

                                //MAIG - CH8 - BEGIN -  Disabling the PT Email trigger
                                ////if (!string.IsNullOrEmpty(TextBoxValue))
                                ////{
                                ////    SendMail(TextBoxValue, CSAAWeb.Constants.PC_FAIL);
                                ////}
                                //MAIG - CH8 - END -  Disabling the PT Email trigger
                            }
                        }
                        else
                        {
                            Label Error = (Label)this.Parent.FindControl(Constants.PC_LBLERRORMSG);
                            content.Visible = false;
                            if (Error != null)
                            {
                                Error.Visible = true;
                                Error.Text    = lblError.Text;
                            }
                            Logger.Log(lblError.Text.ToString());

                            //MAIG - CH9 - BEGIN -  Disabling the PT Email trigger
                            ////if (!string.IsNullOrEmpty(TextBoxValue))
                            ////{
                            ////    SendMail(TextBoxValue, CSAAWeb.Constants.PC_FAIL);
                            ////}
                            //MAIG - CH9 - END -  Disabling the PT Email trigger
                        }
                    }


                    else
                    {
                        content.Visible = false;
                        if ((((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment[1]).ToString().Equals("N"))
                        {
                            lblError.Text = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment[0];
                        }

                        Label Error = (Label)this.Parent.FindControl(Constants.PC_LBLERRORMSG);
                        if (Error != null)
                        {
                            Error.Visible = true;
                            Error.Text    = lblError.Text;
                        }
                        Logger.Log(lblError.Text.ToString());

                        //MAIG - CH10 - BEGIN -  Disabling the PT Email trigger
                        ////if (!string.IsNullOrEmpty(TextBoxValue))
                        ////{
                        ////    SendMail(TextBoxValue, CSAAWeb.Constants.PC_FAIL);
                        ////}
                        //MAIG - CH10 - END -  Disabling the PT Email trigger
                    }
                }
                else
                {
                    //MAIG - CH11 - BEGIN -  Disabling the PT Email trigger and set the Email ID value to PC Request
                    if (!string.IsNullOrEmpty(TextBoxValue))
                    {
                        statusRequest.emailTo = TextBoxValue.ToString();
                    }

                    Logger.Log("Request sent to un-Enroll for policy number " + statusRequest.policyInfo.policyNumber);
                    //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Renamed the new service method
                    response = pCEnroll.PCPaymentEnrollService(statusRequest);
                    //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Renamed the new service method
                    if (response != null)
                    {
                        if (response[0].ToString().ToUpper().Equals(CSAAWeb.Constants.PC_SUCESS.ToUpper()))
                        {
                            Logger.Log("Success Response to un-Enroll for policy number " + statusRequest.policyInfo.policyNumber);

                            ////if (status.Equals(CSAAWeb.Constants.PC_SUCESS) && !string.IsNullOrEmpty(TextBoxValue))
                            ////{
                            ////    SendMail(TextBoxValue, status);
                            ////}

                            //////Context.Items.Add(Constants.PC_VLD_UNENROLL, ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Unenrollment);
                            Server.Transfer(CSAAWeb.Constants.PC_UNENROLL_CONFIRM_PATH, false);
                        }

                        else
                        {
                            Logger.Log(Constants.PC_LOG_EMAIL_POPUP + statusRequest.policyInfo.policyNumber);
                            //MAIG - CH13 - BEGIN - Modified code to display the Error Code only once
                            //lblError.Text = response[1].ToString() + " (" + response[0].ToString() + ")";
                            lblError.Text = response[1].ToString();
                            //MAIG - CH13 - END - Modified code to display the Error Code only once
                            content.Visible  = false;
                            lblError.Visible = false;
                            Label Error = (Label)this.Parent.FindControl(Constants.PC_LBLERRORMSG);
                            if (Error != null)
                            {
                                Error.Visible = true;
                                Error.Text    = lblError.Text;
                            }
                            Logger.Log(lblError.Text.ToString());

                            ////if (!string.IsNullOrEmpty(TextBoxValue))
                            ////{
                            ////    SendMail(TextBoxValue, CSAAWeb.Constants.PC_FAIL);
                            ////}
                        }
                    }
                    else
                    {
                        Label Error = (Label)this.Parent.FindControl(Constants.PC_LBLERRORMSG);
                        content.Visible = false;
                        if (Error != null)
                        {
                            Error.Visible = true;
                            Error.Text    = lblError.Text;
                        }
                        Logger.Log(lblError.Text.ToString());

                        ////if (!string.IsNullOrEmpty(TextBoxValue))
                        ////{
                        ////    SendMail(TextBoxValue, CSAAWeb.Constants.PC_FAIL);
                        ////}
                        //MAIG - CH11 - END -  Disabling the PT Email trigger and set the Email ID value to PC Request
                    }
                }
            }
        }
Ejemplo n.º 17
0
        public WebReply Render(object caller)
        {
            string sFlyout = (ErrorText ?? String.Empty).ToString().Length > 0 ? "example-right" : String.Empty;

            if (Type == GEType.Text || Type == GEType.Date || Type == GEType.Password)
            {
                string sSize     = size > 0 ? "size='" + size.ToString() + "'" : String.Empty;
                string sReadOnly = ReadOnly ? "READONLY" : string.Empty;
                string sClass    = ReadOnly ? "reado" : string.Empty;

                string sOut = "<td " + ColSpan + " " + Width + "><span>" + CaptionText + "</span></td><td " + ColSpan2 + "><input class='" + sClass + "' type='" + Type + "' " + sReadOnly + " name='"
                              + Name + "' " + sSize + " id='" + Name + "' " + TextBoxAttribute + " style='" + TextBoxStyle + "' value='" + TextBoxValue + "' />&nbsp;<label class='"
                              + sFlyout + "' for='" + Name + "'>" + ErrorText + "</label></td>";
                WebReply wr1 = new WebReply();
                wr1.AddWebReply(sOut, "", Section, false);
                return(wr1);
            }
            else if (Type == GEType.Image)
            {
                string sOut = "<td colspan=2 align=center><img name='"
                              + Name + "' id='" + Name + "' src='" + URL + "' />&nbsp;</td>";
                return(new WebReply(sOut, "", Section, false));
            }
            else if (Type == GEType.DIV)
            {
                string sOut = "<div name='"
                              + Name + "' id='" + Name + "'>";
                WebReply wr1 = new WebReply();
                wr1.AddWebReply(sOut, "", Section, false);
                return(wr1);
            }
            else if (Type == GEType.Lightbox)
            {
                string sData = "<div id='div" + Name + "' name='div" + Name + "'><a id='img" + Name + "' name='img" + Name + "' data-featherlight='" + URL + "'>" + CaptionText + "</a></div>";
                Javascript = "$('#img" + Name + "').featherlightGallery();";
                WebReply wr1 = new WebReply();
                wr1.AddWebReply(sData, Javascript, Section, false);
                return(wr1);
            }
            else if (Type == GEType.HTML)
            {
                string sOut = "<div name='"
                              + Name + "' id='" + Name + "'>" + HTML + "</div>";
                WebReply wr1 = new WebReply();
                wr1.AddWebReply(sOut, Javascript, Section, false);
                return(wr1);
            }
            else if (Type == GEType.Label)
            {
                string sOut = "<td><span id='" + Name + "'>" + CaptionText + "</span></td>";
                if (("" + TextBoxValue).Length > 0)
                {
                    sOut += "<td>" + TextBoxValue + "</td>";
                }
                return(new WebReply(sOut, "", Section, false));
            }

            else if (Type == GEType.TreeView)
            {
                string sJS = "      $('.acidjs-css3-treeview').delegate('label input:checkbox [title=flower]', 'change', function()"
                             + "\r\n {    "
                             + " var checkbox = $(this),     nestedList = checkbox.parent().next().next(),"
                             + "\r\n       selectNestedListCheckbox = nestedList.find('label:not([for]) input:checkbox [title=flower]'); "
                             + "  \r\n     if(checkbox.is(':checked')) {"
                             + "\r\n return selectNestedListCheckbox.prop('checked', true);    }"
                             + "  \r\n     selectNestedListCheckbox.prop('checked', false);  \r\n });";

                sJS = "";

                string sHTML = "<div class=\"acidjs-css3-treeview\">";

                // iterate through the nodes
                XmlNode eleOuter = Nodes.DocumentElement;
                XmlNode oNode    = eleOuter.SelectNodes("NODES")[0].SelectNodes("Organization")[0];
                if (oNode != null)
                {
                    sHTML += "<ul>";
                }
                traversenodes(oNode);
                sHTML += sCumulativeHTML + "</div>";
                return(new WebReply(sHTML, sJS, Section, false));
            }
            else if (Type == GEType.TreeViewDummy)
            {
                string sJS = "      $('.acidjs-css3-treeview').delegate('label input:checkbox', 'change', function()"
                             + "\r\n {    "
                             + " var checkbox = $(this),     nestedList = checkbox.parent().next().next(),"
                             + "\r\n       selectNestedListCheckbox = nestedList.find('label:not([for]) input:checkbox'); "
                             + "  \r\n     if(checkbox.is(':checked')) {"
                             + "\r\n return selectNestedListCheckbox.prop('checked', true);    }"
                             + "  \r\n     selectNestedListCheckbox.prop('checked', false);  \r\n });";


                string sHTML    = "<div class=\"acidjs-css3-treeview\"><ul>";
                int    iCounter = 0;
                // iterate through the nodes
                XmlNode eleOuter = Nodes.DocumentElement;
                XmlNode oNodes   = eleOuter.SelectNodes("xolddummy")[0];

                for (int y = 0; y < oNodes.ChildNodes.Count; y++)
                {
                    XmlNode oNode    = oNodes.ChildNodes[y];
                    string  sCaption = oNode["CAPTION"].InnerText;
                    string  sName    = oNode["NAME"].InnerText;
                    iCounter++;
                    string sRow = "<li><input type='checkbox' id='node-" + iCounter.ToString()
                                  + "' checked='' /><label><input type='checkbox' /><span></span></label><label for='node-" + iCounter.ToString() + "'>" + sCaption + "</label>";
                    sHTML += sRow;

                    for (int iSubNodeCounter = 0; iSubNodeCounter < 10; iSubNodeCounter++)
                    {
                        // If Any child nodes, process here
                        XmlNode oSubNodes = oNode.SelectNodes("SUBNODES")[0];
                        sHTML += "<ul>";
                        for (int j = 0; j < oSubNodes.ChildNodes.Count; j++)
                        {
                            XmlNode oNode2    = oSubNodes.ChildNodes[j];
                            string  sCaption2 = oNode2["CAPTION"].InnerText;
                            string  sName2    = oNode2["NAME"].InnerText;
                            iCounter++;
                            string sRow2 = "<li><input type='checkbox' id='node-" + iCounter.ToString()
                                           + "' checked='' /><label><input type='checkbox' /><span></span></label><label for='node-" + iCounter.ToString() + "'>" + sCaption2 + "</label>";
                            sHTML += sRow2;
                        }
                        sHTML += "</li>";
                        sHTML += "</ul>";
                    }
                    sHTML += "</li>";
                }

                sHTML += "</ul>";
                sHTML += "</div>";

                return(new WebReply(sHTML, sJS, Section, false));
            }
            else if (Type == GEType.SortableList)
            {
                string Name2 = Name + "2";
                string ul1   = "<ul id='" + Name + "'>";
                foreach (SystemObject.LookupValue lv in LookupValues)
                {
                    //Select the Selected TextBoxValue
                    string key = lv.ID;
                    key = lv.Value;
                    string sRow = "<li class='sortable' usgdname='" + lv.Name + "' usgdcaption='" + lv.Caption + "' usgdid='" + lv.ID + "' usgdvalue='" + lv.Value + "' id='" + key + "' value='" + lv.Value + "'>" + lv.Caption + "</li>";
                    ul1 += sRow;
                }

                ul1 += "</ul>";

                string ul2 = "<ul id='" + Name2 + "'>";
                foreach (SystemObject.LookupValue lv in LookupValuesSelected)
                {
                    //Select the Selected TextBoxValue
                    string key = lv.ID;
                    key = lv.Value;
                    string sRow = "<li class='sortable' usgdname='" + lv.Name + "' usgdcaption='" + lv.Caption + "' usgdid='" + lv.ID + "' usgdvalue='" + lv.Value + "' id='" + key + "' value='" + lv.Value + "'>" + lv.Caption + "</li>";
                    ul2 += sRow;
                }

                ul2 += "</ul>";

                string html = "<td><div><table><tr><td>" + CaptionText + "</td><td>" + CaptionText2 + "</td></tr><tr><td width='"
                              + Width.ToString() + "'>" + ul1 + "</td><td width='" + Width.ToString() + "'>"
                              + ul2 + "</td></tr></table></div></td>";


                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();            // get call stack
                StackFrame[] stackFrames  = stackTrace.GetFrames();      // get method calls (frames)
                StackFrame   callingFrame = stackFrames[2];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = Name + "_Sort";

                string sJava2 = "  var sOut=''; $('#" + Name + "').closest('ul').find('li').each(function (index) "
                                + "        {         var sUSGDID = $(this)[0].getAttribute('usgdid'); "
                                + "                  var sUSGDValue = $(this)[0].getAttribute('usgdvalue'); "
                                + "                 var sUSGDCaption = $(this)[0].getAttribute('usgdcaption'); "
                                + "                 var sUSGDName = $(this)[0].getAttribute('usgdname'); "
                                + "        var s = $(this)[0].name + '[COL]' + $(this)[0].value + '[COL]' + sUSGDID + '[COL]' + sUSGDValue + '[COL]' + sUSGDCaption + '[COL]' + sUSGDName + '[ROW]';"
                                + "        sOut += s;    }); ";


                string sJava3 = "  var sOut2=''; $('#" + Name2 + "').closest('ul').find('li').each(function (index) "
                                + "        {         var sUSGDID = $(this)[0].getAttribute('usgdid'); "
                                + "                  var sUSGDValue = $(this)[0].getAttribute('usgdvalue'); "
                                + "                  var sUSGDCaption = $(this)[0].getAttribute('usgdcaption'); "
                                + "                  var sUSGDName = $(this)[0].getAttribute('usgdname'); "
                                + "        var s = $(this)[0].name + '[COL]' + $(this)[0].value + '[COL]' + sUSGDID + '[COL]' + sUSGDValue + '[COL]' + sUSGDCaption + '[COL]' + sUSGDName + '[ROW]';"
                                + "        sOut2 += s;    }); ";


                string serialize   = " " + sJava2 + sJava3 + " var order = $('#" + Name + "').sortable('toArray');  var order2=$('#" + Name2 + "').sortable('toArray'); var data = order.join(';'); var data2=order2.join(';'); ";
                string sUniqueId   = Section + "[ROWSET]" + Name + "[ROWSET]";
                string sEvent      = serialize + "postdiv(this,'sortevent','" + myClass + "','" + sMyMethod + "','[SORTABLE]" + sUniqueId + "' + sOut + '[ROWSET]'+sOut2);";
                string sIdentifier = "#" + Name + ",#" + Name2;

                string javascript = "   $('" + sIdentifier + "').sortable({     "
                                    + " stop: function(event, ui){      " + sEvent + "        },"
                                    + "connectWith: '" + sIdentifier + "'         });  $('" + sIdentifier + "').disableSelection();";


                return(new WebReply(html, javascript, Section, false));
            }
            else if (Type == GEType.UploadControl)
            {
                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();       // get call stack
                StackFrame[] stackFrames  = stackTrace.GetFrames(); // get method calls (frames)
                StackFrame   callingFrame = stackFrames[1];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = method.Name;
                sMyMethod = Method;

                string sEvent = "postdiv(this,'buttonevent','" + myClass + "','" + sMyMethod + "','');";
                //sEvent = "";

                string html = "<td colspan=2><form enctype='multipart/form-data' method='POST' action='Uploader.ashx'>"
                              + "<p id='DivUploadControl'></p>"
                              + "<input type='hidden' name='MAX_FILE_SIZE' value='3000000' />"
                              + "<label class='fileContainer roundbutton'>" + CaptionText
                              + "<input class='inputfile' type='file' "
                              + "id='myFile' name='myFile' multiple size=50 onchange=\"USGDFileUploader(this.form,'Uploader.ashx?parentid=" + ParentGuid + "&id=" + Id.ToString()
                              + "&parenttype=" + ParentType + "','divupload','" + myClass + "','" + sMyMethod + "','" + Section + "');" + "\" >"
                              + "</label>"
                              + "&nbsp;&nbsp;"
                              + "<div id=divupload></div>  </form></td>";
                return(new WebReply(html, "", Section, false));
            }
            else if (Type == GEType.TextArea)
            {
                string sReadOnly = ReadOnly ? "READONLY" : string.Empty;
                string sClass    = ReadOnly ? "reado" : string.Empty;
                string sColspan  = "";
                if (("" + ColSpan).Length > 0)
                {
                    sColspan = "colspan='" + ColSpan + "'";
                }
                string td1 = "";
                if (!MaskColumn1)
                {
                    td1 = "<td><span>" + CaptionText + "</span></td>";
                }
                string sOut = td1 + "<td " + TdWidth + " " + sColspan + "><textarea " + sReadOnly + " class='" + sClass + "' type='" + Type + "' name='"
                              + Name + "' rows='" + rows.ToString() + "' cols='" + cols.ToString() + "' id='"
                              + Name + "' style='width:" + Width + ";height:" + Height + ";' value='" + TextBoxValue + "'>" + TextBoxValue + "</textarea>&nbsp;<label class='"
                              + sFlyout + "' for='" + Name + "'>" + ErrorText + "</label></td>";
                return(new WebReply(sOut, "", Section, false));
            }
            else if (Type == GEType.Caption)
            {
                string sOut = "<td colspan=2><span id='" + Name + "'>" + TextBoxValue + "</span></td>";
                return(new WebReply(sOut, "", Section, false));
            }
            else if (Type == GEType.Button)
            {
                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();       // get call stack
                StackFrame[] stackFrames  = stackTrace.GetFrames(); // get method calls (frames)
                StackFrame   callingFrame = stackFrames[1];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = method.Name;
                sMyMethod = Method;
                string sJavascriptSuffix = IsInDialog ? "$(this).closest('.ui-dialog-content').dialog('close'); " : String.Empty;
                string sOut = "";

                if (!MaskBeginTD)
                {
                    sOut += "<td colspan='" + ColSpan + "'>";
                }

                sOut += "<input class=roundbutton type=button name='" + Name + "' id='" + Name + "' value='"
                        + CaptionText + "' onclick=\"" + sJavascriptSuffix + "postdiv(this,'buttonevent','" + myClass + "','" + sMyMethod + "','');\"  />";
                if (!MaskEndTD)
                {
                    sOut += "</td>";
                }

                return(new WebReply(sOut, "", Section, false));
            }
            else if (Type == GEType.DoubleButton)
            {
                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();
                StackFrame[] stackFrames  = stackTrace.GetFrames();
                StackFrame   callingFrame = stackFrames[1];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = method.Name;
                sMyMethod = Method;
                string sJavascriptSuffix = IsInDialog ? "$(this).closest('.ui-dialog-content').dialog('close'); " : String.Empty;
                string sOut = "";
                if (!MaskBeginTD)
                {
                    sOut += "<td colspan='" + ColSpan + "'>";
                }
                Method = "" + Name + "_Click";

                sOut += "<input class=roundbutton type=button name='" + Name + "' id='" + Name + "' value='"
                        + CaptionText + "' onclick=\"" + sJavascriptSuffix + "postdiv(this,'buttonevent','" + myClass + "','" + Method + "','');\"  />";
                // Button2:
                Method = "" + Name2 + "_Click";

                sOut += "&nbsp;&nbsp;&nbsp;&nbsp;<input class=roundbutton type=button name='" + Name2 + "' id='" + Name2 + "' value='"
                        + CaptionText2 + "' onclick=\"" + sJavascriptSuffix + "postdiv(this,'buttonevent','" + myClass + "','" + Method + "','');\"  />";
                if (!MaskEndTD)
                {
                    sOut += "</td>";
                }



                return(new WebReply(sOut, "", Section, false));
            }

            else if (Type == GEType.IFrame)
            {
                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();       // get call stack
                StackFrame[] stackFrames  = stackTrace.GetFrames(); // get method calls (frames)
                StackFrame   callingFrame = stackFrames[1];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = method.Name;
                sMyMethod = Method;
                string sJavascriptSuffix = IsInDialog ? "$(this).closest('.ui-dialog-content').dialog('close'); " : String.Empty;
                string sCSS = "background-color:grey";
                string sOut = "<td><iframe style='" + sCSS + "' src='" + URL + "' name='" + Name + "' id='" + Name + "' width='" + Width + "' height='" + Height + "'> </iframe></td>";
                return(new WebReply(sOut, "", Section, false));
            }
            else if (Type == GEType.CheckBox)
            {
                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();       // get call stack
                StackFrame[] stackFrames  = stackTrace.GetFrames(); // get method calls (frames)
                StackFrame   callingFrame = stackFrames[1];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = method.Name;
                sMyMethod = Method;
                string sJavascriptSuffix = IsInDialog ? "$(this).closest('.ui-dialog-content').dialog('close'); " : String.Empty;
                string sCHECKED          = TextBoxValue == "true" ? "CHECKED" : "";
                string sOut = "<td>" + CaptionText + "</td><td><input class=roundbutton type=checkbox " + sCHECKED + " value='" + TextBoxValue + "' name='" + Name + "' id='" + Name + "' value='"
                              + CaptionText + "' /></td>";
                return(new WebReply(sOut, "", Section, false));
            }

            else if (Type == GEType.Anchor)
            {
                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();       // get call stack
                StackFrame[] stackFrames  = stackTrace.GetFrames(); // get method calls (frames)
                StackFrame   callingFrame = stackFrames[1];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = method.Name;
                sMyMethod = Method;
                string sJavascriptSuffix = IsInDialog ? "$(this).closest('.ui-dialog-content').dialog('close'); " : String.Empty;
                string sOut = "<td colspan=1><a name='" + Name + "' id='" + Name + "' value='"
                              + "' href=# onclick=\"" + sJavascriptSuffix + "postdiv(this,'buttonevent','" + myClass + "','" + this.Name + "_Click','');return true;\" >" + CaptionText + "</a></td>";
                return(new WebReply(sOut, "", Section, false));
            }
            else if (Type == GEType.TableRow)
            {
                string sOut = "<tr>";
                return(new WebReply(sOut, "", Section, false));
            }
            else if (Type == GEType.Lookup)
            {
                string sReadOnly = ReadOnly ? "DISABLED" : string.Empty;
                string sClass    = ReadOnly ? "reado" : string.Empty;
                // Event
                string       myClass      = caller.GetType().ToString();
                StackTrace   stackTrace   = new StackTrace();                // get call stack
                StackFrame[] stackFrames  = stackTrace.GetFrames();          // get method calls (frames)
                StackFrame   callingFrame = stackFrames[1];
                MethodInfo   method       = (MethodInfo)callingFrame.GetMethod();
                string       sMyMethod    = method.Name;
                string       sEvent       = " onchange=postdiv(this,'lookupclick','" + myClass + "','" + Name + "_Selected',this.options[this.selectedIndex].value);";


                string sRows = "<td><span>" + CaptionText + "</span></td><td>" + "<select " + sReadOnly + " class='" + sClass + "' " + sEvent + " name='" + Name + "' id='" + Name + "'>";
                if (LookupValues != null)
                {
                    // Ensure we have a blank entry for empty or null values
                    string sBlankSelected = "";
                    if (TextBoxValue.Trim() == "")
                    {
                        sBlankSelected = "SELECTED";
                    }
                    sRows += "<option " + sBlankSelected + " classid='" + "000" + "' value='" + "" + "'>" + "" + "</option>";



                    foreach (SystemObject.LookupValue lv in LookupValues)
                    {
                        //Select the Selected TextBoxValue
                        string sSelected = String.Empty;
                        if (lv.Value == TextBoxValue)
                        {
                            sSelected = "SELECTED";
                        }
                        sRows += "<option " + sSelected + " USGDID='" + lv.ID + "' USGDVALUE='" + lv.Value + "' value='" + lv.Value + "'>" + lv.Caption + "</option>";
                    }
                }
                sRows += "</select></td>";
                return(new WebReply(sRows, "", Section, false));
            }
            else
            {
                string sErr = "";
            }
            return(new WebReply("", "", Section, false));
        }
Ejemplo n.º 18
0
 private void ButtonSend_Click(object sender, RoutedEventArgs e)
 {
     SendValue(TextBoxValue.Text);
     TextBoxValue.Clear();
 }