protected void rgcandidate_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; //string CanditateName = (item["candidatename"].Controls[0] as TextBox).Text; LinkButton lnkDelete = (LinkButton)item.FindControl("lnkDelete"); Label lblcandidatename1 = (Label)item.FindControl("lblcandidatename1"); lnkDelete.OnClientClick = "javascript:return confirm('Are you sure, Do you want to delete " + lblcandidatename1.Text + "?');"; } if (e.Item is GridDataItem) { GridDataItem dataitem = (GridDataItem)e.Item; LinkButton lnkViewResume = (LinkButton)dataitem.FindControl("lnkViewResume"); if (lnkViewResume.CommandArgument == "null") { lnkViewResume.Visible = false; } } if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode) && (!e.Item.OwnerTableView.IsItemInserted)) { GridEditableItem edititem = (GridEditableItem)e.Item; edititem["jobid"].Enabled = false; edititem["candidatename"].Enabled = false; edititem["specialization"].Enabled = false; edititem["experience"].Enabled = false; RadComboBox rdhrStatus = (RadComboBox)edititem.FindControl("rcbstatus"); rdhrStatus.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[25].ToString(); RadComboBox rdfinalstatus = (RadComboBox)edititem.FindControl("rcbfinalstatus"); rdfinalstatus.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[27].ToString(); RadEditor rdnotes = (RadEditor)edititem.FindControl("rcbnotes"); rdnotes.Content = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[28].ToString(); } }
protected void rgcandidate_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataitem = (GridDataItem)e.Item; LinkButton lnkViewResume = (LinkButton)dataitem.FindControl("lnkViewResume"); if (lnkViewResume.CommandArgument == "null") { lnkViewResume.Visible = false; } } if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode) && (!e.Item.OwnerTableView.IsItemInserted)) { GridEditableItem edititem = (GridEditableItem)e.Item; edititem["jobid"].Enabled = false; edititem["candidatename"].Enabled = false; edititem["specialization"].Enabled = false; edititem["experience"].Enabled = false; RadComboBox rdhrStatus = (RadComboBox)edititem.FindControl("rcbstatus"); rdhrStatus.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[25].ToString(); RadComboBox rdfinalstatus = (RadComboBox)edititem.FindControl("rcbfinalstatus"); rdfinalstatus.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[27].ToString(); RadEditor rdnotes = (RadEditor)edititem.FindControl("rcbnotes"); rdnotes.Content = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[28].ToString(); } }
private void SetEditForm(object sender, GridItemEventArgs e) { GridItem griditem = e.Item as GridItem; if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode)) { GridEditFormItem editform = (GridEditFormItem)e.Item; RadEditor _radEditorQualDescription = editform.FindControl(RADEDITQUALDESCR) as RadEditor; RadComboBox _radComboQualID = (RadComboBox)editform.FindControl(RADCOMBOQUALID); Button _btnUpdate = (Button)editform.FindControl("btnUpdate"); if (griditem.DataItem is PositionCompetencyKSA) { PositionCompetencyKSA PDCompetencyKSA = griditem.DataItem as PositionCompetencyKSA; _radEditorQualDescription.Content = PDCompetencyKSA.CompetencyKSA; _radComboQualID.SelectedValue = PDCompetencyKSA.QualificationID.ToString(); } if (e.Item is GridEditFormInsertItem) { //if (_tdsearch != null) _tdsearch.Visible = true; ////BindKSACombo(_radComboKSA); if (_btnUpdate != null) { _btnUpdate.CommandName = RadGrid.PerformInsertCommandName; _btnUpdate.Text = "Add KSA"; } rgJADuty.ShowFooter = false; if (rgQual.Items.Count <= 0) { this.rgQual.MasterTableView.NoMasterRecordsText = ""; this.rgQual.MasterTableView.EnableNoRecordsTemplate = false; } } else { ////if (_tdsearch != null) _tdsearch.Visible = false; //if (_trksadd != null) _trksadd.Visible = false; if (_btnUpdate != null) { _btnUpdate.CommandName = RadGrid.UpdateCommandName; _btnUpdate.Text = "Save KSA"; } if (IsInView) { _radComboQualID.Enabled = false; _radcomboQualificationTypeID.Enabled = false; if (_btnUpdate != null) { _btnUpdate.Enabled = false; } } rgJADuty.ShowFooter = true; } } }
protected void cmdRefresh_Click(object sender, ImageClickEventArgs e) { usrMedCharting objusrMedCharting = (usrMedCharting)this.tabMedCharting.Tabs.FindTabFromKey("Chart").FindControl("usrMedCharting"); RadEditor KPIRadHuberActivityDetails = ((RadEditor)objusrMedCharting.FindControl("KPIRadHuberActivityDetails")); KPIRadHuberActivityDetails.Content = ""; Inquiry(); }
public static void SetImagesPath(RadEditor re) { string[] viewImages; string[] uploadImages; string[] deleteImages; viewImages = new string[] { ConfigurationManager.AppSettings["IMAGEURL"] }; uploadImages = new string[] { ConfigurationManager.AppSettings["IMAGEURL"] }; deleteImages = new string[] { ConfigurationManager.AppSettings["IMAGEURL"] }; re.ImageManager.ViewPaths = viewImages; re.ImageManager.UploadPaths = uploadImages; re.ImageManager.DeletePaths = deleteImages; }
protected void SetDocumentPath(RadEditor re) { string[] viewImages; string[] uploadImages; string[] deleteImages; viewImages = new string[] { ConfigurationManager.AppSettings["DOCUMENTURL"] }; uploadImages = new string[] { ConfigurationManager.AppSettings["DOCUMENTURL"] }; deleteImages = new string[] { ConfigurationManager.AppSettings["DOCUMENTURL"] }; re.DocumentManager.ViewPaths = viewImages; re.DocumentManager.UploadPaths = uploadImages; re.DocumentManager.DeletePaths = deleteImages; }
protected void LoadRadEditor(RadEditor editor) { editor.Skin = "Bootstrap"; editor.ImageManager.ViewPaths = new string[] { @"~/Documents/" + this.RequestId, @"~/Documents" }; editor.ImageManager.UploadPaths = new string[] { @"~/Documents/" + this.RequestId }; editor.ImageManager.DeletePaths = new string[] { @"~/Documents/" + this.RequestId }; editor.TemplateManager.ViewPaths = new string[] { @"~/Documents/" + this.RequestId, @"~/Documents/Templates" }; editor.TemplateManager.UploadPaths = new string[] { @"~/Documents/" + this.RequestId, @"~/Documents/Templates" }; editor.TemplateManager.DeletePaths = new string[] { @"~/Documents/" + this.RequestId, @"~/Documents/Templates" }; editor.DocumentManager.ViewPaths = new string[] { @"~/Documents/" + this.RequestId, @"~/Documents" }; editor.DocumentManager.UploadPaths = new string[] { @"~/Documents/" + this.RequestId }; editor.DocumentManager.DeletePaths = new string[] { @"~/Documents/" + this.RequestId }; }
protected void SetImagesPath(RadEditor re) { string[] viewImages; string[] uploadImages; string[] deleteImages; viewImages = new string[] { ConfigurationManager.AppSettings["IMAGEURL"] }; uploadImages = new string[] { ConfigurationManager.AppSettings["IMAGEURL"] }; deleteImages = new string[] { ConfigurationManager.AppSettings["IMAGEURL"] }; re.ImageManager.MaxUploadFileSize = 51048576; re.ImageManager.ViewPaths = viewImages; re.ImageManager.UploadPaths = uploadImages; re.ImageManager.DeletePaths = deleteImages; }
protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e) { GridEditableItem editedItem = e.Item as GridEditableItem; int ID_Val = Convert.ToInt32(editedItem.GetDataKeyValue("ID")); string RepsName_Val = (editedItem["RepsName"].Controls[0] as TextBox).Text; string ParentsName_Val = (editedItem["ParentsName"].Controls[0] as TextBox).Text; string Email_Val = (editedItem["Email"].Controls[0] as TextBox).Text; string InstagramUsername_Val = (editedItem["InstagramUsername"].Controls[0] as TextBox).Text; string RepsBirthday_Val = (editedItem["RepsBirthday"].Controls[0] as TextBox).Text; string PayPalEmail_Val = (editedItem["PayPalEmail"].Controls[0] as TextBox).Text; RadEditor editor = (RadEditor)editedItem.FindControl("txtRadGridRepsBioResume") as RadEditor; string RepsBioResume_Val = editor.Text; string HaveSmallShop_inter = "False"; if (!String.IsNullOrEmpty((editedItem["HaveSmallShop"].Controls[0] as TextBox).Text) && (editedItem["HaveSmallShop"].Controls[0] as TextBox).Text == "Yes") { HaveSmallShop_inter = "True"; } else { HaveSmallShop_inter = "False"; } bool HaveSmallShop_Val = Convert.ToBoolean(HaveSmallShop_inter); string SmallShopUsername_Val = (editedItem["SmallShopUsername"].Controls[0] as TextBox).Text; int HowHear_Val = App_Code.IGBrandRepReferralDO.GetHowHearID((editedItem["HowHearDesc"].Controls[0] as TextBox).Text); string WhatDoYouWant_Val = (editedItem["WhatDoYouWant"].Controls[0] as TextBox).Text; string HasPaid_inter = "False"; RadDropDownList HasPaidList = (RadDropDownList)editedItem.FindControl("ddlRadGridHasPaid") as RadDropDownList; if (!String.IsNullOrEmpty(HasPaidList.SelectedText) && (HasPaidList.SelectedText == "Yes")) { HasPaid_inter = "True"; } else { HasPaid_inter = "False"; } bool HasPaid_Val = Convert.ToBoolean(HasPaid_inter); string PayPalInvoiceNumber_Val = (editedItem["PayPalInvoiceNumber"].Controls[0] as TextBox).Text; RadEditor editor2 = (RadEditor)editedItem.FindControl("txtRadGridNotes") as RadEditor; string Notes_Val = editor2.Text; int RequestID = App_Code.IGBrandRepReferralDO.UpdateFeatureRequest(ID_Val, RepsName_Val, ParentsName_Val, Email_Val, InstagramUsername_Val, RepsBirthday_Val, PayPalEmail_Val, RepsBioResume_Val, HaveSmallShop_Val, SmallShopUsername_Val, HowHear_Val, WhatDoYouWant_Val, HasPaid_Val, PayPalInvoiceNumber_Val, Notes_Val); string submitMessage = "You have succussfully updated the record, you BEAUTIFUL WOMAN!! <3"; string script = "SuccessDialog(\" Update Successful! " + submitMessage + "\");"; ScriptManager.RegisterStartupScript(this, this.GetType(), "SaveProgram", script, true); }
protected void rgSANAL_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.IsInEditMode) { GridEditableItem item = (GridEditableItem)e.Item; int period_id = Convert.ToInt32(item.GetDataKeyValue("period_id")); var period = db.RecordAnalysisPeriods.FirstOrDefault(p => p.period_id == period_id); RadDropDownList rddlAnalyzedBy = (RadDropDownList)item.FindControl("rddlAnalyzedBy"); RadDatePicker rdpAnalyzedDt = (RadDatePicker)item.FindControl("rdpAnalyzedDt"); RadDropDownList rddlApprovedBy = (RadDropDownList)item.FindControl("rddlApprovedBy"); RadDatePicker rdpApprovedDt = (RadDatePicker)item.FindControl("rdpApprovedDt"); RadEditor reSANAL = (RadEditor)item.FindControl("reSANAL"); //Analyzer & Approver var personnel = db.SP_Personnel_by_WSC_office_or_user_id(period.Record.Site.Office.wsc_id, 0, "", "no", "All", "no"); rddlAnalyzedBy.DataSource = personnel; rddlAnalyzedBy.DataBind(); rddlApprovedBy.DataSource = personnel; rddlApprovedBy.DataBind(); if (!string.IsNullOrEmpty(period.analyzed_by)) { rddlAnalyzedBy.SelectedValue = period.analyzed_by; rdpAnalyzedDt.SelectedDate = period.analyzed_dt; } else { rddlAnalyzedBy.Items.Insert(0, new DropDownListItem { Value = "", Text = "" }); } if (!string.IsNullOrEmpty(period.approved_by)) { rddlApprovedBy.SelectedValue = period.approved_by; rdpApprovedDt.SelectedDate = period.approved_dt; } else { rddlApprovedBy.Items.Insert(0, new DropDownListItem { Value = "", Text = "" }); } reSANAL.Content = period.analysis_notes_va.FormatParagraphEdit(); } }
protected void rgcandidate_UpdateCommand(object sender, GridCommandEventArgs e) { GridEditableItem edititem = e.Item as GridEditableItem; _aid = Convert.ToInt32(edititem.GetDataKeyValue("Aid")); RadComboBox rdhrStatus = (RadComboBox)edititem.FindControl("rcbstatus"); _hrstatus = rdhrStatus.SelectedValue; RadComboBox rdfinalstatus = (RadComboBox)edititem.FindControl("rcbfinalstatus"); _finalstatus = rdfinalstatus.SelectedValue; RadEditor rdnotes = (RadEditor)edititem.FindControl("rcbnotes"); _notes = rdnotes.Content; objCandidateViewBAL.UpdateCandidateDetails(_aid, _hrstatus, _finalstatus, _notes); rgcandidate.Rebind(); }
protected void cmdPrint_Click(object sender, ImageClickEventArgs e) { try { PrintReport(); ClearData(); usrMedCharting objusrMedCharting = (usrMedCharting)this.tabMedCharting.Tabs.FindTabFromKey("Chart").FindControl("usrMedCharting"); RadEditor KPIRadHuberActivityDetails = ((RadEditor)objusrMedCharting.FindControl("KPIRadHuberActivityDetails")); KPIRadHuberActivityDetails.Content = ""; Inquiry(); } catch (Exception objErr) { ShowMsg(MsgType.Error, FrwkMsg.PAGE_ERR, objErr); } }
private void UpdatePDCompetencyKSAFactor(object source, GridCommandEventArgs e) { try { DateTime createDate = DateTime.Now; if (source is RadGrid) { GridEditFormItem gridItem = e.Item as GridEditFormItem; RadComboBox _radComboQualID = gridItem.FindControl(RADCOMBOQUALID) as RadComboBox; RadEditor _radEditorQualDescription = gridItem.FindControl(RADEDITQUALDESCR) as RadEditor; int competencyKSAID = int.Parse(gridItem.GetDataKeyValue("CompetencyKSAID").ToString()); if (competencyKSAID > -1) { PositionCompetencyKSA positionCompetency = new PositionCompetencyKSA(competencyKSAID); positionCompetency.KSAID = 0; //Other KSA positionCompetency.PositionDescriptionID = CurrentJNP.FullPDID; positionCompetency.CompetencyKSA = _radEditorQualDescription.Content; positionCompetency.Certification = String.Empty; positionCompetency.QualificationTypeID = (int)enumQualificationType.ConditionOfEmployment; positionCompetency.CreatedByID = CurrentUser.UserID; positionCompetency.CreateDate = createDate; positionCompetency.UpdatedByID = CurrentUser.UserID; positionCompetency.UpdateDate = createDate; positionCompetency.QualificationID = Convert.ToInt32(_radComboQualID.SelectedValue); //Don't want to overwrite the exsiting value with null //positionCompetency.AssociatedPDDutyID = null; JQFactor jqFactor = new JQFactor(Convert.ToInt32(CurrentJNP.JQID)); jqFactor.JQFactorTypeID = (int)enumJQFactorType.ConditionOfEmployment; jqFactor.KSAID = 0; //Other KSA jqFactor.IsSF = false; jqFactor.JQID = CurrentJNP.JQID; positionCompetency.UpdatePDCompetencyKSAFactor(positionCompetency, jqFactor); } } } catch (Exception ex) { base.HandleException(ex); } }
private void AddPDCompetencyKSAFactor(object source, GridCommandEventArgs e) { try { DateTime createDate = DateTime.Now; if (source is RadGrid) { GridEditFormInsertItem gridItem = e.Item as GridEditFormInsertItem; RadComboBox _radComboQualID = gridItem.FindControl(RADCOMBOQUALID) as RadComboBox; RadEditor _radEditorQualDescription = gridItem.FindControl(RADEDITQUALDESCR) as RadEditor; if (gridItem.ItemType == GridItemType.EditFormItem) { PositionCompetencyKSA positionCompetency = new PositionCompetencyKSA(); positionCompetency.CompetencyKSAID = -1; positionCompetency.KSAID = 0; //Other KSA positionCompetency.PositionDescriptionID = CurrentJNP.FullPDID; positionCompetency.CompetencyKSA = _radEditorQualDescription.Content; positionCompetency.Certification = String.Empty; positionCompetency.QualificationTypeID = (int)enumQualificationType.ConditionOfEmployment; positionCompetency.CreatedByID = CurrentUser.UserID; positionCompetency.CreateDate = createDate; positionCompetency.UpdatedByID = CurrentUser.UserID; positionCompetency.UpdateDate = createDate; positionCompetency.QualificationID = Convert.ToInt32(_radComboQualID.SelectedValue); positionCompetency.AssociatedPDDutyID = null; JQFactor jqFactor = new JQFactor(); jqFactor.JQFactorID = -1; jqFactor.JQFactorTypeID = (int)enumJQFactorType.ConditionOfEmployment; jqFactor.KSAID = 0; //Other KSA jqFactor.IsSF = false; jqFactor.JQID = CurrentJNP.JQID; positionCompetency.AddPDCompetencyKSAFactor(positionCompetency, jqFactor); } } } catch (Exception ex) { base.HandleException(ex); } }
public static void GetRadEditor(Control oMe, Oracle.DataAccess.Client.OracleConnection conn) { int cnt = oMe.Controls.Count; RadEditor cntrl = null; for (int i = 0; i < cnt; i++) { string s = oMe.Controls[i].GetType().ToString(); if ((oMe.Controls[i].GetType().ToString() == "Telerik.Web.UI.RadEditor")) { cntrl = (RadEditor)oMe.Controls[i]; SaveControl(cntrl.ID, "RadEditor", conn); } else if (oMe.Controls[i].HasControls()) { GetRadEditor(oMe.Controls[i], conn); } } }
private void AssignJADutyKSAFactorValues(JobAnalysisDutyKSAFactor jaDutyKSAFactor, GridCommandEventArgs e) { GridEditFormItem editform = (GridEditFormItem)e.Item; RadComboBox radcomboKSA = (RadComboBox)editform.FindControl("radcomboKSA"); RadEditor radEditorJAKSADescription = editform.FindControl("radEditorJAKSADescription") as RadEditor; RadComboBox radComboDutyQualID = (RadComboBox)editform.FindControl("radComboDutyQualID"); RadComboBox radcomboQualificationTypeID = (RadComboBox)editform.FindControl("radcomboQualificationTypeID"); var jqFactorTypeId = GetJQFactorTypeIdFromQualificationTypeId(int.Parse(radcomboQualificationTypeID.SelectedValue)); jaDutyKSAFactor.JADutyID = base.CurrentJADutyID; jaDutyKSAFactor.JQID = base.CurrentJQID; jaDutyKSAFactor.JQFactorTitle = radEditorJAKSADescription.Text; jaDutyKSAFactor.QualificationID = int.Parse(radComboDutyQualID.SelectedValue); jaDutyKSAFactor.QualificationTypeID = int.Parse(radcomboQualificationTypeID.SelectedValue); jaDutyKSAFactor.JQFactorTypeID = jqFactorTypeId; jaDutyKSAFactor.UpdatedByID = base.CurrentUserID; jaDutyKSAFactor.UpdateDate = DateTime.Now; if (e.CommandName == RadGrid.PerformInsertCommandName) { jaDutyKSAFactor.KSAID = long.Parse(radcomboKSA.SelectedValue); jaDutyKSAFactor.IsFinalKSA = (jqFactorTypeId == (int)enumJQFactorType.SelectiveFactor); jaDutyKSAFactor.ImportanceID = enumImportanceScale.None; jaDutyKSAFactor.NeedAtEntryID = enumNeedAtEntryScale.None; jaDutyKSAFactor.DistinguishingValueScaleID = enumDistinguishingValueScale.None; jaDutyKSAFactor.CreatedByID = base.CurrentUserID; jaDutyKSAFactor.CreateDate = DateTime.Now; } if (e.CommandName == RadGrid.UpdateCommandName) { if (System.Configuration.ConfigurationManager.AppSettings["ShowQualFactorInstructionButton"].ToString().ToLower() == "false") { jaDutyKSAFactor.JQFactorInstruction = radEditorJAKSADescription.Text; } } }
public static void ProcessEnableVisible(Page wpage, string control_name, string control_type, string control_state_status, int iAction) { if (control_type.Equals("TextBox")) { TextBox txt = Bas_Utility.Utilities.GetTextBox(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; txt.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: txt.Visible = false; break; } } } } return; } // --------------------------- Panel if (control_type.Equals("Panel")) { Panel pnl = Bas_Utility.Utilities.GetPanel(wpage, control_name); if (pnl != null) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: pnl.Enabled = true; break; case 2: pnl.Visible = true; break; } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: pnl.Enabled = false; pnl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: pnl.Visible = false; break; } } } } return; } // --------------------------- DropDownList if (control_type.Equals("DropDownList")) { DropDownList ddl = Bas_Utility.Utilities.GetDropDown(wpage, control_name); if (ddl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ddl.Enabled = true; break; case 2: ddl.Visible = true; break; } } } else { switch (iAction) { case 1: ddl.Enabled = false; ddl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ddl.Visible = false; break; } } } return; } // --------------------------- ListBox if (control_type.Equals("ListBox")) { ListBox ddl = Bas_Utility.Utilities.GetListBox(wpage, control_name); if (ddl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ddl.Enabled = true; break; case 2: ddl.Visible = true; break; } } } else { switch (iAction) { case 1: ddl.Enabled = false; ddl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ddl.Visible = false; break; } } } return; } // --------------------------- RadioButton if (control_type.Equals("RadioButton")) { RadioButton ddl = Bas_Utility.Utilities.GetRadioButton(wpage, control_name); if (ddl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ddl.Enabled = true; break; case 2: ddl.Visible = true; break; } } } else { switch (iAction) { case 1: ddl.Enabled = false; ddl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ddl.Visible = false; break; } } } return; } // --------------------------- CheckBoxList if (control_type.Equals("CheckBoxList")) { CheckBoxList ddl = Bas_Utility.Utilities.GetCheckBoxList(wpage, control_name); if (ddl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ddl.Enabled = true; break; case 2: ddl.Visible = true; break; } } } else { switch (iAction) { case 1: ddl.Enabled = false; ddl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ddl.Visible = false; break; } } } return; } // --------------------------- CheckBox if (control_type.Equals("CheckBox")) { CheckBox ddl = Bas_Utility.Utilities.GetCheckBox(wpage, control_name); if (ddl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ddl.Enabled = true; break; case 2: ddl.Visible = true; break; } } } else { switch (iAction) { case 1: ddl.Enabled = false; ddl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ddl.Visible = false; break; } } } return; } // --------------------------- LinkButton if (control_type.Equals("LinkButton")) { LinkButton cntrl = Bas_Utility.Utilities.GetLinkButton(wpage, control_name); if (cntrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: cntrl.Enabled = true; break; case 2: cntrl.Visible = true; break; } } } else { switch (iAction) { case 1: cntrl.Enabled = false; cntrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: cntrl.Visible = false; break; } } } return; } // --------------------------- LinkButton if (control_type.Equals("LinkButton")) { LinkButton cntrl = Bas_Utility.Utilities.GetLinkButton(wpage, control_name); if (cntrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: cntrl.Enabled = true; break; case 2: cntrl.Visible = true; break; } } } else { switch (iAction) { case 1: cntrl.Enabled = false; cntrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: cntrl.Visible = false; break; } } } return; } // --------------------------- ImageButton if (control_type.Equals("ImageButton")) { ImageButton cntrl = Bas_Utility.Utilities.GetImageButton(wpage, control_name); if (cntrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: cntrl.Enabled = true; break; case 2: cntrl.Visible = true; break; } } } else { switch (iAction) { case 1: cntrl.Enabled = false; cntrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: cntrl.Visible = false; break; } } } return; } // --------------------------- HyperLink if (control_type.Equals("HyperLink")) { HyperLink cntrl = Bas_Utility.Utilities.GetHyperLink(wpage, control_name); if (cntrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: cntrl.Enabled = true; break; case 2: cntrl.Visible = true; break; } } } else { switch (iAction) { case 1: cntrl.Enabled = false; cntrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: cntrl.Visible = false; break; } } } return; } // --------------------------- HyperLink if (control_type.Equals("HyperLink")) { HyperLink cntrl = Bas_Utility.Utilities.GetHyperLink(wpage, control_name); if (cntrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: cntrl.Enabled = true; break; case 2: cntrl.Visible = true; break; } } } else { switch (iAction) { case 1: cntrl.Enabled = false; cntrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: cntrl.Visible = false; break; } } } return; } // --------------------------- RadioButton if (control_type.Equals("RadioButton")) { RadioButton ctrl = Bas_Utility.Utilities.GetRadioButton(wpage, control_name); if (ctrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ctrl.Enabled = true; break; case 2: ctrl.Visible = true; break; } } } else { switch (iAction) { case 1: ctrl.Enabled = false; ctrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ctrl.Visible = false; break; } } } return; } // --------------------------- RadioButton if (control_type.Equals("RadioButton")) { RadioButton ctrl = Bas_Utility.Utilities.GetRadioButton(wpage, control_name); if (ctrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ctrl.Enabled = true; break; case 2: ctrl.Visible = true; break; } } } else { switch (iAction) { case 1: ctrl.Enabled = false; ctrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ctrl.Visible = false; break; } } } return; } // --------------------------- CheckBoxList if (control_type.Equals("CheckBoxList")) { CheckBoxList ctrl = Bas_Utility.Utilities.GetCheckBoxList(wpage, control_name); if (ctrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ctrl.Enabled = true; break; case 2: ctrl.Visible = true; break; } } } else { switch (iAction) { case 1: ctrl.Enabled = false; ctrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ctrl.Visible = false; break; } } } return; } // --------------------------- CheckBox if (control_type.Equals("CheckBox")) { CheckBox ctrl = Bas_Utility.Utilities.GetCheckBox(wpage, control_name); if (ctrl != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: ctrl.Enabled = true; break; case 2: ctrl.Visible = true; break; } } } else { switch (iAction) { case 1: ctrl.Enabled = false; ctrl.BackColor = System.Drawing.Color.FromName("ffffcc"); break; case 2: ctrl.Visible = false; break; } } } return; } // --------------------------- RadMaskedTextBox if (control_type.Equals("RadMaskedTextBox")) { RadMaskedTextBox txt = Bas_Utility.Utilities.GetRadMaskedTextBox(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; break; case 2: txt.Visible = false; break; } } } } return; } // --------------------------- RadTextBox if (control_type.Equals("RadTextBox")) { RadTextBox txt = Bas_Utility.Utilities.GetRadTextBox(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; break; case 2: txt.Visible = false; break; } } } } return; } // --------------------------- RadComboBox if (control_type.Equals("RadComboBox")) { RadComboBox txt = Bas_Utility.Utilities.GetRadComboBox(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; break; case 2: txt.Visible = false; break; } } } } return; } // --------------------------- RadDateInput if (control_type.Equals("RadDateInput")) { RadDateInput txt = Bas_Utility.Utilities.GetRadDateInput(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; break; case 2: txt.Visible = false; break; } } } } return; } // --------------------------- RadDatePicker if (control_type.Equals("RadDatePicker")) { RadDatePicker txt = Bas_Utility.Utilities.GetRadDatePicker(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; break; case 2: txt.Visible = false; break; } } } } return; } // --------------------------- RadEditor if (control_type.Equals("RadEditor")) { RadEditor txt = Bas_Utility.Utilities.GetRadEditor(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; break; case 2: txt.Visible = false; break; } } } } return; } // --------------------------- RadMaskedTextBox if (control_type.Equals("RadMaskedTextBox")) { RadMaskedTextBox txt = Bas_Utility.Utilities.GetRadMaskedTextBox(wpage, control_name); if (txt != null) { if (control_state_status.Equals("1")) { if (control_state_status.Equals("1")) { switch (iAction) { case 1: txt.Enabled = true; break; case 2: txt.Visible = true; break; } } } else { if (control_state_status.Equals("0")) { switch (iAction) { case 1: txt.Enabled = false; break; case 2: txt.Visible = false; break; } } } } return; } }
/// <summary> /// Binds the data. /// </summary> public override void BindData() { base.BindData(); tbl_SiteActivityRules siteActivityRule = null; if (!IsEditMode) { siteActivityRule = DataManager.SiteActivityRules.SelectById(CurrentForm); } else if (EditObjectId.HasValue) { siteActivityRule = DataManager.SiteActivityRules.SelectById(EditObjectId.Value); txtFormTitleRequiredFieldValidator.ValidationGroup = "groupEdit"; } else { return; } if (siteActivityRule == null) { return; } var siteActivityRuleLayouts = siteActivityRule.tbl_SiteActivityRuleLayout.Where(o => !string.IsNullOrEmpty(o.LayoutParams)).OrderBy(o => o.Order); txtFormTitle.Text = siteActivityRule.Name; txtTextButton.Text = siteActivityRule.TextButton; foreach (var activityRuleLayout in siteActivityRuleLayouts) { var layoutParams = LayoutParams.Deserialize(activityRuleLayout.LayoutParams); if (!string.IsNullOrEmpty(layoutParams.GetValue("ShowInMaster"))) { var panel = new Panel() { CssClass = "row" }; var label = new HtmlGenericControl { TagName = "label", InnerText = string.Format("{0}:", activityRuleLayout.Name) }; panel.Controls.Add(label); switch ((ShowTextBlockInMaster)int.Parse(layoutParams.GetValue("ShowInMaster"))) { case ShowTextBlockInMaster.Text: var textBox = new TextBox() { ID = activityRuleLayout.ID.ToString(), CssClass = "area-text", TextMode = TextBoxMode.MultiLine, Height = new Unit(30, UnitType.Pixel), Width = new Unit(689, UnitType.Pixel) }; textBox.Text = activityRuleLayout.Description; panel.Controls.Add(textBox); break; case ShowTextBlockInMaster.HTML: panel.CssClass = "row-html-editor clearfix"; panel.Attributes.Add("style", "margin-bottom:10px"); var htmlEditor = new RadEditor() { ID = activityRuleLayout.ID.ToString(), EnableResize = false, ToolsFile = "~/RadEditor/Tools.xml", CssClass = "rad-editor", AutoResizeHeight = false, Width = new Unit(700, UnitType.Pixel), Height = new Unit(130, UnitType.Pixel), Skin = "Windows7", ContentAreaMode = EditorContentAreaMode.Iframe }; htmlEditor.Content = activityRuleLayout.Description; panel.Controls.Add(htmlEditor); break; } plTextBlocksContainer.Controls.Add(panel); } } }
protected void rgjobs_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e) { try { GridEditableItem edititem = e.Item as GridEditableItem; RadComboBox rcbCountry = (RadComboBox)edititem.FindControl("rcbCountry"); RadComboBox rcbState = (RadComboBox)edititem.FindControl("rcbState"); RadComboBox rcbCity = (RadComboBox)edititem.FindControl("rcbCity"); RadComboBox rcbFacility = (RadComboBox)edititem.FindControl("rcbfacility"); RadComboBox rcbSpeciality = (RadComboBox)edititem.FindControl("rcbspeciality"); CheckBox chkVisibilty = (CheckBox)edititem.FindControl("chkVisibilty"); RadEditor rddescription = (RadEditor)edititem.FindControl("rddescription"); _jid = Convert.ToInt32(edititem.GetDataKeyValue("Jid")); if (rcbSpeciality.SelectedValue == "--Select--") { ShowPopUpMsg("Please Select Speciality"); } else if (rcbFacility.SelectedValue == "--Select--") { ShowPopUpMsg("Please Select Facility"); } else if (rcbCountry.SelectedValue == "--Select--") { ShowPopUpMsg("Please Select Country"); } else if (rcbState.Items.Count > 1 && rcbState.SelectedItem.Value == "--Select--") { ShowPopUpMsg("Please Select State"); } else if (rcbCity.Items.Count > 1 && rcbCity.SelectedValue == "--Select--") { ShowPopUpMsg("Please Select City"); } else { _jobid = (edititem["jobid"].FindControl("rtbJobId") as RadTextBox).Text.Trim(); _jobtitle = (edititem["jobtitle"].FindControl("rtbJobTitle") as RadTextBox).Text.Trim(); if (_jobtitle == string.Empty) { ShowPopUpMsg("Please Enter JobTitle"); } else { //_countryid =Convert.ToInt32(rcbCountry.SelectedValue); //if (rcbState.Items.Count > 0) //{ // _stateid = Convert.ToInt32(rcbState.SelectedItem.Value); //} //else //{ // _stateid = -1; //} if (rcbCity.Items.Count > 1) { _cityid = Convert.ToInt32(rcbCity.SelectedValue); } else { _cityid = Convert.ToInt32(rcbState.SelectedItem.Value.ToString().Substring(rcbState.SelectedItem.Value.ToString().IndexOf("-") + 1)); } _facilityid = Convert.ToInt32(rcbFacility.SelectedValue); _specialityid = Convert.ToInt32(rcbSpeciality.SelectedValue); _visibility = chkVisibilty.Checked; _description = rddescription.Content; if (Session["SignInOrganizationId"] != null) { _clientid = Convert.ToInt32(Session["SignInOrganizationId"].ToString()); } if (Session["SignInId"] != null) { _whoupdated = Session["SignInId"].ToString(); } _whocreated = string.Empty; objJobsBAL.InsertUpdateJob(_jobid, _jobtitle, _facilityid, _specialityid, _cityid, _description, _visibility, _clientid, _whocreated, _whoupdated); rgjobs.Rebind(); } } } catch { e.Canceled = 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 IntialEdittor(RadEditor txtEdittor) { txtEdittor.EditModes = EditModes.Design; txtEdittor.Modules.Clear(); }
private void GetText() { RadEditor RadEditor1 = Bas_Utility.Utilities.GetRadEditor(Page, "RadEditor1"); RadEditor1.Content = Data.GetText(session_id, "1"); }
public void SetTelerikEditorOptions_Min(RadEditor ctrl) { ctrl.ToolsFile = "~/blogfiles/ToolsFile_Min.xml"; ctrl.DisableFilter(EditorFilters.FixEnclosingP); ctrl.ContentAreaCssFile = "/blogfiles/assets/css/editorstyle.css"; ctrl.CssFiles.Add("/blogfiles/assets/css/editorclasses.css"); }
protected void rgjobs_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem item = (GridDataItem)e.Item; LinkButton lnkDelete = (LinkButton)item.FindControl("lnkDelete"); Label lblJobId = (Label)item.FindControl("lblJobId"); lnkDelete.OnClientClick = "javascript:return confirm('Are you sure you want to delete Job Id " + lblJobId.Text + "?');"; } if (e.Item is GridEditFormInsertItem) { GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item; if (Session["SignInOrganizationId"] != null) { _clientid = Convert.ToInt32(Session["SignInOrganizationId"].ToString()); } // Facility RadComboBox ddlfacility = (RadComboBox)item.FindControl("rcbfacility"); DataSet dsfacility = objJobsBAL.FacilitySelectByClientIDVisible(_clientid); if (dsfacility.Tables.Count > 0 && dsfacility.Tables[0].Rows.Count > 0) { ddlfacility.DataSource = dsfacility; ddlfacility.DataTextField = "Facility"; ddlfacility.DataValueField = "FacId"; ddlfacility.DataBind(); } RadComboBoxItem asfacilityListItem = new RadComboBoxItem("--Select--", "--Select--"); ddlfacility.Items.Insert(0, asfacilityListItem); // Speciality RadComboBox ddlspeciality = (RadComboBox)item.FindControl("rcbspeciality"); DataSet dsspeciality = objJobsBAL.SpecialitySelectByClientIDVisible(_clientid); if (dsspeciality.Tables.Count > 0 && dsspeciality.Tables[0].Rows.Count > 0) { ddlspeciality.DataSource = dsspeciality; ddlspeciality.DataTextField = "Speciality"; ddlspeciality.DataValueField = "SpcId"; ddlspeciality.DataBind(); } RadComboBoxItem asspecialityListItem = new RadComboBoxItem("--Select--", "--Select--"); ddlspeciality.Items.Insert(0, asspecialityListItem); // Country RadComboBox ddlcountry = (RadComboBox)item.FindControl("rcbCountry"); DataSet dscountry = objJobsBAL.CountrySelectInStateByClientIDVisible(_clientid); if (dscountry.Tables.Count > 0 && dscountry.Tables[0].Rows.Count > 0) { ddlcountry.DataSource = dscountry; ddlcountry.DataTextField = "CountryName"; ddlcountry.DataValueField = "CountryId"; ddlcountry.DataBind(); } RadComboBoxItem ascountryListItem = new RadComboBoxItem("--Select--", "--Select--"); ddlcountry.Items.Insert(0, ascountryListItem); RadComboBox rdState = (RadComboBox)item.FindControl("rcbState"); RadComboBoxItem asstateListItem = new RadComboBoxItem("--Select--", "--Select--"); rdState.Items.Insert(0, asstateListItem); RadComboBox rdCity = (RadComboBox)item.FindControl("rcbCity"); RadComboBoxItem ascityListItem = new RadComboBoxItem("--Select--", "--Select--"); rdCity.Items.Insert(0, ascityListItem); } if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode) && (!e.Item.OwnerTableView.IsItemInserted)) { GridEditableItem edititem = (GridEditableItem)e.Item; edititem["jobid"].Enabled = false; RadComboBox ddlcountry = (RadComboBox)edititem.FindControl("rcbCountry"); // Country DataSet dscountry = objJobsBAL.CountrySelectInStateByClientIDVisible(_clientid); if (dscountry.Tables.Count > 0 && dscountry.Tables[0].Rows.Count > 0) { ddlcountry.DataSource = dscountry; ddlcountry.DataTextField = "CountryName"; ddlcountry.DataValueField = "CountryId"; ddlcountry.DataBind(); } else { ddlcountry.DataSource = null; ddlcountry.DataBind(); } RadComboBoxItem ascountryListItem = new RadComboBoxItem("--Select--", "--Select--"); ddlcountry.Items.Insert(0, ascountryListItem); ddlcountry.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[7].ToString(); // Facility RadComboBox ddlfacility = (RadComboBox)edititem.FindControl("rcbfacility"); DataSet dsfacility = objJobsBAL.FacilitySelectByClientIDVisible(_clientid); if (dsfacility.Tables.Count > 0 && dsfacility.Tables[0].Rows.Count > 0) { ddlfacility.DataSource = dsfacility; ddlfacility.DataTextField = "Facility"; ddlfacility.DataValueField = "FacId"; ddlfacility.DataBind(); } RadComboBoxItem asfacilityListItem = new RadComboBoxItem("--Select--", "--Select--"); ddlfacility.Items.Insert(0, asfacilityListItem); ddlfacility.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[3].ToString(); // Speciality RadComboBox ddlspeciality = (RadComboBox)edititem.FindControl("rcbspeciality"); DataSet dsspeciality = objJobsBAL.SpecialitySelectByClientIDVisible(_clientid); if (dsspeciality.Tables.Count > 0 && dsspeciality.Tables[0].Rows.Count > 0) { ddlspeciality.DataSource = dsspeciality; ddlspeciality.DataTextField = "Speciality"; ddlspeciality.DataValueField = "SpcId"; ddlspeciality.DataBind(); } RadComboBoxItem asspecialityListItem = new RadComboBoxItem("--Select--", "--Select--"); ddlspeciality.Items.Insert(0, asspecialityListItem); ddlspeciality.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[5].ToString(); // State RadComboBox rdState = (RadComboBox)edititem.FindControl("rcbState"); if (Session["SignInOrganizationId"] != null) { _clientid = Convert.ToInt32(Session["SignInOrganizationId"].ToString()); } _countryid = Convert.ToInt32(ddlcountry.SelectedValue); rdState.Items.Clear(); DataSet dsstate = objJobsBAL.StateSelectInStateByClientIDVisibleByAdmin(_clientid, _countryid); if (dsstate.Tables.Count > 0 && dsstate.Tables[0].Rows.Count > 0) { rdState.DataSource = dsstate; rdState.DataTextField = "StateName"; rdState.DataValueField = "StateId"; rdState.DataBind(); RadComboBoxItem asstateListItem = new RadComboBoxItem("--Select--", "--Select--"); rdState.Items.Insert(0, asstateListItem); rdState.Items.FindItemByText(((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[10].ToString()).Selected = true; } else { rdState.DataSource = null; rdState.DataBind(); RadComboBoxItem asstateListItem = new RadComboBoxItem("--Select--", "--Select--"); rdState.Items.Insert(0, asstateListItem); } if (rdState.SelectedValue.ToString().Contains("-")) { rdState.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[9].ToString() + "-" + ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[21].ToString(); } else { rdState.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[9].ToString(); } RadComboBox rdCity = (RadComboBox)edititem.FindControl("rcbCity"); if (Session["SignInOrganizationId"] != null) { _clientid = Convert.ToInt32(Session["SignInOrganizationId"].ToString()); } _countryid = Convert.ToInt32(ddlcountry.SelectedValue); if (rdState.Items.Count > 1) { if (rdState.SelectedItem.Value.ToString().Contains("-")) { _stateid = Convert.ToInt32(rdState.SelectedItem.Value.ToString().Substring(0, rdState.SelectedItem.Value.ToString().IndexOf("-"))); } else { _stateid = Convert.ToInt32(rdState.SelectedItem.Value); } edititem["State"].Parent.Visible = true; } else { _stateid = -1; edititem["State"].Parent.Visible = false; } rdCity.Items.Clear(); DataSet dscity = objJobsBAL.CitySelectByClientIDCountryStateIDVisibleByAdmin(_clientid, _countryid, _stateid); if (dscity.Tables.Count > 0 && dscity.Tables[0].Rows.Count > 0) { rdCity.DataSource = dscity; rdCity.DataTextField = "CityName"; rdCity.DataValueField = "Lid"; rdCity.DataBind(); RadComboBoxItem ascityListItem = new RadComboBoxItem("--Select--", "--Select--"); rdCity.Items.Insert(0, ascityListItem); } else { rdCity.DataSource = null; rdCity.DataBind(); RadComboBoxItem ascityListItem = new RadComboBoxItem("--Select--", "--Select--"); rdCity.Items.Insert(0, ascityListItem); edititem["city"].Parent.Visible = false; } rdCity.SelectedValue = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[21].ToString(); RadEditor rddescription = (RadEditor)edititem.FindControl("rddescription"); rddescription.Content = ((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[13].ToString(); CheckBox chkVisibilty = (CheckBox)edititem.FindControl("chkVisibilty"); if (((System.Data.DataRowView)(edititem.DataItem)).Row.ItemArray[14].ToString() == "True") { chkVisibilty.Checked = true; } else { chkVisibilty.Checked = false; } } if (e.Item is GridDataItem) { GridDataItem dataitem = (GridDataItem)e.Item; Label lbvisibility = (Label)dataitem.FindControl("lbvisibility"); Image imgVisibility = (Image)dataitem.FindControl("imgVisibility"); if (lbvisibility.Text == "True") { imgVisibility.ImageUrl = "../ImagesNew/Jobs/green-tick-mark.gif"; } else { imgVisibility.ImageUrl = "../ImagesNew/Jobs/red_x_mark.png"; } } }
private void Page_Load(object sender, System.EventArgs e) { if (this.IsPostBack) { string oValue = EditorContent.Value; string doctype = EditorDoctype.Value != string.Empty ? EditorDoctype.Value : "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"; RadEditor editor = new RadEditor(); editor.Html = oValue; try { oValue = editor.Xhtml; } catch (Exception) { } // Ektron Editor starts string content = ""; if ("" == EditorDoctype.Value)// { Disclaimer.InnerText = ""; string editorcontent = EditorContent.Value.ToLower(); if (editorcontent.IndexOf("<li>") > -1) { content = EditorContent.Value; } else //editorcontent is an empty html with HTML and BODY tags. { content = "<html><body> The content is valid. </body></html>"; } } else if ("reportresult=" == EditorDoctype.Value.Substring(0,13)) { string baseHRef = EditorDoctype.Value.Substring(13); if (baseHRef.Substring(0, 4).ToLower() != "http") { baseHRef = "http://" + baseHRef; } content = oValue; content = content.Replace("</head>", "<base href=\"" + baseHRef + "\"/> </head>"); } else { content = "<html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <title>Validation Content</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" + "</head> <body> " + oValue + " </body></html>"; HTTPSend oSend; string myStr; string myStrLower; string name = ""; string onlineId = ""; string src = ""; string baseHRef = ""; string docTypeSpec = ""; string xmlPath = new Uri(Request.Url, "../../../../ContentDesigner/ValidateSpec.xml").AbsoluteUri; XmlTextReader reader = new XmlTextReader(xmlPath); XmlDocument docxml = new XmlDocument(); docxml.Load(reader); XmlNodeList xmlnode = docxml.GetElementsByTagName("online"); for (int i = 0; i < xmlnode.Count; i++) { // get all the attributes from the ValidateSpec.xml XmlAttributeCollection xmlattrc = xmlnode[i].Attributes; for (int j = 0; j < xmlattrc.Count; j++) { switch (xmlattrc[j].Name) { case "id": onlineId = xmlattrc[j].Value; break; case "name": name = xmlattrc[j].Value; break; case "src": src = xmlattrc[j].Value; break; case "site": baseHRef = xmlattrc[j].Value; if (baseHRef.Substring(0, 4).ToLower() != "http") { baseHRef = "http://" + baseHRef; } break; case "doctype": docTypeSpec = "<" + xmlattrc[j].Value.Replace("&qout;", "\"") + ">"; docTypeSpec = docTypeSpec.Replace("<>", ""); break; default: break; } } // if the current validation is the one selected, post the page. if (doctype == onlineId || doctype == docTypeSpec) { oSend = new HTTPSend(src); for (int k = 0; k < xmlnode[i].ChildNodes.Count; k++) { XmlAttributeCollection xmlchildattrc = xmlnode[i].ChildNodes[k].Attributes; oSend.SetField(xmlchildattrc[0].Value, xmlnode[i].ChildNodes[k].InnerText); } content = docTypeSpec + content; oSend.SendTextAsFile(content, "RadEditorContent.html"); myStr = oSend.ResponseText.ToString(); myStrLower = myStr.ToLower(); if (myStrLower.IndexOf("</head>") > -1) { content = myStr.Replace("</head>", "<base href=\"" + baseHRef + "\" /> </head>"); } sBaseTag.Text = "<base href=\"" + baseHRef + "\" />"; Disclaimer.InnerHtml = "<b>Note: This module uses " + baseHRef + " to validate content for Accessibility compliance.</b>"; } } } Disclaimer.Visible = true; divReportPane.InnerHtml = content; // Ektron Editor ends } }
public void SetTelerikEditorOptions(RadEditor ctrl) { String[] imgsPath = { "/blogfiles/assets/images" }; String[] docsPath = { "/blogfiles/assets/documents" }; String[] imgPatterns = { "*.jpg", "*.jpeg", "*.gif", "*.png" }; String[] docPatterns = { "*.pdf", "*.doc", "*.docx", "*.xls", "*.xlsx", "*.txt", "*.htm", "*.html" }; ctrl.ToolsFile = "~/blogfiles/ToolsFile.xml"; ctrl.DisableFilter(EditorFilters.FixEnclosingP); ctrl.ImageManager.EnableImageEditor = true; ctrl.ImageManager.DeletePaths = imgsPath; ctrl.ImageManager.ViewPaths = imgsPath; ctrl.ImageManager.UploadPaths = imgsPath; ctrl.ImageManager.MaxUploadFileSize = 6144000; ctrl.ImageManager.SearchPatterns = imgPatterns; ctrl.DocumentManager.DeletePaths = docsPath; ctrl.DocumentManager.ViewPaths = docsPath; ctrl.DocumentManager.UploadPaths = docsPath; ctrl.DocumentManager.MaxUploadFileSize = 6144000; ctrl.DocumentManager.SearchPatterns = docPatterns; ctrl.ContentAreaCssFile = "/blogfiles/assets/css/editorstyle.css"; ctrl.CssFiles.Add("/blogfiles/assets/css/editorclasses.css"); ctrl.DialogHandlerUrl = "/Telerik.Web.UI.DialogHandler.axd"; ctrl.SpellCheckSettings.AjaxUrl = "/Telerik.Web.UI.SpellCheckHandler.axd"; }
protected void rgjobs_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item; _jid = 0; RadComboBox rcbCountry = (RadComboBox)item.FindControl("rcbCountry"); RadComboBox rcbState = (RadComboBox)item.FindControl("rcbState"); RadComboBox rcbCity = (RadComboBox)item.FindControl("rcbCity"); RadComboBox rcbFacility = (RadComboBox)item.FindControl("rcbfacility"); RadComboBox rcbSpeciality = (RadComboBox)item.FindControl("rcbspeciality"); RadEditor rddescription = (RadEditor)item.FindControl("rddescription"); if (rcbFacility.SelectedItem.Value == "--Select--") { ShowPopUpMsg("Please Select Facility"); } else if (rcbCountry.SelectedItem.Value == "--Select--") { ShowPopUpMsg("Please Select Country"); } else if (rcbState.Items.Count > 0 && rcbState.SelectedItem.Value == "--Select--") { ShowPopUpMsg("Please Select State"); } else if (rcbCity.Items.Count > 1 && rcbCity.SelectedItem.Value == "--Select--") { ShowPopUpMsg("Please Select City"); } else if (rcbSpeciality.SelectedItem.Value == "--Select--") { ShowPopUpMsg("Please Select Speciality"); } else { _jobid = (item["jobid"].FindControl("rtbJobId") as RadTextBox).Text.Trim(); _jobtitle = (item["jobtitle"].FindControl("rtbJobTitle") as RadTextBox).Text.Trim(); if (_jobid == string.Empty) { ShowPopUpMsg("Please Enter JobID"); } else if (_jobtitle == string.Empty) { ShowPopUpMsg("Please Enter JobTitle"); } else { _facilityid = Convert.ToInt32(rcbFacility.SelectedValue); _specialityid = Convert.ToInt32(rcbSpeciality.SelectedValue); _countryid = Convert.ToInt32(rcbCountry.SelectedValue); //if (rcbState.Items.Count > 0) //{ // _stateid = Convert.ToInt32(rcbState.SelectedItem.Value); //} //else //{ // _stateid = -1; //} if (rcbCity.Items.Count > 1) { _cityid = Convert.ToInt32(rcbCity.SelectedValue); } else { _cityid = Convert.ToInt32(rcbState.SelectedValue.ToString().Substring(rcbState.SelectedValue.ToString().IndexOf("-") + 1)); } //_cityid = Convert.ToInt32(rcbCity.SelectedValue); _description = rddescription.Content; CheckBox chkVisibilty = (CheckBox)item.FindControl("chkVisibilty"); _visibility = chkVisibilty.Checked; if (Session["SignInOrganizationId"] != null) { _clientid = Convert.ToInt32(Session["SignInOrganizationId"].ToString()); } if (Session["SignInId"] != null) { _whocreated = Session["SignInId"].ToString(); } _whoupdated = string.Empty; DataSet ds = objJobsBAL.SelectJobByJobId(_jobid, _clientid); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { ShowPopUpMsg("Job already exists"); } else { objJobsBAL.InsertUpdateJob(_jobid, _jobtitle, _facilityid, _specialityid, _cityid, _description, _visibility, _clientid, _whocreated, _whoupdated); rgjobs.Rebind(); } } } }