private void GenerateTable(int colsCount, int rowsCount, DateTime startDate) { dt1.Clear(); //Creat the Table and Add it to the Page //Page.Form.Controls.Add(table); //DateTime startDate = txtCouponDate.SelectedDate.Value; DateTime previousStartDate = startDate; string frequency = ddlAddCouponFrequency.SelectedValue.ToString(); Decimal firstNationalRow = Convert.ToDecimal(txtNotional.Text); Decimal nationalRow = Convert.ToDecimal(txtNotional.Text); // Now iterate through the table and add your controls for (int i = 0; i < rowsCount; i++) { DataRow dr = dt1.NewRow(); dr["ID"] = i.ToString(); for (int j = 0; j < colsCount; j++) { TableCell cell = new TableCell(); cell.CssClass = "tdBorder"; RadTextBox tb = new RadTextBox(); tb.Skin = "Web20"; // Set a unique ID for each TextBox added tb.ID = "TextBoxRow_" + i + "Col_" + j; if (i == 0 && j == 0) { tb.Text = startDate.ToShortDateString(); //tb.AutoPostBack = true; //tb.TextChanged += new EventHandler(this.tb_TextChanged); dr["StartDate"] = startDate.ToShortDateString(); } else if (i > 0 && j == 0) { switch (frequency.Trim()) { case "Monthly": previousStartDate = startDate; startDate = startDate.AddMonths(1).Date; tb.Text = startDate.ToShortDateString(); dr["StartDate"] = startDate.ToShortDateString(); break; case "Quarterly": previousStartDate = startDate; startDate = startDate.AddMonths(3).Date; tb.Text = startDate.ToShortDateString(); dr["StartDate"] = startDate.ToShortDateString(); break; case "Semi-Annual": previousStartDate = startDate; startDate = startDate.AddMonths(6).Date; tb.Text = startDate.ToShortDateString(); dr["StartDate"] = startDate.ToShortDateString(); break; case "Annual": previousStartDate = startDate; startDate = startDate.AddYears(1).Date; tb.Text = startDate.ToShortDateString(); dr["StartDate"] = startDate.ToShortDateString(); break; default: break; } } if (i == 0 && j == 1) { DateTime endDate; switch (frequency.Trim()) { case "Monthly": endDate = startDate.AddMonths(1).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; case "Quarterly": endDate = startDate.AddMonths(3).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; case "Semi-Annual": endDate = startDate.AddMonths(6).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; case "Annual": endDate = startDate.AddYears(1).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; default: break; } } else if (i > 0 && j == 1) { DateTime endDate; switch (frequency.Trim()) { case "Monthly": endDate = startDate.AddMonths(1).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; case "Quarterly": endDate = startDate.AddMonths(3).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; case "Semi-Annual": endDate = startDate.AddMonths(6).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; case "Annual": endDate = startDate.AddYears(1).Date; tb.Text = endDate.ToShortDateString(); dr["EndDate"] = endDate.ToShortDateString(); break; default: break; } } if (j == 2) { DateTime settlementDt = Convert.ToDateTime(txtBoxAddMaturityDate.SelectedDate); //where to take this value DateTime endDt = Convert.ToDateTime(dr["EndDate"]); decimal days = (endDt - settlementDt).Days; decimal totalDays = 365; decimal coupFreqDays = days / totalDays; if (days > 0) dr["CoupFrac"] = Convert.ToDecimal(coupFreqDays).ToString("0.00"); } if (j == 3) { tb.Text = txtNotional.Text; if (i == 0) { firstNationalRow = Convert.ToDecimal(txtNotional.Text); nationalRow = firstNationalRow; } else nationalRow = Convert.ToDecimal(tb.Text); dr["Notation"] = nationalRow; } if (j == 4) { DateTime dt = Convert.ToDateTime(dr["StartDate"]); if (txtCouponDate.SelectedDate != null && dt >= txtCouponDate.SelectedDate) { // int activeCoupons = Convert.ToInt16(txtActiveCoupon.Text); //where to take this value if (firstAmortizingRow == false) activeCoupons = rowsCount - i; Decimal amortisation = Convert.ToDecimal(firstNationalRow / activeCoupons); dr["Amortisation"] = Convert.ToDecimal(amortisation).ToString("0.00"); firstAmortizingRow = true; } else dr["Amortisation"] = "0.00"; } if (j == 5) { Decimal factorRow = Convert.ToDecimal(nationalRow / firstNationalRow); tb.Text = factorRow.ToString(); dr["Factor"] = factorRow; } // Add the control to the TableCell cell.Controls.Add(tb); // Add the TableCell to the TableRow } dt1.Rows.Add(dr); // Add the TableRow to the Table } pnlAmortizing.Visible = true; grdAmortizing.Visible = true; btnCalculatSchedule.Visible = true; grdAmortizing.DataSource = dt1; grdAmortizing.DataBind(); // grdAmortizing.Rebind(); }
private Panel CreatePanelSetPage() { txtCurrentPage = new RadTextBox() { ID = "txtCurrentPage", Width = Unit.Pixel(50), Text = _grid.YetAnotherPageIndex.ToString() }; txtCurrentPage.Style.Add("text-align", "center"); rangeValidator = new RangeValidator() { ID = "rangeValidator1", ControlToValidate = txtCurrentPage.ID, EnableClientScript = true, MinimumValue = "1", MaximumValue = _pageCount.ToString(), Display = ValidatorDisplay.Dynamic, Type = ValidationDataType.Integer }; rangeValidator.ErrorMessage = string.Format("Valore non compreso tra {0} - {1}", rangeValidator.MinimumValue, rangeValidator.MaximumValue); currentButton = new RadButton() { ID = "currentButton", Text = "Vai", CausesValidation = false, CommandName = "CustomChangePage" }; Panel panel = new Panel(); panel.Controls.Add(new LiteralControl("Pagina: ")); panel.Controls.Add(txtCurrentPage); panel.Controls.Add(new LiteralControl(string.Format(" di {0} ", _pageCount))); panel.Controls.Add(rangeValidator); panel.Controls.Add(currentButton); panel.DefaultButton = currentButton.ID; panel.Attributes.Add("class", "panelRangeValidator"); panel.Wrap = false; return panel; }
protected void BtnClosePCClick(object sender, EventArgs e) { DataTable dt = CreatePresentingPCTable(); foreach (GridDataItem item in RadGridPresenting.Items) { Label lblPresenting = (Label)item.FindControl("lblPresenting"); CheckBox chkPresenting = (CheckBox)item.FindControl("ChkPresenting"); RadTextBox txtPresenting = (RadTextBox)item.FindControl("txtPresenting"); if (chkPresenting.Checked == true) { DataRow DR = dt.NewRow(); DR["ID"] = lblPresenting.Text; DR["NAME"] = chkPresenting.Text; DR["chkValText"] = txtPresenting.Text; dt.Rows.Add(DR); } } Page thePage = (Page)this.Parent.Page; PlaceHolder ph = (PlaceHolder)thePage.FindControl("phForms"); Touch.Custom_Forms.KNHAdultIEvaluationForm.DtPresenting = dt; Touch.Custom_Forms.KNHAdultIEvaluationForm.AditionalComplaints = txtAdditionPresentingComplaints.Text; Touch.Custom_Forms.KNHAdultIEvaluationForm theFrm = (Touch.Custom_Forms.KNHAdultIEvaluationForm)ph.FindControl("ID" + Session["CurrentFormName"].ToString()); if (theFrm != null) { theFrm.BindPresentingComp(); } RadScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "closeradloading", "CloseModalASPX('IDKNHAdultIEvaluationForm_TheModal_rwPresentingComplaints');", true); }
// client side function for calender master form input public void ValidateCalender(GridItemEventArgs e) { GridEditableItem editForm = (GridEditableItem)e.Item; ImageButton update = (ImageButton)editForm.FindControl("UpdateButton"); ImageButton insert = (ImageButton)editForm.FindControl("PerformInsertButton"); RadTextBox txtcalcode = (editForm.FindControl("txtcalcode") as RadTextBox); RadTextBox txtcaldsc = (editForm.FindControl("txtcaldsc") as RadTextBox); RadComboBox ddlBasedOn = (editForm.FindControl("ddlBasedOn") as RadComboBox); RadComboBox ddlDaysRounding = (editForm.FindControl("ddlDaysRounding") as RadComboBox); RadNumericTextBox txtgrtsom = (editForm.FindControl("txtgrtsom") as RadNumericTextBox); RadNumericTextBox txtBxgrtamt = (editForm.FindControl("txtBxgrtamt") as RadNumericTextBox); if (update != null) { update.Attributes.Add("onclick", "return ValidateCalender('" + txtcalcode.ClientID + "','" + txtcaldsc.ClientID + "')"); } if (insert != null) { insert.Attributes.Add("onclick", "return ValidateCalender('" + txtcalcode.ClientID + "','" + txtcaldsc.ClientID + "')"); } }
protected void rgCC_InsertCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { try { GridEditableItem editedItem = e.Item as GridEditableItem; Hashtable newValues = new Hashtable(); e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); //Load controls RadTextBox txtEmail = (RadTextBox)editedItem.FindControl("txtEmail"); RadDropDownList ddlType = (RadDropDownList)editedItem.FindControl("ddlType"); //Insert query var strsql = "INSERT INTO [tbl_Email_CC_Master]([CC_Email_Id],Type_Id) VALUES ('" + txtEmail.Text + "', '" + ddlType.SelectedValue + "');"; int i = DBUtils.ExecuteSQLCommand(new SqlCommand(strsql)); if (i > 0) { rmw1.RadAlert("Email: " + txtEmail.Text + " Inserted Successfully", 400, 100, "Success", null); fnLoadData(true); } else { rmw1.RadAlert("Insertion Error", 400, 100, "Success", null); return; } } catch (Exception ex) { throw ex; } }
private void btnNewCmpgn_Click(object sender, EventArgs e) { try { fnShowCampaignList(false); iOfferID = 0; txtCampaignName.Text = ""; txtCampaignCode.Text = ""; txtRate.Text = ""; if (ddlOffer.SelectedItem != null && ddlSegment.SelectedItem != null && ddlChannel.SelectedItem != null) { RadTextBox radTextBox = txtCampaignCode; string[] str = new string[] { ddlSegment.SelectedItem.ToString(), "_", ddlOffer.SelectedItem.ToString(), "_", ddlChannel.SelectedItem.ToString() }; radTextBox.Text = string.Concat(str); } ddlSegment.SelectedIndex = 0; ddlOffer.SelectedIndex = 0; ddlChannel.SelectedIndex = 0; strEligibility = ""; chkIsActive.Checked = true; txtCampaigndesc.Text = ""; bndgcntrlchkDropDowntp1(chkSegmentDrpdn, null); } catch (Exception exception1) { Exception exception = exception1; RadMessageBox.Show(this, exception.Message, exception.TargetSite.Name.ToString(), MessageBoxButtons.OK, RadMessageIcon.Error, MessageBoxDefaultButton.Button1); } }
private void radText_equivale_KeyPress(object sender, KeyPressEventArgs e) { try { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && e.KeyChar != '.') { e.Handled = true; } if (e.KeyChar == '.' && (sender as RadTextBox).Text.IndexOf('.') > -1) { e.Handled = true; } if (!char.IsControl(e.KeyChar)) { RadTextBox textBox = (RadTextBox)sender; if (textBox.Text.IndexOf('.') > -1 && textBox.Text.Substring(textBox.Text.IndexOf('.')).Length >= 4) { e.Handled = true; } } } catch (Exception ex) { RadMessageBox.Show(ex.Message.ToString()); } }
private void cfb5cf413352ed4044535eb4a62d2e98f() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(Type.GetTypeFromHandle(ceab80e890f43dc7a3ce92d7476fc58cb.c6804baa30a51e813a45fabcfa2b27b79())); this.ca9057065c4b9f41cabb29661a6481eff = new RadTextBox(); ((ISupportInitialize)this.ca9057065c4b9f41cabb29661a6481eff).BeginInit(); ((ISupportInitialize)this).BeginInit(); ((RadFormControlBase)this).SuspendLayout(); ((Control)this.ca9057065c4b9f41cabb29661a6481eff).AutoSize = cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7732) != 0; ((Control)this.ca9057065c4b9f41cabb29661a6481eff).Dock = (DockStyle)cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7736); ((Control)this.ca9057065c4b9f41cabb29661a6481eff).Font = new Font(c833fbfa18d441f3acb05d803efdf1eb8.c702a9e4555297107d7c7901aa91e5540(7226), cb85779efa5f9c78fa841b92dceca9094.c8c83a3807da60b9f032d40f2b5665e27(7740), (FontStyle)cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7744), (GraphicsUnit)cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7748), (byte)cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7752)); ((Control)this.ca9057065c4b9f41cabb29661a6481eff).Location = new Point(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7756), cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7760)); ((RadTextBoxBase)this.ca9057065c4b9f41cabb29661a6481eff).set_Multiline(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7764) != 0); ((Control)this.ca9057065c4b9f41cabb29661a6481eff).Name = c833fbfa18d441f3acb05d803efdf1eb8.c702a9e4555297107d7c7901aa91e5540(7243); ((RadTextBoxBase)this.ca9057065c4b9f41cabb29661a6481eff).set_ReadOnly(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7768) != 0); ((RadTextBoxBase)this.ca9057065c4b9f41cabb29661a6481eff).set_ScrollBars((ScrollBars)cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7772)); ((Control)this.ca9057065c4b9f41cabb29661a6481eff).Size = new Size(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7776), cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7780)); ((Control)this.ca9057065c4b9f41cabb29661a6481eff).TabIndex = cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7784); ((RadTextBoxBase)this.ca9057065c4b9f41cabb29661a6481eff).set_TabStop(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7788) != 0); ((ContainerControl)this).AutoScaleDimensions = new SizeF(cb85779efa5f9c78fa841b92dceca9094.c8c83a3807da60b9f032d40f2b5665e27(7792), cb85779efa5f9c78fa841b92dceca9094.c8c83a3807da60b9f032d40f2b5665e27(7796)); ((RadFormControlBase)this).set_AutoScaleMode((AutoScaleMode)cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7800)); ((Form)this).ClientSize = new Size(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7804), cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7808)); ((Control)this).Controls.Add((Control)this.ca9057065c4b9f41cabb29661a6481eff); ((Form)this).Icon = cead0b4edd540ba7cac4363706aa68fb6.cc8e287d5350b43026d33bb80beb131a0(componentResourceManager.GetObject(c833fbfa18d441f3acb05d803efdf1eb8.c702a9e4555297107d7c7901aa91e5540(7256))); ((Control)this).Name = c833fbfa18d441f3acb05d803efdf1eb8.c702a9e4555297107d7c7901aa91e5540(7277); ((RadFormControlBase)this).get_RootElement().set_ApplyShapeToControl(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7812) != 0); ((Control)this).Text = c833fbfa18d441f3acb05d803efdf1eb8.c702a9e4555297107d7c7901aa91e5540(7302); ((RadFormControlBase)this).set_ThemeName(c833fbfa18d441f3acb05d803efdf1eb8.c702a9e4555297107d7c7901aa91e5540(7321)); ((Form)this).Load += new EventHandler(this.c9fb7f4ed78af7d1e411e1971964b9875); ((ISupportInitialize)this.ca9057065c4b9f41cabb29661a6481eff).EndInit(); ((ISupportInitialize)this).EndInit(); ((RadFormControlBase)this).ResumeLayout(cb85779efa5f9c78fa841b92dceca9094.c4f3ad310245f8f6e7d32122c50c48ab1(7816) != 0); }
protected void rgCC_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { try { GridEditableItem editedItem = e.Item as GridEditableItem; Hashtable newValues = new Hashtable(); e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); var CC_Id = editedItem.GetDataKeyValue("CC_Id").ToString(); //Load controls RadTextBox txtEmail = (RadTextBox)editedItem.FindControl("txtEmail"); RadDropDownList ddlType = (RadDropDownList)editedItem.FindControl("ddlType"); //Insert query var strsql = "UPDATE tbl_Email_CC_Master set CC_Email_Id = '" + txtEmail.Text + "', Type_Id = '" + ddlType.SelectedValue + "' where CC_Id = '" + CC_Id + "'"; int i = DBUtils.ExecuteSQLCommand(new SqlCommand(strsql)); if (i > 0) { rmw1.RadAlert("Email: " + txtEmail.Text + " Updated Successfully", 400, 100, "Success", null); } else { rmw1.RadAlert("Error.", 400, 100, "Success", null); return; } } catch (Exception ex) { throw ex; } }
protected void rgGrid_ItemDataBound(object sender, GridItemEventArgs e) { try { //Need to select drop downs after data binding if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) { //************First calling dropdown list values selected in pop up edit form**************/ UserControl userControl = e.Item.FindControl(GridEditFormItem.EditFormUserControlID) as UserControl; GridDataItem parentItem = (e.Item as GridEditFormItem).ParentItem; RadTextBox TaskTypeTXT = userControl.FindControl("txtCloseReason") as RadTextBox; RadButton activeFlag = userControl.FindControl("ActiveFlag") as RadButton; Label lastup = userControl.FindControl("lblLastUpdated") as Label; Label lastupby = userControl.FindControl("lblLastUpdatedBy") as Label; Label lastupon = userControl.FindControl("lblLastUpdatedOn") as Label; } } catch (Exception ex) { pnlDanger.Visible = true; lblDanger.Text = ex.Message.ToString(); } }
private WebControl CreateTextControl(CustomField field, int width) { RadTextBox result = new RadTextBox(); result.Width = Unit.Pixel(width - 3); if (_autoSave) { result.ClientEvents.OnBlur = "function(sender, args) { top.privateServices.SaveCustomFieldText(" + _refID.ToString() + "," + field.CustomFieldID.ToString() + ", sender.get_value()); }"; } if (_clientSaveEvent != "") { result.ClientEvents.OnBlur = _clientSaveEvent; } result.ID = FieldIDToControlID(field.CustomFieldID); _customControls.Add(new CustomControl(result, "$find('{0}').get_value()", "SaveCustomFieldText", _refID, field.CustomFieldID)); if (field.IsRequired) { result.CssClass = "validate(required)"; } if (!String.IsNullOrEmpty(field.Mask)) { result.CssClass += " masked"; result.Attributes.Add("placeholder", field.Mask); } return(result); }
private string ObtenerComentarios() { foreach (GridDataItem item in grdTableroControl.MasterTableView.Items) { int vIdEvaluado = int.Parse(item.GetDataKeyValue("ID_EVALUADO").ToString()); RadTextBox txtResultadoPorcentual = (RadTextBox)item.FindControl("txtComentarios"); string vComentario = txtResultadoPorcentual.Text; if (vComentario != "") { vLstComentariosEvaluados.Add(new E_COMENTARIOS_EVALUADOS { ID_EVALUADO = vIdEvaluado, DS_COMENTARIO = vComentario }); var vXelements = vLstComentariosEvaluados.Select(x => new XElement("COMENTARIO", new XAttribute("ID_EVALUADO", x.ID_EVALUADO), new XAttribute("DS_COMENTARIO", x.DS_COMENTARIO))); vXmlComentarios = (new XElement("COMENTARIOS", vXelements)); } } if (vXmlComentarios == null) { vXmlComentarios = (new XElement("COMENTARIOS")); } return(vXmlComentarios.ToString()); }
protected void ValidateTextBoxes(object sender, ServerValidateEventArgs args) { string strRegex = "^[a-zA-Z]+$"; Regex regex = new Regex(strRegex); StringBuilder invalidTextBoxes = new StringBuilder(); for (int i = 1; i <= 6; i++) { string id = "PlayerName" + i; RadTextBox textbox = (RadTextBox)FindControl(id); if (textbox != null) { if (!regex.IsMatch(textbox.Text) && textbox.Text != "") { invalidTextBoxes.AppendLine(id); } } } if (invalidTextBoxes.Length != 0) { ValidationResult.Text = String.Format("INVALID: {0}", invalidTextBoxes.ToString()); ValidationResult.Style["Color"] = "red"; } else { ValidationResult.Text = "VALID"; ValidationResult.Style["Color"] = "green"; } }
private void ddlSegment_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) { try { if (bIsCampaignLoaded) { RadTextBox radTextBox = txtCampaignCode; string[] str = new string[] { ddlSegment.SelectedItem.ToString(), "_", ddlOffer.SelectedItem.ToString(), "_", ddOpt.SelectedItem.ToString(), "_", ddlAction.SelectedItem.ToString(), "_", ddlChannel.SelectedItem.ToString() }; radTextBox.Text = string.Concat(str); txtSegmentType.Text = dtOpportunity.Rows[ddlSegment.SelectedIndex]["OPP_ACTION"].ToString(); if (txtSegmentType.Text != "STIMULATION") { chkSegmentDrpdn.Visible = false; } else { chkSegmentDrpdn.Visible = true; } } } catch (Exception exception1) { Exception exception = exception1; RadMessageBox.Show(this, exception.Message, exception.TargetSite.Name.ToString(), MessageBoxButtons.OK, RadMessageIcon.Error, MessageBoxDefaultButton.Button1); } }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmChangeLog)); this.txtLog = new RadTextBox(); this.txtLog.BeginInit(); this.BeginInit(); this.SuspendLayout(); this.txtLog.AutoSize = false; this.txtLog.Dock = DockStyle.Fill; this.txtLog.Font = new Font("Consolas", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte)0); this.txtLog.Location = new Point(0, 0); this.txtLog.Multiline = true; this.txtLog.Name = "txtLog"; this.txtLog.ReadOnly = true; this.txtLog.ScrollBars = ScrollBars.Vertical; this.txtLog.Size = new Size(736, 504); this.txtLog.TabIndex = 0; this.txtLog.TabStop = false; this.AutoScaleDimensions = new SizeF(6f, 13f); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new Size(736, 504); this.Controls.Add((Control)this.txtLog); this.Icon = (Icon)componentResourceManager.GetObject("$this.Icon"); this.Name = nameof(frmChangeLog); this.RootElement.ApplyShapeToControl = true; this.Text = "Changelog"; this.ThemeName = "VisualStudio2012Dark"; this.Load += new EventHandler(this.frmChangeLog_Load); this.txtLog.EndInit(); this.EndInit(); this.ResumeLayout(false); }
protected void rgCustomsType_ItemDataBound(object sender, GridItemEventArgs e) { try { var msg = ""; //Need to select drop downs after data binding if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) { //************First calling dropdown list values selected in pop up edit form**************/ UserControl userControl = e.Item.FindControl(GridEditFormItem.EditFormUserControlID) as UserControl; GridDataItem parentItem = (e.Item as GridEditFormItem).ParentItem; RadTextBox CustomsTypeTXT = userControl.FindControl("txtCustomsType") as RadTextBox; Label lastup = userControl.FindControl("lblLastUpdated") as Label; Label lastupby = userControl.FindControl("lblLastUpdatedBy") as Label; Label lastupon = userControl.FindControl("lblLastUpdatedOn") as Label; if (lastupby.Text == "") { lastup.Visible = false; lastupon.Visible = false; } } } catch (Exception ex) { pnlDanger.Visible = true; lblDanger.Text = ex.Message.ToString(); } }
// client side validation function for overtime master input form public void ValidateOvertime(GridItemEventArgs e) { GridEditableItem editForm = (GridEditableItem)e.Item; ImageButton update = (ImageButton)editForm.FindControl("UpdateButton"); ImageButton insert = (ImageButton)editForm.FindControl("PerformInsertButton"); RadTextBox txtovtcod = (editForm.FindControl("txtovtcod") as RadTextBox); RadTextBox txtovtdsc = (editForm.FindControl("txtovtdsc") as RadTextBox); RadComboBox ddlBasedOn = (editForm.FindControl("ddlBasedOn") as RadComboBox); RadComboBox ddlDataEntryStyle = (editForm.FindControl("ddlDataEntryStyle") as RadComboBox); if (update != null) { update.Attributes.Add("onclick", "return ValidateOvertime('" + txtovtcod.ClientID + "','" + txtovtdsc.ClientID + "','" + ddlBasedOn.ClientID + "','" + ddlDataEntryStyle.ClientID + "')"); } if (insert != null) { insert.Attributes.Add("onclick", "return ValidateOvertime('" + txtovtcod.ClientID + "','" + txtovtdsc.ClientID + "','" + ddlBasedOn.ClientID + "','" + ddlDataEntryStyle.ClientID + "')"); } }
protected void rgProduct_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { GridEditableItem item = (GridEditableItem)e.Item; RadTextBox code = (RadTextBox)item.FindControl("hdrcodetxt"); RadTextBox catnames = (RadTextBox)item.FindControl("catname"); RadNumericTextBox amount = (RadNumericTextBox)item.FindControl("amt"); string id = code.Text; string catname = catnames.Text; int amounts = Convert.ToInt32(amount.Text); if (string.IsNullOrEmpty(catname)) { ShowMessage("Category Name Cannot be empty"); return; } /*var validateprodcode = validatetransaction(prodcode); * if (validateprodcode.Rows.Count > 0) * { * ShowMessage("already used in transaction"); * return; * }*/ if (amounts == 0) { ShowMessage("Please fill amount"); return; } update(catname, amounts, id); }
protected void RadTextBox1_TextChanged(object sender, EventArgs e) { RadTextBox rtb = (RadTextBox)sender; PackingDAO dao = new PackingDAO(); try { // Clone the necessary database objects and get the ID of the new created consignment dao.RelabelParcel(rtb.Text.ToUpper(), User.Identity.Name, Shared.UserHostName); lblMsg.Text = "Parcel Re-labelled"; lblMsg.Visible = true; lblMsg.ForeColor = Color.Blue; } catch (Exception ex) { lblMsg.Text = FormatErrorMessage(ex.Message); lblMsg.Visible = true; lblMsg.ForeColor = Color.Red; } rtb.Text = ""; }
protected void rgSupplierCP_UpdateCommand(object sender, GridCommandEventArgs e) { GridEditableItem item = (GridEditableItem)e.Item; RadComboBox cmbSupphdr = (RadComboBox)item.FindControl("RadCmbSuppHdr"); RadTextBox code = (RadTextBox)item.FindControl("hdrcodetxt"); RadTextBox name = (RadTextBox)item.FindControl("suppname"); RadMaskedTextBox phone1 = (RadMaskedTextBox)item.FindControl("phone1"); RadMaskedTextBox phone2 = (RadMaskedTextBox)item.FindControl("phone2"); RadTextBox address = (RadTextBox)item.FindControl("address"); string codetxt = cmbSupphdr.SelectedValue; string cpcode = code.Text; string names = name.Text; string phone1s = phone1.Text; string phone2s = phone2.Text; string addresses = address.Text; if (names == "") { ShowMessage("Contact Person Name Cannot be empty"); return; } if (codetxt == "") { ShowMessage("Please Select Supplier Data"); return; } update(names, addresses, codetxt, phone1s, phone2s, cpcode); //var cmbSupphdr = ((RadComboBox)rgSupplierCP.MasterTableView.Items[e.Item.ItemIndex]["SUPP_CODE"].FindControl("RadCmbSuppHdr")); }
protected void rgCustomer_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { GridEditableItem item = (GridEditableItem)e.Item; RadTextBox code = (RadTextBox)item.FindControl("hdrcodetxt"); RadTextBox name = (RadTextBox)item.FindControl("name"); RadMaskedTextBox phone = (RadMaskedTextBox)item.FindControl("phone"); RadTextBox address = (RadTextBox)item.FindControl("address"); RadTextBox email = (RadTextBox)item.FindControl("email"); string cpcode = code.Text; string names = name.Text; string phones = phone.Text; string addresses = address.Text; string emails = email.Text; if (names == "") { ShowMessage("Contact Person Name Cannot be empty"); return; } update(names, addresses, phones, emails, cpcode); //update(names, addresses, codetxt, phone1s, phone2s, cpcode); }
public void InstantiateIn(Control container) { RadTextBox textBox = new RadTextBox(); container.Controls.Add(textBox); textBox.ID = ControlId; }
// client side validation function for paycodes form input controls public void ValidatePayCodes(GridItemEventArgs e) { GridEditableItem editForm = (GridEditableItem)e.Item; ImageButton update = (ImageButton)editForm.FindControl("UpdateButton"); ImageButton insert = (ImageButton)editForm.FindControl("PerformInsertButton"); RadComboBox ddlPayCode = (editForm.FindControl("ddlPayCode") as RadComboBox); RadTextBox txtDescription = (editForm.FindControl("txtDescription") as RadTextBox); RadComboBox ddlPayCodeType = (editForm.FindControl("ddlPayCodeType") as RadComboBox); RadComboBox ddlPayPeriod = (editForm.FindControl("ddlPayPeriod") as RadComboBox); if (update != null) { update.Attributes.Add("onclick", "return ValidatePayCode('" + ddlPayCode.ClientID + "','" + txtDescription.ClientID + "','" + ddlPayCodeType.ClientID + "','" + ddlPayPeriod.ClientID + "')"); } if (insert != null) { insert.Attributes.Add("onclick", "return ValidatePayCode('" + ddlPayCode.ClientID + "','" + txtDescription.ClientID + "','" + ddlPayCodeType.ClientID + "','" + ddlPayPeriod.ClientID + "')"); } }
private RadPageViewPage BuildRadPageViewPage(string operationType) { var page = new RadPageViewPage(); page.Text = operationType.ToString(); switch (operationType) { case "Pipette": RadTextBox textBox = new RadTextBox(); textBox.Text = "Pipette text box"; page.Controls.Add(textBox); break; case "Incubation": RadTextBox textBox1 = new RadTextBox(); textBox1.Text = "Incubation text box"; page.Controls.Add(textBox1); break; case "Centrifugation": RadTextBox textBox2 = new RadTextBox(); textBox2.Text = "Centrifugation text box"; page.Controls.Add(textBox2); break; case "Magnetic Separation": RadTextBox textBox3 = new RadTextBox(); textBox3.Text = "Magnetic Separation text box"; page.Controls.Add(textBox3); break; } return(page); }
protected void rgTypeMaster_InsertCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { try { GridEditableItem editedItem = e.Item as GridEditableItem; Hashtable newValues = new Hashtable(); e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); //Load controls RadTextBox txtTypeName = (RadTextBox)editedItem.FindControl("txtTypeName"); //Insert query var strsql = "INSERT INTO tbl_Type_Master(Type_Name) VALUES ('" + txtTypeName.Text + "');"; int i = DBUtils.ExecuteSQLCommand(new SqlCommand(strsql)); if (i > 0) { rmw1.RadAlert("Now add To and CC Email id For Type Name " + txtTypeName.Text, 400, 100, "Success", null); rmw1.RadAlert("Type Name: " + txtTypeName.Text + " Inserted Successfully", 400, 100, "Success", null); LoadData(true); } else { rmw1.RadAlert("Error occured during insertion", 400, 100, "Success", null); return; } } catch (Exception ex) { throw ex; } }
protected void rgTypeMaster_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { try { GridEditableItem editedItem = e.Item as GridEditableItem; Hashtable newValues = new Hashtable(); e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); var Type_Id = editedItem.GetDataKeyValue("Type_Id").ToString(); //Load controls RadTextBox txtTypeName = (RadTextBox)editedItem.FindControl("txtTypeName"); //Insert query var strsql = "UPDATE tbl_Type_Master set [Type_Name] = '" + txtTypeName.Text + "' where [Type_Id] = '" + Type_Id + "'"; int i = DBUtils.ExecuteSQLCommand(new SqlCommand(strsql)); if (i > 0) { rmw1.RadAlert("Type Name: " + txtTypeName.Text + " Updated Successfully", 400, 100, "Success", null); } else { rmw1.RadAlert("Error occured during Update", 400, 100, "Success", null); } } catch (Exception ex) { throw ex; } }
private void InitializePrinter() { try { SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.MacAddress); CnasRemotCall remoteCall = new CnasRemotCall(); string testSql = remoteCall.RemotInterface.CheckSelectData("HCS-config-data-sec002", condition); DataTable data = remoteCall.RemotInterface.SelectData("HCS-config-data-sec002", condition); if (data != null) { foreach (DataRow row in data.Rows) { string printType = Convert.ToString(row["print_type"]); string printName = Convert.ToString(row["print_name"]); string computerName = Convert.ToString(row["computer_name"]); string id = Convert.ToString(row["id"]); string controlName = string.Format("printTxt_{0}", printType); RadTextBox configControl = CnasUtilityTools.FindControl <RadTextBox>(this, controlName); if (configControl != null) { configControl.Text = printName; configControl.Tag = id; } } } } catch (Exception) { } }
private void InitializeSettings() { SortedList condition = new SortedList(); condition.Add(1, CnasBaseData.SystemID); condition.Add(2, "HCS-system-settings"); CnasRemotCall remoteCall = new CnasRemotCall(); string testSql = remoteCall.RemotInterface.CheckSelectData("HCS-config-data-sec001", condition); DataTable data = remoteCall.RemotInterface.SelectData("HCS-config-data-sec001", condition); if (data != null) { foreach (DataRow config in data.Rows) { string keyCode = Convert.ToString(config["key_code"]); string valueCode = Convert.ToString(config["value_code"]); string otherCode = Convert.ToString(config["other_code"]); _saveList.Add(keyCode); Control configControl = CnasUtilityTools.FindControl <Control>(this, keyCode); if (configControl != null) { if (configControl is RadTextBox) { RadTextBox control = configControl as RadTextBox; control.Text = valueCode; } else if (configControl is CheckBox) { CheckBox control = configControl as CheckBox; control.Checked = valueCode == "1"; } } } } }
private SortedList SaveConfigList() { SortedList updateList = new SortedList(); foreach (string config in _saveList) { Control configControl = CnasUtilityTools.FindControl <Control>(this, config); if (configControl != null) { SortedList updateData = new SortedList(); if (configControl is RadTextBox) { RadTextBox control = configControl as RadTextBox; updateData.Add(1, control.Text); } else if (configControl is CheckBox) { CheckBox control = configControl as CheckBox; updateData.Add(1, control.Checked ? "1" : "0"); } if (!updateData.ContainsKey(1)) { updateData.Add(1, "0"); } updateData.Add(2, config); updateList.Add(updateList.Count + 1, updateData); } } return(updateList); }
public Frm_HelpReservation(RadTextBox T_Num, RadTextBox T_An) { this.T_Num = T_Num; this.T_An = T_An; InitializeComponent(); }
protected void rgTransInProd_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { GridEditableItem item = (GridEditableItem)e.Item; RadComboBox cmbprodhdr = (RadComboBox)item.FindControl("RadCmbProdHdr"); RadComboBox cmbtranshdr = (RadComboBox)item.FindControl("RadCmbTransHdr"); RadTextBox code = (RadTextBox)item.FindControl("hdrcodetxt"); RadNumericTextBox amt = (RadNumericTextBox)item.FindControl("amount"); string transcode = cmbtranshdr.SelectedValue; string prodcode = cmbprodhdr.SelectedValue; int amount = Convert.ToInt32(amt.Text); string codes = code.Text; if (transcode == "") { ShowMessage("Transaction Information Cannot be empty"); return; } if (prodcode == "") { ShowMessage("Product Information Cannot be empty"); return; } if (amount == 0) { ShowMessage("Product Amount Cannot be empty"); return; } update(prodcode, transcode, amount, codes); }
public DialogBuilder AddTextBox(string caption, string text) { var tb = new RadTextBox(); tb.ThemeName = ThemeResolutionService.ApplicationThemeName; tb.Text = text; tb.Name = text; tb.Dock = DockStyle.Fill; _controls.Add(caption, tb); return this; }
// public static void BankTypeChange(string BankType, ref Label lblMessage, ref RadTextBox txtBankCode, ref RadTextBox txtBankName, ref RadTextBox txtBankAddr, ref RadTextBox txtBankCity, ref RadTextBox txtBankCountry) { lblMessage.Text = ""; txtBankCode.Enabled = BankType.Equals("A"); txtBankCode.Text = ""; txtBankName.Enabled = !BankType.Equals("A"); txtBankName.Text = ""; txtBankAddr.Enabled = !BankType.Equals("A"); txtBankAddr.Text = ""; txtBankCity.Enabled = !BankType.Equals("A"); txtBankCity.Text = ""; txtBankCountry.Enabled = !BankType.Equals("A"); txtBankCountry.Text = ""; }
public static string Show(string text, string caption) { RadForm prompt = new RadForm(); prompt.Width = 500; prompt.Height = 150; prompt.FormBorderStyle = FormBorderStyle.FixedDialog; prompt.Text = caption; prompt.StartPosition = FormStartPosition.CenterScreen; prompt.Anchor = AnchorStyles.Right; prompt.ShowIcon = false; RadLabel textLabel = new RadLabel() { Left = 50, Top = 20, Text = text, AutoSize = true }; RadTextBox textBox = new RadTextBox() { Left = 50, Top = 50, Width = 400 }; RadButton confirmation = new RadButton() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK }; confirmation.Click += (sender, e) => { prompt.Close(); }; prompt.Controls.Add(textBox); prompt.Controls.Add(confirmation); prompt.Controls.Add(textLabel); prompt.AcceptButton = confirmation; return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : ""; }
private bool HasPasswordRequirements(RadTextBox txtBox, bool hasConfirm, RadTextBox txtBoxConfirm = null) { if (hdnPasswordConfReq.Value == "Yes") return true; int countAlphaNum = 0; for (int i = 0; i < txtBox.Text.Length; i++) { if (!char.IsLetterOrDigit(txtBox.Text, i)) countAlphaNum++; } if ((txtBox.Text.Length < Membership.MinRequiredPasswordLength) || (countAlphaNum < Membership.MinRequiredNonAlphanumericCharacters)) { return false; } else { if (hasConfirm) { if (txtBoxConfirm.Text != txtBox.Text) { return false; } } return true; } }
private void setDocsCodeData(BEXPORT_DOCUMENTPROCESSING dsDetail, int stt, ref RadComboBox cboDocsCode, ref RadNumericTextBox txtNumOfOriginals, ref RadNumericTextBox txtNumofCopies, ref RadTextBox txtOtherDocs) { cboDocsCode.SelectedValue = dsDetail.DocsCode1; if (stt == 1) { if (dsDetail.NoOfOriginals1 != null) { txtNumOfOriginals.Value = Convert.ToDouble(dsDetail.NoOfOriginals1); } if (dsDetail.OtherDocs1 != null) { txtOtherDocs.Text = dsDetail.OtherDocs1; } } else if (stt == 2) { if (dsDetail.NoOfOriginals2 != null) { txtNumOfOriginals.Value = Convert.ToDouble(dsDetail.NoOfOriginals2); } if (dsDetail.OtherDocs2 != null) { txtOtherDocs.Text = dsDetail.OtherDocs2; } } else if (stt == 3) { if (dsDetail.NoOfOriginals3 != null) { txtNumOfOriginals.Value = Convert.ToDouble(dsDetail.NoOfOriginals3); } if (dsDetail.OtherDocs3 != null) { txtOtherDocs.Text = dsDetail.OtherDocs3; } } switch (stt) { case 1: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumofCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 2: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumofCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 3: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumofCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; } }
private static RadTextBox CreateTextBox(Criterion criterion, string adjustedID) { var textBox = new RadTextBox { ID = "RadTextBoxCriteria" + adjustedID, AutoPostBack = false, Skin = "Vista" }; textBox.ClientEvents.OnBlur = "onInputBlur"; textBox.Attributes["updateMessageHeader"] = adjustedID; textBox.Text = criterion.Object == null ? string.Empty : criterion.Object.ToString(); return textBox; }
public static void Login(RadTextBox email, RadTextBox password, Page page) { try { if (email.Text != "" & password.Text != "") { string Username = email.Text.Trim().ToLower(); if (Username.Length < 60) { string Password = Functions.MD5(password.Text.Trim()); string sqlStr1 = "Select t.* from t_user t " + " Where t.email = '" + Username + "' and t.password = '******' and t.archive = 'N' "; DataTable DT = Database.ExecuteQuery(sqlStr1); if (DT.Rows.Count > 0) { Database.UserID = DT.Rows[0]["ID"].ToString(); RadAjaxManager manager = RadAjaxManager.GetCurrent(page); manager.ResponseScripts.Add(Functions.BootstrapMessageBoxScriptBuilder("success", "Тавтай морилно уу.", "Home.aspx")); } else { Database.UserID = null; page.Session.Clear(); email.Text = ""; password.Text = ""; RadAjaxManager manager = RadAjaxManager.GetCurrent(page); manager.ResponseScripts.Add(Functions.BootstrapMessageBoxScriptBuilder("alert", "Хэрэглэгчийн имэйл, нууц үг буруу байна", "")); } } } } catch (Exception ex) { RadAjaxManager manager = RadAjaxManager.GetCurrent(page); manager.ResponseScripts.Add(Functions.BootstrapMessageBoxScriptBuilder("alert", "Хэрэглэгчийн имэйл, нууц үг буруу байна", "")); email.Text = ""; password.Text = ""; } finally { } }
public static void SetTextForTextBox(RadTextBox textBox, RadGridView gridView, string cellId) { try { textBox.Text = gridView.SelectedRows[0].Cells[cellId].Value.ToString(); } catch (NullReferenceException e) { Debug.WriteLine(e.Message); } }
private void loadCharge(BEXPORT_LC_DOCS_PROCESSING_CHARGES ExLCCharge, ref RadTextBox txtChargeCode, ref RadComboBox cbChargeCcy, ref RadComboBox cbChargeAcc, ref RadNumericTextBox txtChargeAmt, ref RadComboBox cbChargeParty, ref RadComboBox cbChargeAmort, ref RadComboBox cbChargeStatus, ref Label lblTaxCode, ref Label lblTaxAmt) { txtChargeCode.Text = ExLCCharge.ChargeCode; cbChargeCcy.SelectedValue = ExLCCharge.ChargeCcy; cbChargeAcc.SelectedValue = ExLCCharge.ChargeAcc; txtChargeAmt.Value = ExLCCharge.ChargeAmt; cbChargeParty.SelectedValue = ExLCCharge.PartyCharged; cbChargeAmort.SelectedValue = ExLCCharge.AmortCharge; cbChargeStatus.SelectedValue = ExLCCharge.ChargeStatus; lblTaxCode.Text = ExLCCharge.TaxCode; if (ExLCCharge.TaxAmt.HasValue) lblTaxAmt.Text = ExLCCharge.TaxAmt.ToString(); }
private void ComputeCouponDatesAndFractionsOld(RadDatePicker txtBoxTradeDate, RadComboBox txtBoxLoanName, RadDatePicker txtBoxSettlementDate, RadDatePicker txtBoxMaturityDate, RadTextBox txtBoxCouponFrequency, RadTextBox txtNonDiscountedAverageLife, RadGrid grdCalculatedDates, int type, RadTextBox txtNotional, RadTextBox txtMargin, RadTextBox txtCurrency) { try { int countryID = getCountryForLoan(txtBoxLoanName); PublicHolidayBLL bll = new PublicHolidayBLL(); List<tblHoliday> publicHolidays = bll.GetPublicHolidays(countryID); List<CalculatedDates> calculatedList = new List<CalculatedDates>(); DateTime cpnDT; cpnDT = AddBusinessDays(DateTime.Now, 10); LoanScheduleBL loanScheduleBL = new LoanScheduleBL(); DataTable dtSchedule = loanScheduleBL.GenerateTable(15, 10, cpnDT, txtBoxCouponFrequency.Text, txtNotional.Text, txtBoxMaturityDate.SelectedDate.Value, cpnDT, Convert.ToDecimal(txtMargin.Text), Convert.ToString(txtCurrency.Text), Convert.ToDateTime(txtBoxTradeDate.SelectedDate.Value), txtBoxSettlementDate.SelectedDate.Value); DateTime currentCouponDate; DateTime previousCouponDate; DateTime maturityDate; DateTime tradeDate; DateTime tradeDate1 = DateTime.Now.Date; if (txtBoxTradeDate.SelectedDate != null) { tradeDate1 = txtBoxTradeDate.SelectedDate.Value; } //DateTime settlementDate = DateTime.Now.Date; //if (txtBoxSettlementDate.SelectedDate != null) //{ // settlementDate = AddBusinessDays(txtBoxSettlementDate.SelectedDate.Value, 10); //} DateTime boxMaturityDate = DateTime.Now.Date; DateTime.TryParse(txtBoxSettlementDate.SelectedDate.Value.ToShortDateString(), out currentCouponDate); DateTime.TryParse(txtBoxSettlementDate.SelectedDate.Value.ToShortDateString(), out previousCouponDate); if (txtBoxMaturityDate.SelectedDate != null) { boxMaturityDate = txtBoxMaturityDate.SelectedDate.Value; } DateTime.TryParse(boxMaturityDate.ToShortDateString(), out maturityDate); DateTime.TryParse(tradeDate1.ToShortDateString(), out tradeDate); if (DateTime.TryParse(txtBoxSettlementDate.SelectedDate.Value.ToShortDateString(), out currentCouponDate)) { int cF = 0; System.Numeric.Frequency f = new System.Numeric.Frequency(); while (CurrentCouponDateLessThanMaturityDate(currentCouponDate, maturityDate)) { if (txtBoxCouponFrequency.Text == "Annual") { cF = 1; f = System.Numeric.Frequency.Annual; } if (txtBoxCouponFrequency.Text == "Semi-Annual") { cF = 2; f = System.Numeric.Frequency.SemiAnnual; } if (txtBoxCouponFrequency.Text == "Quarterly") { cF = 4; f = System.Numeric.Frequency.Quarterly; } if (txtBoxCouponFrequency.Text == "Monthly") { cF = 12; } int numberOfDaysPassed = 0; // if a weekend date or holiday move forward //while (IsSaturdaySundayDay(currentCouponDate) || IsPublicHoliday(publicHolidays, currentCouponDate)) //{ // currentCouponDate = currentCouponDate.AddDays(1); // numberOfDaysPassed = numberOfDaysPassed + 1; //} // Compute next coupon date using CoupNCD and correct for weekends CalculatedDates cal = new CalculatedDates(); System.Numeric.DayCountBasis d = System.Numeric.DayCountBasis.Actual365; previousCouponDate = currentCouponDate; currentCouponDate = System.Numeric.Financial.CoupNCD(currentCouponDate, maturityDate, f, d); DateTime previousBusinessDay = PreviousBusinessDay(currentCouponDate); cal.CalculatedDate = previousBusinessDay; //numberOfDaysPassed = currentCouponDate.Subtract(tradeDate).Days; // removed 31-03- 2014 asked by avr numberOfDaysPassed = currentCouponDate.Subtract(txtBoxSettlementDate.SelectedDate.Value).Days; //cal.Fraction = String.Format("{0:00.000}", numberOfDaysPassed / 365.25); cal.Fraction = String.Format("{0:00.00}", numberOfDaysPassed / 365.25); cal.ActualFraction = numberOfDaysPassed / 365.25; calculatedList.Add(cal); } if (calculatedList != null && calculatedList.Count > 0) { // When the cashflow is computed take the average of the fractions and set that to the non discounted average life text box. // txtNonDiscountedAverageLife.Text =Convert.ToDecimal( calculatedList.Last().ActualFraction).ToString("0.00"); } grdCalculatedDates.Visible = true; grdCalculatedDates.DataSource = calculatedList; grdCalculatedDates.DataBind(); switch (type) { case 1: tempCalculatedList1 = calculatedList; break; case 2: tempCalculatedList2 = calculatedList; break; case 3: tempCalculatedList3 = calculatedList; break; default: break; } } // tempLegend = txtBoxLoanName; } catch (Exception) { } }
private void showHideBank(bool isEnable, ref RadTextBox txtBankNo, ref RadTextBox txtBankName, ref RadTextBox txtBankAddr1, ref RadTextBox txtBankAddr2, ref RadTextBox txtBankAddr3) { txtBankNo.Enabled = !isEnable; txtBankName.Enabled = isEnable; txtBankAddr1.Enabled = isEnable; txtBankAddr2.Enabled = isEnable; txtBankAddr3.Enabled = isEnable; }
protected void grdAmortizing_ItemDataBound(object sender, GridItemEventArgs e) { //DataTable dt = (DataTable)e.Item.DataItem; //RadTextBox txtbx = (RadTextBox)e.Item.FindControl("txtStartDate"); //txtbx.Text = ""; if (e.Item is GridDataItem) { GridDataItem item = e.Item as GridDataItem; foreach (GridColumn column in item.OwnerTableView.RenderColumns) { if (column.UniqueName == "txtStartDate") { RadTextBox txt = new RadTextBox(); txt.Text = ((RadTextBox)item.FindControl("txtStartDate")).Text; //txt.AutoPostBack = true; //txt.TextChanged += new EventHandler(txtStartDate_TextChanged); //txt.AutoPostBack = true; } } } }
private void ComputeCouponDatesAndFractions(RadDatePicker txtBoxTradeDate, RadComboBox txtBoxLoanName, RadDatePicker txtBoxSettlementDate, RadDatePicker txtBoxMaturityDate, RadTextBox txtBoxCouponFrequency, RadTextBox txtNonDiscountedAverageLife, RadGrid grdCalculatedDates, int type, RadTextBox txtNotional, RadTextBox txtMargin, RadTextBox txtCurrency) { try { int countryID = getCountryForLoan(txtBoxLoanName); //PublicHolidayBLL bll = new PublicHolidayBLL(); //List<tblHoliday> publicHolidays = bll.GetPublicHolidays(countryID); List<CalculatedDates> calculatedList = new List<CalculatedDates>(); DateTime cpnDT; cpnDT = AddBusinessDays(DateTime.Now, 10); LoanScheduleBL loanScheduleBL = new LoanScheduleBL(); DataTable dtSchedule = loanScheduleBL.GenerateTable(15, 10, cpnDT, txtBoxCouponFrequency.Text, txtNotional.Text, txtBoxMaturityDate.SelectedDate.Value, cpnDT, Convert.ToDecimal(txtMargin.Text), Convert.ToString(txtCurrency.Text), Convert.ToDateTime(txtBoxTradeDate.SelectedDate.Value), txtBoxSettlementDate.SelectedDate.Value); if (dtSchedule.Rows.Count > 0) { LoansBLL loanBL = new LoansBLL(); int loanID = loanBL.GetLoanByCode(txtBoxLoanName.Text).ID; loanScheduleBL.EditSchedule(loanID, dtSchedule); } foreach (DataRow dr in dtSchedule.Rows) { CalculatedDates cal = new CalculatedDates(); cal.Fraction = dr["CoupFrac"].ToString(); cal.CalculatedDate = Convert.ToDateTime(dr["EndDate"]); calculatedList.Add(cal); } grdCalculatedDates.Visible = true; grdCalculatedDates.DataSource = calculatedList; grdCalculatedDates.DataBind(); switch (type) { case 1: tempCalculatedList1 = calculatedList; break; case 2: tempCalculatedList2 = calculatedList; break; case 3: tempCalculatedList3 = calculatedList; break; default: break; } } catch (Exception) { } }
private void ValidateNameLengthAndSetAlignment(RadTextBox radTextBox, TextChangingEventArgs e) { e.Cancel = !EntityValidation.ValidateInputLength(e.NewValue, Shayan.Data.InputType.Name); if (!e.Cancel) Methods.SetTextBoxAllignment(radTextBox, e); }
private void setDocsCodeData(DataRow drDetail, int stt, ref RadComboBox cboDocsCode, ref RadNumericTextBox txtNumOfOriginals, ref RadNumericTextBox txtNumOfCopies, ref RadTextBox txtOtherDocs) { cboDocsCode.SelectedValue = drDetail["DocsCode" + stt].ToString(); if (drDetail["NoOfOriginals" + stt] != DBNull.Value) txtNumOfOriginals.Value = Convert.ToDouble(drDetail["NoOfOriginals" + stt]); if (drDetail["NoOfCopies" + stt] != DBNull.Value) txtNumOfCopies.Value = Convert.ToDouble(drDetail["NoOfCopies" + stt]); if (drDetail["OtherDocs" + stt] != DBNull.Value) txtOtherDocs.Text = drDetail["OtherDocs" + stt].ToString(); switch (stt) { case 1: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumOfCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 2: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumOfCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; case 3: divDocsCode1.Visible = (txtNumOfOriginals.Value > 0 || txtNumOfCopies.Value > 0 || !String.IsNullOrEmpty(txtOtherDocs.Text)); break; } }
private void CompleteWithZeros(RadTextBox textbox, int length) { var text = CompleteWithZeros(textbox.Text, length); textbox.Text = text; }
private void calculateTaxAmt(RadNumericTextBox txtChargeAmt, RadComboBox cboPartyCharged, ref RadNumericTextBox txtTaxAmt, ref RadTextBox txtTaxCode) { txtTaxAmt.Text = ""; txtTaxCode.Text = ""; if (txtChargeAmt.Value.HasValue) { //Khong tinh VAT theo y/c nghiep vu ! //[9/10/2014 10:01:06 PM] Nguyen - Viet Victory: Neu Party Charge la: A hoac B thi Xuat phieu VAT (Charge Phi + 10%VAT) //[9/10/2014 10:01:27 PM] Nguyen - Viet Victory: Neu Party Charge la: AC hoac BC thi KHONG Xuat phieu VAT (Charge Phi) /*switch (cboPartyCharged.SelectedValue) { case "A": case "B": txtTaxAmt.Text = String.Format("{0:C}", txtChargeAmt.Value.Value * VAT).Replace("$", ""); txtTaxCode.Text = "81 10% VAT on Charge"; break; default: //txtTaxAmt.Text = String.Format("{0:C}", txtChargeAmt.Value.Value).Replace("$", ""); break; }*/ } //Tính toán lại Amount Credited if (txtDrawingAmount.Value.HasValue) { double AmountCredited = txtDrawingAmount.Value.Value; calculateAmountCredited(tabCableCharge_txtChargeAmt.Value, tabCableCharge_cboPartyCharged.SelectedValue, tabCableCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabPaymentCharge_txtChargeAmt.Value, tabPaymentCharge_cboPartyCharged.SelectedValue, tabPaymentCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabHandlingCharge_txtChargeAmt.Value, tabHandlingCharge_cboPartyCharged.SelectedValue, tabHandlingCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabDiscrepenciesCharge_txtChargeAmt.Value, tabDiscrepenciesCharge_cboPartyCharged.SelectedValue, tabDiscrepenciesCharge_txtTaxAmt.Text, ref AmountCredited); calculateAmountCredited(tabOtherCharge_txtChargeAmt.Value, tabOtherCharge_cboPartyCharged.SelectedValue, tabOtherCharge_txtTaxAmt.Text, ref AmountCredited); txtAmountCredited.Value = AmountCredited; numAmount.Value = AmountCredited; numAmount_MT400.Value = AmountCredited; } }
public static DataRow loadBankSwiftCodeInfo(string BankCode, ref Label lblMessage, ref RadTextBox txtBankName, ref RadTextBox txtBankAddr, ref RadTextBox txtBankCity, ref RadTextBox txtBankCountry) { txtBankAddr.Text = ""; txtBankCity.Text = ""; txtBankCountry.Text = ""; DataRow dr = loadBankSwiftCodeInfo(BankCode, ref lblMessage, ref txtBankName); if (dr == null) return null; txtBankCity.Text = dr["City"].ToString(); txtBankCountry.Text = dr["Country"].ToString(); return dr; }
private void loadCharge(DataRow drCharge, ref RadComboBox cboChargeCode, ref RadComboBox cboChargeCcy, ref RadComboBox cboChargeAcc, ref RadNumericTextBox txtChargeAmt , ref RadComboBox cboPartyCharged, ref RadComboBox cboAmortCharge, ref RadTextBox txtTaxCode, ref RadNumericTextBox txtTaxAmt) { cboChargeCode.SelectedValue = drCharge["ChargeCode"].ToString(); cboChargeCcy.SelectedValue = drCharge["ChargeCcy"].ToString(); cboPartyCharged.SelectedValue = drCharge["PartyCharged"].ToString(); //bc.Commont.initRadComboBox(ref cboChargeAcc, "Display", "Id", bd.SQLData.B_BDRFROMACCOUNT_GetByCurrency(txtCustomerName.Value, cboChargeCcy.SelectedValue)); loadChargeAcc(cboPartyCharged.SelectedValue, cboChargeCcy.SelectedValue, ref cboChargeAcc); cboChargeAcc.SelectedValue = drCharge["ChargeAcct"].ToString(); if (drCharge["ChargeAmt"] != DBNull.Value) txtChargeAmt.Value = Convert.ToDouble(drCharge["ChargeAmt"]); cboAmortCharge.SelectedValue = drCharge["AmortCharge"].ToString(); txtTaxCode.Text = drCharge["TaxCode"].ToString(); if (drCharge["TaxAmt"] != DBNull.Value) txtTaxAmt.Value = Convert.ToDouble(drCharge["TaxAmt"]); }
private bool ValidateName(RadTextBox tb) { bool isValid = !string.IsNullOrEmpty(tb.Text.Trim()); Utils.SetValidationResult(tb, isValid); return isValid; }
public static void SetTextForTextBox(RadTextBox textBox, RadGridView gridView, int cellId) { textBox.Text = gridView.SelectedRows[0].Cells[cellId].Value.ToString(); }
// public static DataRow loadBankSwiftCodeInfo(string bankCode, ref Label lblMessage, ref RadTextBox txtBankName) { lblMessage.Text = ""; txtBankName.Text = ""; bankCode = bankCode.Trim(); if (string.IsNullOrEmpty(bankCode)) return null; // DataTable t = DataProvider.SQLData.B_BBANKSWIFTCODE_GetByCode(bankCode); if (t == null || t.Rows.Count <= 0) { lblMessage.Text = "Can not find this Bank."; return null; } DataRow dr = t.Rows[0]; txtBankName.Text = dr["BankName"].ToString(); return dr; }
public static void SetTextBoxAllignment(RadTextBox txt, TextChangingEventArgs e=null) { if (e == null || e.NewValue == null) { return; } if(e.NewValue.ContainsPersianCharacter()) { txt.RightToLeft=RightToLeft.Yes; txt.TextAlign=HorizontalAlignment.Left; } else { txt.TextAlign = HorizontalAlignment.Right; } }
public static void PermitirSoloNumeros(RadTextBox txt) { txt.KeyPress += new System.Windows.Forms.KeyPressEventHandler(delegate(object s, KeyPressEventArgs e) { if (Char.IsDigit(e.KeyChar)) { e.Handled = false; } else if (Char.IsControl(e.KeyChar)) { e.Handled = false; } else if (Char.IsSeparator(e.KeyChar)) { e.Handled = false; } else { e.Handled = true; } }); }
private void saveCharge(RadTextBox txtChargeCode, RadComboBox cbChargeCcy, RadComboBox cbChargeAcc, RadNumericTextBox txtChargeAmt, RadComboBox cbChargeParty, RadComboBox cbChargeAmort, RadComboBox cbChargeStatus, Label lblTaxCode, Label lblTaxAmt, ref BEXPORT_LC_DOCS_SETTLEMENT_CHARGES ExLCCharge) { ExLCCharge.PaymentCode = tbLCCode.Text; ExLCCharge.ChargeCode = txtChargeCode.Text; ExLCCharge.ChargeCcy = cbChargeCcy.SelectedValue; ExLCCharge.ChargeAcc = cbChargeAcc.SelectedValue; ExLCCharge.ChargeAmt = txtChargeAmt.Value; ExLCCharge.PartyCharged = cbChargeParty.SelectedValue; ExLCCharge.AmortCharge = cbChargeAmort.SelectedValue; ExLCCharge.ChargeStatus = cbChargeStatus.SelectedValue; ExLCCharge.TaxCode = lblTaxCode.Text; if (!string.IsNullOrEmpty(lblTaxAmt.Text)) ExLCCharge.TaxAmt = Convert.ToDouble(lblTaxAmt.Text); }
private HtmlGenericControl CreateHeaderDiv(Criterion criterion) { var containerDiv = new HtmlGenericControl("div"); var headerDiv = new HtmlGenericControl("div"); headerDiv.Attributes["class"] = "criteriaHeaderDiv"; var headerDivLbl = new HtmlGenericControl("div"); headerDivLbl.Attributes["class"] = "left"; var headerDivExpand = new HtmlGenericControl("div"); headerDivExpand.Attributes["class"] = "right"; var adjustedID = StripString(criterion.Key); headerDivExpand.ID = "expand_" + adjustedID; headerDivExpand.Style.Add("overflow", "hidden"); var requiredAsterik = ""; // Add tooltip if (!criterion.Locked && (criterion.UIType != UIType.None)) { var tooltip = new RadToolTip { Height = 55, Width = 205, TargetControlID = headerDivExpand.ID, Position = ToolTipPosition.MiddleRight, RelativeTo = ToolTipRelativeDisplay.Element, HideEvent = ToolTipHideEvent.Default, AutoCloseDelay = 20000, Skin = "Black", ShowEvent = ToolTipShowEvent.OnClick, EnableShadow = true }; var contentChunk = new HtmlGenericControl("div"); contentChunk.Style.Add("position", "relative"); if (criterion.IsRequired) //BJC - 6/11/2012: If this criterion object is required { requiredFields.Value += criterion.Key + ","; //Add Key to the requiredFields hidden input value. requiredAsterik = "<span style=\"font-weight:bold;color:#F00;\">*</span>"; } // Add appropriate control to tooltip switch (criterion.UIType) { case UIType.DropDownList: var cmb = CreateDropDownList(criterion, adjustedID); if (criterion.Object != null && criterion.ReportStringVal != null) { var selectedItemIndex = cmb.FindItemIndexByValue(adjustedID + "_" + criterion.ReportStringVal, true); if (selectedItemIndex > 0) cmb.SelectedIndex = selectedItemIndex; if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1) { requiredFieldsSelected.Value += criterion.Key + ","; } } contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header }); contentChunk.Controls.Add(cmb); tooltip.Attributes["dropDownListID"] = cmb.ID; tooltip.OnClientShow = "onClientShowToolTipDropDownList"; break; //case UIType.RadioButton: // { // var radioButtons = new RadButton() // { // ID = "RadRadioButtonCriteriaRadioButtonList", // GroupName = criterion.Key, // ToggleType = ButtonToggleType.Radio, // //AutoPostBack = false, // //OnClientToggleStateChanged = "OnClientToggleStateChanged" // }; // if (criterion.DataSource == null) // { // radioButtons.ToggleStates.Add(new RadButtonToggleState("No data supplied", string.Format(adjustedID + "_" + "0"))); // } // else // { // radioButtons.ToggleStates.Add(new RadButtonToggleState("All", string.Format(adjustedID + "_" + "0"))); // foreach (DataRow row in ((DataTable)criterion.DataSource).Rows) // { // var rbItem = new RadButtonToggleState(row[criterion.DataTextField].ToString(), // adjustedID + "_" + // row[criterion.DataValueField]); // radioButtons.ToggleStates.Add(rbItem); // } // } // contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header }); // contentChunk.Controls.Add(radioButtons); // break; // } case UIType.CheckBoxList: { tooltip.Width = (criterion.ChildDataSource != null) ? 450 : 205; var listBox = this.CreateCheckBoxList(criterion, adjustedID); tooltip.Attributes.Add("lstBoxID", listBox.ClientID); tooltip.OnClientShow = "setListBoxMaxHeight"; if (criterion.Object != null && criterion.ReportStringVal != null) { if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1) { requiredFieldsSelected.Value += criterion.Key + ","; } } contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header }); contentChunk.Controls.Add(listBox); if (!string.IsNullOrEmpty(criterion.ChildHeader)) { tooltip.OnClientShow = "TooltipOnClientShow_DisplayChildCheckboxItems"; tooltip.Attributes["ParentListID"] = "RadCombobBoxCriteriaCheckBoxList"; tooltip.Attributes["ChildListID"] = "RadCombobBoxCriteriaCheckBoxList2"; listBox.Attributes.Add("ChildCheckBoxList", "RadCombobBoxCriteriaCheckBoxList2"); var listBox2 = new RadListBox { ID = "RadCombobBoxCriteriaCheckBoxList2", AutoPostBack = false, CheckBoxes = true, Skin = "Vista", OnClientItemChecked = "onItemChecked" }; foreach (DataRow row in ((DataTable)criterion.ChildDataSource).Rows) { var listBoxValue = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataValueField].ToString())); var listBoxItem = new RadListBoxItem(row[criterion.ChildDataTextField].ToString(), listBoxValue); listBoxItem.Attributes["parentValue"] = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataParentField].ToString())); listBoxItem.Attributes["checkBoxID"] = string.Format("{0}_RadCombobBoxCriteriaCheckBoxList2_CheckBox", listBoxValue); Criterion tempCriterion = null; foreach (Criterion c in Criteria.CriterionList) { if (c.Key == listBoxValue) { tempCriterion = c; break; } } if (tempCriterion != null) { listBoxItem.Checked = !tempCriterion.Empty; } listBox2.Items.Add(listBoxItem); } contentChunk.Controls.Add(new HtmlGenericControl("span") { InnerText = criterion.ChildHeader }); contentChunk.Controls.Add(listBox2); } break; } case UIType.TextBox: { var textBox = CreateTextBox(criterion, adjustedID); if (criterion.Object != null && criterion.ReportStringVal != null) { if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1) { requiredFieldsSelected.Value += criterion.Key + ","; } } contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header }); contentChunk.Controls.Add(textBox); tooltip.OnClientShow = "onClientShowToolTipTextBox"; tooltip.Attributes["textBoxID"] = textBox.ID; break; } case UIType.DatePicker: { tooltip.Width = 330; var startCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("Start")); var endCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("End")); var wrapperDiv = CreateDatePicker(adjustedID, startCriterion, endCriterion); if (criterion.Object != null && criterion.ReportStringVal != null) { if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1) { requiredFieldsSelected.Value += criterion.Key + ","; } } contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header }); contentChunk.Controls.Add(wrapperDiv); break; } case UIType.AssessmentTextSearch: { tooltip.Width = 400; var wrapperDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); wrapperDiv.Style.Add("width", "350px"); var textBox = new RadTextBox { ID = "RadTextBoxAssessmentTextSearch", AutoPostBack = false, Skin = "Vista" }; textBox.ClientEvents.OnBlur = "onInputBlur"; textBox.Attributes["updateMessageHeader"] = adjustedID; textBox.Attributes["comboBoxDivID"] = "cmbBoxDiv"; //ADD DIV TO contentChunk var textBoxDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "textBoxDiv" }; textBoxDiv.Controls.Add(textBox); var textSearchCmb = new Telerik.Web.UI.RadComboBox { ID = "RadComboBoxAssessmentTextSearch", AutoPostBack = false, MarkFirstMatch = true, AllowCustomText = false, ZIndex = 8005, OnClientSelectedIndexChanged = "onSelectedIndexChanged", Skin = "Vista" }; textSearchCmb.Attributes["textBoxDivID"] = "textBoxDiv"; if (criterion.Object != null) { var textSearchObjectArray = criterion.Object.ToString().Split(':'); textBox.Text = textSearchObjectArray[1].Trim(); var selectedItemIndex = textSearchCmb.FindItemIndexByText(textSearchObjectArray[0].Trim(), true); textSearchCmb.SelectedIndex = selectedItemIndex; if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1) { requiredFieldsSelected.Value += criterion.Key + ","; } } var textSearchCmbDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "cmbBoxDiv" }; textSearchCmbDiv.Controls.Add(textSearchCmb); if (criterion.DataSource == null) { textSearchCmb.Items.Add(new RadComboBoxItem("No data supplied", adjustedID + "_" + "0")); } else { foreach (DataRow row in ((DataTable)criterion.DataSource).Rows) { textSearchCmb.Items.Add(new RadComboBoxItem(row[criterion.DataTextField].ToString(), adjustedID + "_" + row[criterion.DataValueField])); } } contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header }); var wrapperDivLeft = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); wrapperDivLeft.Style.Add("float", "left"); wrapperDivLeft.Style.Add("width", "149px"); wrapperDivLeft.Controls.Add(textBoxDiv); var wrapperDivRight = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); wrapperDivRight.Style.Add("float", "right"); wrapperDivRight.Style.Add("width", "149px"); wrapperDivRight.Controls.Add(textSearchCmbDiv); wrapperDiv.Controls.Add(wrapperDivLeft); wrapperDiv.Controls.Add(wrapperDivRight); contentChunk.Controls.Add(wrapperDiv); break; } case UIType.Demographics: { tooltip.Width = 390; contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header }); contentChunk.Controls.Add(CreateDemographics(criterion, adjustedID)); break; } case UIType.RTI: { contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header }); contentChunk.Controls.Add(CreateRTI(criterion, adjustedID)); break; } } tooltip.Controls.Add(contentChunk); headerDiv.Controls.Add(tooltip); } if (criterion.Locked == false) { headerDivExpand.Controls.Add(new Image { ImageUrl = "~/Images/commands/expand_bubble.png", Width = 16, Height = 16 }); } else if (FirstTimeLoaded) { criterion.ReportStringVal = criterion.DefaultValue; } headerDivLbl.InnerHtml = criterion.Header + ":" + requiredAsterik; headerDiv.Controls.Add(headerDivLbl); headerDiv.Controls.Add(headerDivExpand); var updateMessageDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); updateMessageDiv.Attributes["class"] = "criteriaUpdateMessageDiv"; updateMessageDiv.Attributes["id"] = adjustedID + "_updateMessage"; containerDiv.Controls.Add(headerDiv); containerDiv.Controls.Add(updateMessageDiv); return containerDiv; }