public static RadComboBox SetLocationList(RadComboBox ddl, List <BusinessLocation> locationList, decimal plantID, bool enableBUSelect) { ddl.Items.Clear(); RadComboBoxItem item = null; ADDRESS address = null; decimal busOrgID = 0; int numOrgs = locationList.Select(l => l.Plant.BUS_ORG_ID).Distinct().Count(); foreach (BusinessLocation loc in locationList.OrderBy(l => l.Plant.BUS_ORG_ID).ThenBy(l => l.Plant.PLANT_NAME).ToList()) { if (numOrgs > 1 && loc.Plant.BUS_ORG_ID != busOrgID) { busOrgID = (decimal)loc.Plant.BUS_ORG_ID; item = new RadComboBoxItem(loc.BusinessOrg.ORG_NAME, ("BU" + loc.BusinessOrg.BUS_ORG_ID.ToString())); if (enableBUSelect) { item.BackColor = System.Drawing.Color.Linen; item.ToolTip = loc.BusinessOrg.DUNS_CODE; } else { item.IsSeparator = true; if (ddl.CheckBoxes) { item.Checked = false; } } item.ImageUrl = "~/images/defaulticon/16x16/sitemap.png"; ddl.Items.Add(item); } item = new RadComboBoxItem(loc.Plant.PLANT_NAME, loc.Plant.PLANT_ID.ToString()); item.IsSeparator = false; if ((address = loc.Plant.ADDRESS.FirstOrDefault()) != null) { item.ToolTip = address.STREET1 + " " + address.CITY; } if (plantID < 0) { item.Checked = true; } ddl.Items.Add(item); } //ddl.Items.Insert(0, new RadComboBoxItem("", "")); if (plantID > 0 && ddl.Items.FindItemByValue(plantID.ToString()) != null) { if (ddl.CheckBoxes) { ddl.FindItemByValue(plantID.ToString()).Checked = true; } else { ddl.SelectedValue = plantID.ToString(); } } return(ddl); }
private void CargarCentros(RadComboBox rcb, int i) { try { Sesion Sesion = new Sesion(); Sesion = (Sesion)Session["Sesion" + Session.SessionID]; CapaNegocios.CN__Comun CN_Comun = new CapaNegocios.CN__Comun(); if (i == 1) { if (Sesion.U_MultiOfi == false) { CN_Comun.LlenaCombo(2, Sesion.Id_Emp, Sesion.Id_U, Sesion.Emp_Cnx, "spCatCentroDistribucion_Combo", ref rcb); rcb.Visible = false; this.TblEncabezado.Rows[0].Cells[2].InnerText = " " + rcb.FindItemByValue(Sesion.Id_Cd_Ver.ToString()).Text; } else { CN_Comun.LlenaCombo(1, Sesion.Id_Emp, Sesion.Id_U, Sesion.Emp_Cnx, "spCatCentroDistribucion_Combo", ref rcb); rcb.SelectedValue = Sesion.Id_Cd_Ver.ToString(); } } } catch (Exception ex) { throw ex; } }
protected void rgFlagReason_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { FlagReasons f = (FlagReasons)e.Item.DataItem; CheckBox chkAcDec = (CheckBox)e.Item.FindControl("chkAcDec"); HiddenField hdfId = (HiddenField)e.Item.FindControl("hdfId"); hdfId.Value = f.Id.ToString(); CheckBox chkIsHasOther = (CheckBox)e.Item.FindControl("chkIsHasOther"); HiddenField hdfIdOther = (HiddenField)e.Item.FindControl("hdfIdOther"); hdfIdOther.Value = f.Id.ToString(); if (f.IsActive) { chkAcDec.Checked = true; } else { chkAcDec.Checked = false; } if (f.isHasOther) { chkIsHasOther.Checked = true; } else { chkIsHasOther.Checked = false; } LinkButton lnkBtnDelete = (LinkButton)e.Item.FindControl("lnkBtnDelete"); lnkBtnDelete.Attributes.Add("onclick", "return DeleteConfirmation('" + ((GridDataItem)e.Item)["Bodyname"].Text + "');"); } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", rgFlagReason.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", rgFlagReason.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", rgFlagReason.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", rgFlagReason.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Effie2017.App.Registration reg = (Effie2017.App.Registration)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; CheckBox chkbox = null; // No //lbl = (Label)e.Item.FindControl("lblNo"); //lbl.Text = counter.ToString(); // submitted by lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnSubmittedBy"); lnkBtn.Text = reg.Company; lnkBtn.CommandArgument = reg.Id.ToString(); // Email lnk = (HyperLink)e.Item.FindControl("lnkEmail"); lnk.Text = reg.Email; lnk.NavigateUrl = "mailto:" + reg.Email; // Contact ((GridDataItem)e.Item)["Contact"].Text = GeneralFunction.ShowFriendlyContact(reg.Contact); try { string DateReminder = ""; if (reg.DateReminder(reg.Id, EmailTypeEnum.UserList.ToString()) != DateTime.MinValue) { DateReminder = reg.DateReminder(reg.Id, EmailTypeEnum.UserList.ToString()).ToString("dd/MM/yy H:mm"); } ((GridDataItem)e.Item)["DateReminder"].Text = DateReminder; } catch { ((GridDataItem)e.Item)["DateReminder"].Text = ""; } // CAAAA lbl = (Label)e.Item.FindControl("lbCAAAA"); lbl.Text = GeneralFunction.ExtractBracketValue(reg.Caaaa); // APEP lbl = (Label)e.Item.FindControl("lbAPEP"); lbl.Text = GeneralFunction.ExtractBracketValue(reg.Apep); // view lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnView"); lnkBtn.CommandArgument = reg.Id.ToString(); // edit lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit"); lnkBtn.CommandArgument = reg.Id.ToString(); Security.SecureControlByHiding(lnkBtn); // is verified lbl = (Label)e.Item.FindControl("lbIsVerified"); lbl.Text = reg.IsVerified ? "Yes" : "No"; // chkbox verification //chkbox = (CheckBox)e.Item.FindControl("chkbox"); //if (reg.Status == StatusRegistration.OK && !reg.IsVerified) // chkbox.Enabled = true; //else // chkbox.Enabled = false; lnk = (HyperLink)e.Item.FindControl("hlkEmailHistory"); lnk.CssClass = "fancybox fancybox.iframe tblLinkRed"; lnk.NavigateUrl = "./RegistrationEmailSentHistory.aspx?regId=" + reg.Id.ToString(); counter++; } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem; LinkButton lnkBtn, lnkBtn2 = null; Label lbl = null; HyperLink lnk = null; // Categories lbl = (Label)e.Item.FindControl("lbCategory");//GeneralFunction.GetEntryMarket(entry.CategoryMarketFromRound(round)) + "<br/>" + lbl.Text = entry.CategoryPSDetailFromRound(round); // submitted by lbl = (Label)e.Item.FindControl("lnkBtnBuSubmittedBy"); Registration reg = GeneralFunction.GetRegistrationFromEntry(entry); lbl.Text = "-"; if (reg != null) { lbl.Text = reg.Company; //lnkBtn.CommandArgument = reg.Id.ToString(); } // Country lbl = (Label)e.Item.FindControl("lbCountry"); lbl.Text = "-"; if (reg != null) { lbl.Text = reg.Country; } // client and agency CompanyCreditList cclist = CompanyCreditList.GetCompanyCreditList(entry.Id); try { lbl = (Label)e.Item.FindControl("lbClient"); lbl.Text = cclist[0].Company; lbl = (Label)e.Item.FindControl("lbAgency1"); lbl.Text = cclist[1].Company; lbl = (Label)e.Item.FindControl("lbAgency2"); lbl.Text = cclist[2].Company; lbl = (Label)e.Item.FindControl("lbAgency3"); lbl.Text = cclist[3].Company; lbl = (Label)e.Item.FindControl("lbAgency4"); lbl.Text = cclist[4].Company; lbl = (Label)e.Item.FindControl("lbAgency5"); lbl.Text = cclist[5].Company; } catch { } //// submitted details //lbl = (Label)e.Item.FindControl("lblSubmittedDetails"); //lbl.Text = reg.Firstname + " " + reg.Lastname + "<br/>" + reg.Job + "<br/>" + GeneralFunction.ShowFriendlyContact(reg.Contact) + "<br/>" + reg.Email; // Jury panel 1 List <JuryPanelCategory> jcpList = GeneralFunction.GetJuryPanelCategoryFromCategoryPS(entry.CategoryMarketFromRound(round), entry.CategoryPSFromRound(round), entry.CategoryPSDetailFromRound(round), round); if (jcpList != null && jcpList.Count > 0) { lbl = (Label)e.Item.FindControl("lbJuryPanel"); lbl.Text = jcpList[0].PanelId; } // Jury panel round2 // Jury List <EffieJuryManagementApp.Jury> jlist = GeneralFunction.GetJuryListFromEntryCategory(entry.CategoryMarketFromRound(round), entry.CategoryPSFromRound(round), entry.CategoryPSDetailFromRound(round), round); DisplayJury(e, "lbJury1", jlist, 0); DisplayJury(e, "lbJury2", jlist, 1); DisplayJury(e, "lbJury3", jlist, 2); DisplayJury(e, "lbJury4", jlist, 3); DisplayJury(e, "lbJury5", jlist, 4); DisplayJury(e, "lbJury6", jlist, 5); DisplayJury(e, "lbJury7", jlist, 6); DisplayJury(e, "lbJury8", jlist, 7); DisplayJury(e, "lbJury9", jlist, 8); DisplayJury(e, "lbJury10", jlist, 9); DisplayJury(e, "lbJury11", jlist, 10); DisplayJury(e, "lbJury12", jlist, 11); DisplayJury(e, "lbJury13", jlist, 12); DisplayJury(e, "lbJury14", jlist, 13); DisplayJury(e, "lbJury15", jlist, 14); DisplayJury(e, "lbJury16", jlist, 15); DisplayJury(e, "lbJury17", jlist, 16); DisplayJury(e, "lbJury18", jlist, 17); DisplayJury(e, "lbJury19", jlist, 18); DisplayJury(e, "lbJury20", jlist, 19); //// chkboxes //CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox"); //Security.SecureControlByHiding(chkbox); } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); //PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20")); //PageSizeCombo.FindItemByText("20").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); string PageSize = e.Item.OwnerTableView.PageSize.ToString(); PageSizeCombo.FindItemByValue(PageSizeDefault.ToString()).Selected = true; } }
// Set the controls by the value of the parameters private void SetControlObjectByValue(Control aControl, string aValue) { string _type = aControl.GetType().Name; if (_type == "RadTextBox") { RadTextBox _box = (RadTextBox)aControl; _box.Text = aValue; } else if (_type == "RadDropDownList") { RadDropDownList _list = (RadDropDownList)aControl; DropDownListItem _item = _list.FindItemByValue(aValue); int _selectedIndex = 0; if (_item != null) { _selectedIndex = _item.Index; } _list.SelectedIndex = _selectedIndex; } else if (_type == "RadNumericTextBox") { RadNumericTextBox _numeric = (RadNumericTextBox)aControl; _numeric.Value = Convert.ToDouble(aValue); } else if (_type == "RadSearchBox") { RadSearchBox _search = (RadSearchBox)aControl; if (aValue.Contains('^')) { string[] _splitForContext = aValue.Split('^'); _search.Text = _splitForContext[0].Trim(); int _selectedCtx = Convert.ToInt32(_splitForContext[1].Trim()); if (_selectedCtx != -1) { _search.SearchContext.Items[_selectedCtx].Selected = true; } } else { _search.Text = aValue; } } else if (_type == "RadComboBox") { RadComboBox _combo = (RadComboBox)aControl; if (_combo.CheckBoxes) { for (int i = 0; i < _combo.Items.Count; i++) { _combo.Items[i].Checked = aValue[i] == '1'; } } else { RadComboBoxItem _item = _combo.FindItemByValue(aValue); if (_item != null) { _item.Selected = true; } else { _combo.Text = aValue; } } } else if (_type == "RadButton") { RadButton _button = (RadButton)aControl; // TODO: Set all checks here if (_button.ToggleType == ButtonToggleType.CustomToggle) { _button.SelectedToggleStateIndex = Convert.ToInt32(aValue); } // For everything else else { _button.Checked = aValue == "1"; } } else if (_type == "RadDatePicker") { RadDatePicker _date = (RadDatePicker)aControl; _date.SelectedDate = DateTime.Parse(aValue); } else if (_type == "RadTabStrip") { RadTabStrip _tabstrip = (RadTabStrip)aControl; int _index = Convert.ToInt32(aValue); _tabstrip.SelectedIndex = _index; _tabstrip.MultiPage.SelectedIndex = _index; } }
protected void radGridJury_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { EmailTemplate emailTemplate = (EmailTemplate)e.Item.DataItem; if (emailTemplate != null) { LinkButton lnkBtn = null; HyperLink hlk = null; EmailTemplate parentTemplate = EmailTemplate.GetEmailTemplate(emailTemplate.TemplateId); if (parentTemplate != null) { Label lblTempalteName = (Label)e.Item.FindControl("lblTempalteName"); lblTempalteName.Text = parentTemplate.Title; } lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit"); lnkBtn.CommandArgument = emailTemplate.Id.ToString(); if (Security.IsRoleAdmin() || Security.IsRoleAdmin2() || Security.IsReadOnlyAdmin()) { lnkBtn.Visible = false; } lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnDelete"); lnkBtn.CommandArgument = emailTemplate.Id.ToString(); if (Security.IsRoleAdmin() || Security.IsRoleAdmin2() || Security.IsReadOnlyAdmin()) { lnkBtn.Visible = false; } lnkBtn = (LinkButton)e.Item.FindControl("hlCloneTamplate"); lnkBtn.CommandArgument = emailTemplate.Id.ToString(); if (Security.IsRoleAdmin() || Security.IsRoleAdmin2() || Security.IsReadOnlyAdmin()) { lnkBtn.Visible = false; } hlk = (HyperLink)e.Item.FindControl("hlkPreview"); hlk.CssClass = "fancybox fancybox.iframe tblLinkRed"; hlk.NavigateUrl = "./EmailPreview.aspx?etmId=" + emailTemplate.Id.ToString(); } } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
private void SetEditForm(object sender, GridItemEventArgs e) { GridItem griditem = e.Item as GridItem; GridEditFormItem editform = (GridEditFormItem)e.Item; if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) { RadComboBox radcomboKSA = (RadComboBox)editform.FindControl("radcomboKSA"); RadEditor radEditorJAKSADescription = editform.FindControl("radEditorJAKSADescription") as RadEditor; //HtmlTableRow trsearch = editform.FindControl("trKSASearch") as HtmlTableRow; HtmlTableCell tdsearch = editform.FindControl("tdKSASearch") as HtmlTableCell; HtmlTableRow trksadd = editform.FindControl("trKSADD") as HtmlTableRow; HtmlTableRow trKSADutyOption = editform.FindControl("trKSADutyOption") as HtmlTableRow; ctrlSearchKSA searchKSA = editform.FindControl("SearchKSA") as ctrlSearchKSA; Button btnUpdate = editform.FindControl("btnUpdate") as Button; RadComboBox radComboDutyQualID = (RadComboBox)editform.FindControl("radComboDutyQualID"); RadComboBox radcomboQualificationTypeID = (RadComboBox)editform.FindControl("radcomboQualificationTypeID"); ControlUtility.BindRadComboBoxControl(radComboDutyQualID, BindQualifications(), null, "QualificationName", "QualificationID"); ControlUtility.BindRadComboBoxControl(radcomboQualificationTypeID, BindQualificationTypes(), null, "QualificationTypeName", "QualificationTypeID"); //Issue 1015 - Make "KSA" default instead of "KSA-Quality Ranking Factor" if (radcomboQualificationTypeID != null) { radcomboQualificationTypeID.SelectedValue = "3"; } if (griditem.DataItem is JobAnalysisDutyKSAFactor) { JobAnalysisDutyKSAFactor jaDutyKSAFactor = griditem.DataItem as JobAnalysisDutyKSAFactor; radEditorJAKSADescription.Content = jaDutyKSAFactor.JQFactorTitle.Replace("\n", "<br />"); radComboDutyQualID.SelectedValue = jaDutyKSAFactor.QualificationID.ToString(); radcomboQualificationTypeID.SelectedValue = jaDutyKSAFactor.QualificationTypeID.ToString(); } if (e.Item is GridEditFormInsertItem) { tdsearch.Visible = true; //trsearch.Visible = true; trksadd.Visible = true; searchKSA.SeriesID = base.CurrentJNP.SeriesID; //searchKSA.ShowGradeSelection = false; searchKSA.CurrentGrade = CurrentJNP.HighestAdvertisedGrade; //searchKSA.BindData(); BindKSACombo(radcomboKSA); btnUpdate.CommandName = RadGrid.PerformInsertCommandName; btnUpdate.Text = "Add KSA"; rgDutyKSA.ShowFooter = false; radcomboQualificationTypeID.Enabled = true; trKSADutyOption.Visible = true; HtmlTableRow rw = (HtmlTableRow)editform.FindControl("row1"); if (rw != null) { rw.Visible = true; } //Hiring Managers should not be able to add SF to duties in Revise Status, but should be able to add KSAs and KSA -QRF. //System Admins and HR with Supervisory Access will still be able to add SF in Revise status. if (CurrentJNPWS == enumJNPWorkflowStatus.Revise) { if (base.IsAdmin || base.HasHRGroupPermission) { //Don't remove SF in Revise status. } else { RadComboBoxItem itemSF = radcomboQualificationTypeID.FindItemByValue(Convert.ToInt32(enumQualificationType.SelectiveFactor).ToString()); if (itemSF != null) { radcomboQualificationTypeID.Items.Remove(itemSF); } } } } else //edit duty ksa { tdsearch.Visible = false; //trsearch.Visible = false; trksadd.Visible = false; trKSADutyOption.Visible = false; // JA issue 920:Qualification type should not be allowed to be changed in edit mode. radcomboQualificationTypeID.Enabled = false; btnUpdate.CommandName = RadGrid.UpdateCommandName; btnUpdate.Text = "Save KSA"; if (IsInView) { radComboDutyQualID.Enabled = false; radcomboQualificationTypeID.Enabled = false; btnUpdate.Enabled = false; } rgDutyKSA.ShowFooter = true; } if (CurrentJNPWS != enumJNPWorkflowStatus.Published) { if (base.IsAdmin) { //Qualification type should not be allowed to be changed in edit mode. //radcomboQualificationTypeID.Enabled = true; if (!IsInView) // For Issue 991 - To make uneditable in view mode { btnUpdate.Enabled = true; } } } } }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; //((GridDataItem)e.Item)["DateSubmitted"].Text = entry.DateSubmitted.ToString("MM/dd/yy hh:mm:ss tt"); if (entry.CategoryMarket == "SM") { ((GridDataItem)e.Item)["CategoryMarket"].Text = "Single Market"; } else if (entry.CategoryMarket == "MM") { ((GridDataItem)e.Item)["CategoryMarket"].Text = "Multi Market"; } ((GridDataItem)e.Item)["CategoryMarket"].Text = entry.CategoryPSDetail; ((GridDataItem)e.Item)["Status"].Text = GeneralFunction.GetEntryStatusForAdmin(entry.Status); ((GridDataItem)e.Item)["Deadline"].Text = entry.Deadline; // Status if (entry.Status == StatusEntry.Completed) { ((GridDataItem)e.Item)["Status"].Text = "<span style=\"font-weight:bold\">" + GeneralFunction.GetEntryStatus(entry.Status) + "</span>"; } if (entry.WithdrawnStatus != "") { ((GridDataItem)e.Item)["Status"].Text += "<br/><span style=\"color:Red;\">" + GeneralFunction.GetWithdrawnStatus(entry.WithdrawnStatus) + "</span>"; } // submitted by lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnBuSubmittedBy"); Registration reg = GeneralFunction.GetRegistrationFromEntry(entry); lnkBtn.Text = "-"; if (reg != null) { lnkBtn.Text = GeneralFunction.GetRegistrationFromEntry(entry).Company; lnkBtn.CommandArgument = reg.Id.ToString(); } // submitted details lbl = (Label)e.Item.FindControl("lblSubmittedDetails"); lbl.Text = reg.Firstname + " " + reg.Lastname + "<br/>" + reg.Job + "<br/>" + GeneralFunction.ShowFriendlyContact(reg.Contact) + "<br/>" + reg.Email; if (reg != null) { lnkBtn.Text = GeneralFunction.GetRegistrationFromEntry(entry).Company; lnkBtn.CommandArgument = reg.Id.ToString(); // Changes by Shaik for adding new columns on 19 Oct 2015 ((GridDataItem)e.Item)["Firstname"].Text = reg.Firstname; ((GridDataItem)e.Item)["Lastname"].Text = reg.Lastname; ((GridDataItem)e.Item)["Country"].Text = reg.Country; } if (File.Exists(System.Configuration.ConfigurationSettings.AppSettings["storagePhysicalPath"] + "EntryUpload\\CreativeVideo\\" + entry.Serial + "_CreativeMaterials_Video.mp4")) { lnkBtn = (LinkButton)e.Item.FindControl("lnkDownloadVideo"); lnkBtn.Visible = true; lnkBtn.CommandArgument = entry.Id.ToString(); } ((GridDataItem)e.Item)["IsVideoDownloaded"].Text = entry.IsVideoDownloaded ? "Yes" : "No"; } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
protected void radGridJury_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Jury jury = (Jury)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; // Jury Id lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnJuryId"); lnkBtn.Text = jury.SerialNo; lnkBtn.CommandArgument = jury.Id.ToString(); ((GridDataItem)e.Item)["Status"].Text = jury.IsToDelete ? "Del" : "Cur"; // Jury Name lnk = (HyperLink)e.Item.FindControl("lnkJuryName"); lnk.Text = jury.FirstName + " " + jury.LastName; lnk.NavigateUrl = "mailto:" + jury.Email; lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit"); lnkBtn.CommandArgument = jury.Id.ToString(); HiddenField hdfId = (HiddenField)e.Item.FindControl("hdfId"); hdfId.Value = jury.Id.ToString(); lnk = (HyperLink)e.Item.FindControl("hlkEmailHistory"); lnk.CssClass = "fancybox fancybox.iframe tblLinkRed"; lnk.NavigateUrl = "./EmailSentHistory.aspx?juryId=" + jury.Id.ToString(); CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox"); try { InvitationList invList = InvitationList.GetInvitationList(jury.Id, Gen_GeneralUseValueList.GetGen_GeneralUseValueList("EventCode")[0].Value); if (invList.Count > 0) { chkbox.Enabled = false; } } catch { } lnk = (HyperLink)e.Item.FindControl("hlkEmailHistory"); lnk.CssClass = "fancybox fancybox.iframe tblLinkRed"; lnk.NavigateUrl = "./EmailSentHistory.aspx?juryId=" + jury.Id.ToString(); LinkButton lnkDelete = (LinkButton)e.Item.FindControl("lnkDelete"); lnkDelete.CommandArgument = jury.Id.ToString(); LinkButton lnkRestore = (LinkButton)e.Item.FindControl("lnkRestore"); lnkRestore.CommandArgument = jury.Id.ToString(); CheckBox chkBox = (CheckBox)e.Item.FindControl("chkbox"); switch ((string)ViewState["TabFilterValue"]) { case "All": lnkRestore.Visible = false; lnkDelete.Visible = true; chkBox.Visible = true; break; case "Deleted": lnkDelete.Visible = false; lnkRestore.Visible = true; chkBox.Visible = false; break; default: lnkDelete.Visible = true; chkBox.Visible = true; break; } if (Security.IsRoleReadOnlyAdmin()) { lnkDelete.Visible = false; } } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Score score = (Score)e.Item.DataItem; EffieJuryManagementApp.Jury jury = GeneralFunction.GetAllJuryCache(true, round).Where(x => x.Id == score.Juryid).FirstOrDefault(); LinkButton lnkBtn, lnkBtn2 = null; Label lbl = null; HyperLink lnk = null; Entry entry = GeneralFunction.GetEntryFromIDCache(score.EntryId); if (entry != null) { // Entry Id lbl = (Label)e.Item.FindControl("lbSerial"); lbl.Text = entry.Serial; // Title lbl = (Label)e.Item.FindControl("lbTitle"); lbl.Text = entry.Campaign; lbl = (Label)e.Item.FindControl("lbClient"); lbl.Text = entry.Client; // Categories lbl = (Label)e.Item.FindControl("lbCategory"); //lbl.Text = GeneralFunction.GetEntryMarket(entry.CategoryMarket) + "<br/>" + entry.CategoryPSDetail; lbl.Text = entry.CategoryPSDetail; // submitted by lbl = (Label)e.Item.FindControl("lnkBtnBuSubmittedBy"); Registration reg = GeneralFunction.GetRegistrationFromEntry(entry); lbl.Text = "-"; if (reg != null) { lbl.Text = reg.Company; //lnkBtn.CommandArgument = reg.Id.ToString(); } // Country lbl = (Label)e.Item.FindControl("lbCountry"); lbl.Text = "-"; if (reg != null) { lbl.Text = reg.Country; } } if (jury != null) { List <JuryPanelCategory> jcpList = GeneralFunction.GetJuryPanelCategoryFromCategoryPS(entry.CategoryMarketFromRound(round), entry.CategoryPSFromRound(round), entry.CategoryPSDetailFromRound(round), round); // Panel lbl = (Label)e.Item.FindControl("lbPanel"); if (jcpList.Count > 0) { lbl.Text = jcpList[0].PanelId; } // Jury lbl = (Label)e.Item.FindControl("lbJuryId"); lbl.Text = jury.SerialNo; lbl = (Label)e.Item.FindControl("lbJuryName"); lbl.Text = jury.FirstName + " " + jury.LastName; lbl = (Label)e.Item.FindControl("lbJuryTitle"); lbl.Text = jury.Designation; lbl = (Label)e.Item.FindControl("lbJuryCompany"); lbl.Text = jury.Company; //lbl = (Label)e.Item.FindControl("lbJuryNetwork"); //lbl.Text = jury.Network; //if (jury.Network == "Others") lbl.Text += "-" + jury.NetworkOthers; //lbl = (Label)e.Item.FindControl("lbJuryHoldingCompany"); //lbl.Text = jury.HoldingCompany; if (jury.HoldingCompany == "Others") { lbl.Text += "-" + jury.HoldingCompanyOthers; } lbl = (Label)e.Item.FindControl("lbJuryCountry"); lbl.Text = jury.Country; } //// Flag lbl = (Label)e.Item.FindControl("lbJuryFlag"); lbl.Text = score.IsRecuse ? "Jury Recusal" : score.Flag; lbl = (Label)e.Item.FindControl("lbJuryFlagReason"); lbl.Text = score.FlagOthers; //lbl = (Label)e.Item.FindControl("lbJuryRecuseFlag"); //lbl.Text = "Yes"; //if (!score.IsRecuse) lbl.Text = "No"; lbl = (Label)e.Item.FindControl("lbJuryRecuseReason"); lbl.Text = score.RecuseRemarks; lbl = (Label)e.Item.FindControl("lbDateSubmitted"); lbl.Text = ""; if (score.DateSubmitted != DateTime.MinValue) { lbl.Text = score.DateSubmitted.ToString("dd/MM/yy"); } //Action lnkBtn = (LinkButton)e.Item.FindControl("lnkScore"); if (score != null) { lnkBtn.CommandArgument = score.Id.ToString(); lnkBtn.Visible = true; } //// chkboxes //CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox"); //Security.SecureControlByHiding(chkbox); } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); //PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20")); //PageSizeCombo.FindItemByText("20").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); string PageSize = e.Item.OwnerTableView.PageSize.ToString(); PageSizeCombo.FindItemByValue(PageSizeDefault.ToString()).Selected = true; } }
/// <summary> /// 设置选中的值 /// </summary> /// <param name="box"></param> /// <param name="value">值</param> public static RadComboBoxItem SetSelectedValue(this RadComboBox box, string value) { RadComboBoxItem item = box.FindItemByValue(value); return(SetSelected(box, item)); }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Effie2017.App.Entry entry = (Effie2017.App.Entry)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; // Edit button lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit"); Security.SecureControlByHiding(lnkBtn); //((GridDataItem)e.Item)["Id"].Text = entry.Id.ToString(); HiddenField hdfId = (HiddenField)e.Item.FindControl("hdfId"); hdfId.Value = entry.Id.ToString(); // market if (entry.CategoryMarket == "SM") { ((GridDataItem)e.Item)["CategoryMarket"].Text = "Single Market"; } else if (entry.CategoryMarket == "MM") { ((GridDataItem)e.Item)["CategoryMarket"].Text = "Multi Market"; } ((GridDataItem)e.Item)["CategoryMarket"].Text = entry.CategoryPSDetail; ((GridDataItem)e.Item)["Status"].Text = GeneralFunction.GetEntryStatusForAdmin(entry.Status); string ProcessingStatus = entry.ProcessingStatus; if (entry.ProcessingStatus == StatusEntry.Completed) { ProcessingStatus = "Completed"; } else { ProcessingStatus = GeneralFunction.GetEntryStatusForAdmin(entry.ProcessingStatus); } ((GridDataItem)e.Item)["ProcessingStatus"].Text = "<span style='font-weight: bold;'>" + ProcessingStatus + "</span>"; // Status if (entry.Status == StatusEntry.Completed) { ((GridDataItem)e.Item)["Status"].Text = "<span style=\"font-weight:bold\">" + GeneralFunction.GetEntryStatus(entry.Status) + "</span>"; } if (entry.WithdrawnStatus != "") { ((GridDataItem)e.Item)["Status"].Text += "<br/><span style=\"color:Red;\">" + GeneralFunction.GetWithdrawnStatus(entry.WithdrawnStatus) + "</span>"; } Administrator administrator = AdministratorList.GetAdministratorList().Where(x => x.Id == entry.AdminidAssignedto).FirstOrDefault(); try { ((GridDataItem)e.Item)["AdminidAssignedto"].Text = administrator.LoginId;; } catch { ((GridDataItem)e.Item)["AdminidAssignedto"].Text = ""; } // submitted by lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnBuSubmittedBy"); Registration reg = GeneralFunction.GetRegistrationFromEntry(entry); lnkBtn.Text = "-"; if (reg != null) { lnkBtn.Text = GeneralFunction.GetRegistrationFromEntry(entry).Company; lnkBtn.CommandArgument = reg.Id.ToString(); // Changes by Shaik for adding new columns on 19 Oct 2015 ((GridDataItem)e.Item)["Firstname"].Text = reg.Firstname; ((GridDataItem)e.Item)["Lastname"].Text = reg.Lastname; } // submitted details lbl = (Label)e.Item.FindControl("lblSubmittedDetails"); lbl.Text = reg.Firstname + " " + reg.Lastname + "<br/>" + reg.Job + "<br/>" + GeneralFunction.ShowFriendlyContact(reg.Contact) + "<br/>" + reg.Email; // chkboxes CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox"); Security.SecureControlByHiding(chkbox); //Edit By Rico, Nov 28 2013, Extra Collumn for Countr and Date Reminder ((GridDataItem)e.Item)["Country"].Text = reg.Country; CheckBox checkbox = (CheckBox)e.Item.FindControl("chkbox"); if (checkbox != null) { checkbox.Visible = true; } } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { EffieJuryManagementApp.Jury jury = (EffieJuryManagementApp.Jury)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; // Jury Id lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnJuryId"); lnkBtn.Text = jury.SerialNo; lnkBtn.CommandArgument = jury.Id.ToString(); // Jury Name lnk = (HyperLink)e.Item.FindControl("lnkJuryName"); lnk.Text = jury.FirstName + " " + jury.LastName; lnk.NavigateUrl = "mailto:" + jury.Email; // Round 1 Panel lbl = (Label)e.Item.FindControl("lbJuryPanelRound1"); string round1PanelId = GeneralFunction.CleanDelimiterList(jury.Round1PanelId, '|', ", "); if (String.IsNullOrEmpty(round1PanelId)) { lbl.Text = "-"; } else { lbl.Text = round1PanelId; } //// Round 1 //lbl = (Label)e.Item.FindControl("lbRound1"); //lbl.Text = "N"; //if (jury.Round1PanelId != "") lbl.Text = "Y"; // Round 2 Panel lbl = (Label)e.Item.FindControl("lbJuryPanelRound2"); string round2PanelId = GeneralFunction.CleanDelimiterList(jury.Round2PanelId, '|', ", "); if (String.IsNullOrEmpty(round2PanelId)) { lbl.Text = "-"; } else { lbl.Text = round2PanelId; } //// Round 2 //lbl = (Label)e.Item.FindControl("lbRound2"); //lbl.Text = "N"; //if (jury.Round2PanelId != "") lbl.Text = "Y"; // Categories R1 lbl = (Label)e.Item.FindControl("lbCategory"); List <JuryPanelCategory> jcplist = GeneralFunction.GetJuryPanelCategoryFromPanelId(jury.Round1PanelId, "1").Where(m => !String.IsNullOrEmpty(m.CategoryPSDetail)).ToList(); if (!String.IsNullOrEmpty(round1PanelId)) { foreach (JuryPanelCategory jcp in jcplist) { string market = jcp.CategoryPSDetail.Substring(0, 2); string categoryname = jcp.CategoryPSDetail.Substring(3, jcp.CategoryPSDetail.Length - 3); lbl.Text += Category.GetCategoryCode(market, categoryname) + "<br/>";// +parts[1] + "<br/>"; } } // Categories R2 lbl = (Label)e.Item.FindControl("lbCategory2"); List <JuryPanelCategory> jcplist2 = GeneralFunction.GetJuryPanelCategoryFromPanelId(jury.Round2PanelId, "2").Where(m => !String.IsNullOrEmpty(m.CategoryPSDetail)).ToList(); if (!String.IsNullOrEmpty(round2PanelId)) { foreach (JuryPanelCategory jcp in jcplist2) { string market = jcp.CategoryPSDetail.Substring(0, 2); string categoryname = jcp.CategoryPSDetail.Substring(3, jcp.CategoryPSDetail.Length - 3); lbl.Text += Category.GetCategoryCode(market, categoryname) + "<br/>";// +parts[1] + "<br/>"; } } // Scoring Completion // get all his scoring lbl = (Label)e.Item.FindControl("lbScoringCompletion"); List <Score> scores = GeneralFunction.GetScoreListFromJuryCache(jury.Id, round); List <Score> fscores = scores.Where(p => p.IsSubmitted && !p.IsAdminRecuse && !p.IsRecuse).ToList(); //List<Score> ascores = GeneralFunction.FilterScoreListFromActivePanels(fscores, round); //List<Entry> fentries = GeneralFunction.GetEntryListValidFromJuryPanel(jury, round); //List<Entry> aentries = GeneralFunction.FilterEntryListFromActivePanels(fentries, round); //lbl.Text = fscores.Count.ToString() + " / " + fentries.Count.ToString(); lbl.Text = fscores.Count.ToString() + " / " + GeneralFunction.GetEntryCountValidFromJury(jury, round.Equals("1") ? jcplist : jcplist2, scores, round).ToString(); // Scoring Pending // get all his scoring lbl = (Label)e.Item.FindControl("lbScoringPending"); //List<Score> scoresPending = GeneralFunction.GetScoreListFromJuryCache(jury.Id, round); //List<Score> fscoresPending = scores.Where(p => !p.IsSubmitted && !p.IsAdminRecuse && !p.IsRecuse).ToList(); lbl.Text = GeneralFunction.GetPendingEntryCountValidFromJury(jury, round.Equals("1") ? jcplist : jcplist2, scores, round).ToString(); // chkboxes CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox"); Security.SecureControlByHiding(chkbox); lnk = (HyperLink)e.Item.FindControl("hlkEmailHistory"); lnk.CssClass = "fancybox fancybox.iframe tblLinkRed"; lnk.NavigateUrl = "./JuryEmailSentHistory.aspx?JuryId=" + jury.Id.ToString(); lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit"); lnkBtn.Visible = !Security.IsReadOnlyAdmin(); lnkBtn = (LinkButton)e.Item.FindControl("lnkAssign"); lnkBtn.Visible = !Security.IsReadOnlyAdmin(); } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); //PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20")); //PageSizeCombo.FindItemByText("20").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); string PageSize = e.Item.OwnerTableView.PageSize.ToString(); PageSizeCombo.FindItemByValue(PageSizeDefault.ToString()).Selected = true; } }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { GalaOrder go = (GalaOrder)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; // Shippng lbl = (Label)e.Item.FindControl("lbShipping"); if (go.Shipping == "collect_office") { lbl.Text = "Office"; } if (go.Shipping == "collect_onsite") { lbl.Text = "Onsite"; } if (go.Shipping == "courier") { lbl.Text = "Courier"; } // Payment Method lbl = (Label)e.Item.FindControl("lbPaymentMethod"); lbl.Text = GeneralFunction.GetPaymentType(go.PaymentMethod); // Payment Status lbl = (Label)e.Item.FindControl("lbPaymentStatus"); lbl.Text = GeneralFunction.GetPaymentGalaStatus(go.PayStatus); if (go.PayStatus == StatuspaymentGalaOrder.Paid) { lbl.ForeColor = System.Drawing.Color.Green; } if (go.PayStatus == StatuspaymentGalaOrder.NotPaid) { lbl.ForeColor = System.Drawing.Color.Red; } // update payment lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnUpdatePayment"); lnkBtn.CommandArgument = go.Id.ToString(); if (go.PaymentMethod == PaymentType.PayPal) { lnkBtn.Visible = false; // dont show for PP } //// chkboxes //CheckBox chkbox = (CheckBox)e.Item.FindControl("chkbox"); //Security.SecureControlByHiding(chkbox); counter++; } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridEntry.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
protected void radGridJury_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Jury jury = (Jury)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; // Jury Id lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnJuryId"); lnkBtn.Text = jury.SerialNo; lnkBtn.CommandArgument = jury.Id.ToString(); // Jury Name lnk = (HyperLink)e.Item.FindControl("lnkJuryName"); lnk.Text = jury.FirstName + " " + jury.LastName; lnk.NavigateUrl = "mailto:" + jury.Email; lnk = (HyperLink)e.Item.FindControl("lnkPhoto"); string photo = ConfigurationManager.AppSettings["storagePhysicalPath"] + "JuryPhoto\\" + jury.Id.ToString() + ".jpg"; if (File.Exists(photo)) { lnk.NavigateUrl = "../Main/PhotoPreview.aspx?juryId=" + IptechLib.Crypto.StringEncryption(jury.Id.ToString()); lnk.Text = "View"; } lnk = (HyperLink)e.Item.FindControl("lnkProfile"); string profile = ConfigurationManager.AppSettings["storagePhysicalPath"] + "JuryProfile\\" + jury.SerialNo.ToString() + ".doc"; if (File.Exists(profile)) { lnk.NavigateUrl = ConfigurationManager.AppSettings["storageVirtualPath"] + "JuryProfile//" + jury.SerialNo.ToString() + ".doc"; lnk.Text = "View"; } string profile1 = ConfigurationManager.AppSettings["storagePhysicalPath"] + "JuryProfile\\" + jury.SerialNo.ToString() + ".docx"; if (File.Exists(profile1)) { lnk.NavigateUrl = ConfigurationManager.AppSettings["storageVirtualPath"] + "JuryProfile//" + jury.SerialNo.ToString() + ".docx"; lnk.Text = "View"; } lbl = (Label)e.Item.FindControl("lblJuryUpdateJudge"); lbl.Text = jury.DateJuryModified.Equals(DateTime.MaxValue) ? string.Empty : jury.DateJuryModified.ToString("dd/MM/yy"); lbl = (Label)e.Item.FindControl("lblJuryUpdateAdmin"); lbl.Text = jury.DateModified.Equals(DateTime.MaxValue) ? string.Empty : jury.DateModified.ToString("dd/MM/yy"); } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridJury.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }