コード例 #1
0
ファイル: AllProducts.ascx.cs プロジェクト: HedinRakot/KVS
        // public void cmbCustomerProducts_OnLoad(object sender, EventArgs e)
        public void cmbCustomerProducts_OnLoad(RadComboBox Box)
        {
            using (DataClasses1DataContext dbContext = new DataClasses1DataContext())
            {
                try
                {
                    if (Session["editableProductId"] != null && !String.IsNullOrEmpty(Session["editableProductId"].ToString()))
                    {
                        string myProductId = Session["editableProductId"].ToString();
                        Box.Visible = true;

                        var myCustomers = from cust in dbContext.Customer
                                          join lCust in dbContext.LargeCustomer on cust.Id equals lCust.CustomerId
                                          orderby cust.Name ascending
                                          select new
                                          {
                                              CustomerId = cust.Id,
                                              CustomerName = String.IsNullOrEmpty(cust.MatchCode) ? cust.Name : cust.Name + "(" + cust.MatchCode + ")",
                                              IsChecked = dbContext.CustomerProduct.SingleOrDefault(q => q.ProductId == Int32.Parse(myProductId) && q.CustomerId == cust.Id) != null ? true : false
                                          };

                        Box.DataSource = myCustomers;
                        Box.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    dbContext.WriteLogItem("Product Error " + ex.Message, LogTypes.ERROR, "Product");
                    throw new Exception(ex.Message);
                }
            }
        }
コード例 #2
0
        void cargarcentros()
        {
            List<capascccmex.metadatos.centro> oCamposCat = new List<capascccmex.metadatos.centro>();
            capascccmex.biz.centro obj = new capascccmex.biz.centro();
            Dictionary<Int64?, string> dcat = new Dictionary<Int64?, string>();

            RadComboBox cmbcat = (RadComboBox)RadPanelBar1.FindItemByValue("info").FindControl("cmbcentro");
            try
            {
                oCamposCat = obj.GetBizCentro(null, 0, 0);
                //----------------------------------------
                foreach (var item in oCamposCat)
                {
                    dcat.Add(convertir.toNInt64(item.IdCentro), (string)item.Centro);
                }

                cmbcat.DataSource = dcat;
                cmbcat.DataTextField = "Value";
                cmbcat.DataValueField = "Key";
                cmbcat.DataBind();

            }
            catch (SqlException ex)
            {
                windowManager1.RadAlert("Error: " + ex.Message.ToString(), 300, 100, "Cargando información de centros", null);
            }
        }
コード例 #3
0
        protected void RadGrid2_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
            {
                GridEditableItem editedItem = e.Item as GridEditableItem;
                RadComboBox      ddlmarkets = editedItem.FindControl("ddlmarket") as RadComboBox;

                ddlmarkets.DataSource     = Bitcoin_Notify_DB.SPs.ViewMarketsAll().GetDataSet().Tables[0];
                ddlmarkets.DataTextField  = "market_shortname";
                ddlmarkets.DataValueField = "market_key";
                ddlmarkets.DataBind();

                //assign the card group
                if (editedItem is GridEditFormInsertItem) //is edit, and not insert
                {
                }
                else
                {
                    string strgroupkey = editedItem.GetDataKeyValue("market_key").ToString();
                    if (strgroupkey.Length > 0)
                    {
                        ddlmarkets.SelectedValue = strgroupkey;
                    }
                }
            }
        }
コード例 #4
0
        private void Despacho_Cargar(string idAgenda, RadComboBox cboBox)
        {
            DireccionWCFClient objDireccionWCF;

            try
            {
                objDireccionWCF = new DireccionWCFClient();

                var datasource = from x in objDireccionWCF.Direccion_ListarCliente(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                                                   ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idAgenda)
                                 select new
                {
                    x.ID,
                    DisplayField = String.Format("{0} {1} {2} {3}", x.Abreviatura, x.Direccion, x.Numero, x.Distrito)
                };

                cboBox.DataSource     = datasource;
                cboBox.DataValueField = "ID";
                cboBox.DataTextField  = "DisplayField";
                cboBox.DataBind();

                //if (cboDespacho.Items.Count > 0)
                //    cboDespacho.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        void loadcmbsEstatus(RadComboBox telerik, int tipo)
        {
            try
            {
                Dictionary <char, string> dcat = new Dictionary <char, string>();

                if (tipo == 1)
                {
                    dcat.Add('N', "Sin Revisar");
                    dcat.Add('S', "Revisado - No se puede modificar");
                    dcat.Add('T', "En trámite");
                    dcat.Add('C', "Cancelado");
                }
                else
                {
                    dcat.Add('A', "Aceptado");
                    dcat.Add('P', "Pendiente");
                }

                telerik.DataSource     = dcat;
                telerik.DataTextField  = "Value";
                telerik.DataValueField = "Key";
                telerik.DataBind();
            }
            catch (Exception ex)
            {
                RadWindowManager1.RadAlert("Error: " + ex.Message.ToString(), 300, 100, "Cargando instalaciones", null);
            }
        }
コード例 #6
0
        private void llenar_Periodos()
        {
            RadComboBox cmb_año     = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_año") as RadComboBox;
            RadComboBox cmb_periodo = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_periodo") as RadComboBox;
            RadComboBox cmb_mes     = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_mes") as RadComboBox;


            Conexion  oCoon    = new Conexion();
            DataTable dtp      = null;
            int       Report   = Convert.ToInt32(this.Session["Reporte"]);
            string    canal    = this.Session["Canal"].ToString().Trim();
            int       icompany = Convert.ToInt32(this.Session["companyid"]);

            dtp = oCoon.ejecutarDataTable("UP_WEBXPLORA_CLIE_V2_OBTENERPERIODOS_2", canal, icompany, Report, cmb_mes.SelectedValue, cmb_año.SelectedValue);
            if (dtp.Rows.Count > 0)
            {
                cmb_periodo.DataSource     = dtp;
                cmb_periodo.DataValueField = "id_periodo";
                cmb_periodo.DataTextField  = "Periodo";
                cmb_periodo.DataBind();

                cmb_periodo.Items.Insert(0, new RadComboBoxItem("--Todos--", "0"));
            }
            else
            {
                dtp = null;
                cmb_periodo.Items.Insert(0, new RadComboBoxItem("--Todos--", "0"));
            }
        }
コード例 #7
0
 private void BindCombo(DataTable theDT, string theTextField, string theValueField, DropDownList theDropDown = null, RadComboBox theComboBox = null)
 {
     DataRow[] DR = theDT.Select("" + theValueField + " = 0");
     if (DR.Length < 1)
     {
         DataRow theDR = theDT.NewRow();
         theDR["" + theTextField + ""]  = "Select";
         theDR["" + theValueField + ""] = 0;
         theDT.Rows.InsertAt(theDR, 0);
     }
     if (theDropDown != null)
     {
         theDropDown.DataSource     = theDT;
         theDropDown.DataTextField  = theTextField;
         theDropDown.DataValueField = theValueField;
         theDropDown.DataBind();
         //john start
         //if (theDropDown.Items.Count == 2)
         //{
         //    if (theDropDown.Items[0].Text == "Select")
         //        theDropDown.SelectedIndex = 1;
         //}
         //end
     }
     else
     {
         theComboBox.DataSource     = theDT;
         theComboBox.DataTextField  = theTextField;
         theComboBox.DataValueField = theValueField;
         theComboBox.DataBind();
     }
 }
コード例 #8
0
        protected void trolleyclass_type_RadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox      combobox = (RadComboBox)sender;
            GridEditFormItem edititem = (GridEditFormItem)combobox.NamingContainer;


            if (combobox.SelectedValue == "3")
            {
                // trolley type drop down
                TrolleyDAO trolleydao   = new TrolleyDAO();
                DataSet    trolleyCodes = new DataSet();
                trolleyCodes = trolleydao.GetCodesByType();
                RadComboBox trolleytype = (RadComboBox)edititem
                                          .FindControl("trolleytype_RadComboBox");

                trolleytype.DataSource     = trolleyCodes.Tables["TT"];
                trolleytype.DataTextField  = "type_short_name";
                trolleytype.DataValueField = "type_id";
                trolleytype.DataBind();
                trolleytype.Items.Insert(0, new RadComboBoxItem("", "0"));
                trolleytype.Visible = true;

                RequiredFieldValidator RequiredFieldValidator2 = (RequiredFieldValidator)edititem
                                                                 .FindControl("RequiredFieldValidator2");

                RequiredFieldValidator2.Enabled = true;
            }
            else
            {
                RadComboBox trolleytype = (RadComboBox)edititem
                                          .FindControl("trolleytype_RadComboBox");

                trolleytype.Visible = false;
            }
        }
コード例 #9
0
 protected void RadGridPatients_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
 {
     // form template is in insert mode
     if (e.Item is GridEditFormInsertItem && RadGridPatients.MasterTableView.IsItemInserted)
     {
         RadComboBox cmbCities = e.Item.FindControl("cmbCities") as RadComboBox;
         cmbCities.DataSource = getCities();
         cmbCities.DataBind();
         RadComboBox cmbNationalities = e.Item.FindControl("cmbNationalities") as RadComboBox;
         cmbNationalities.DataSource = getNationalities();
         cmbNationalities.DataBind();
         Panel patientPasswordPanel = e.Item.FindControl("patientPasswordPanel") as Panel;
         patientPasswordPanel.Visible = false;
     }
     else
     if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
     {
         RadComboBox cmbCities = e.Item.FindControl("cmbCities") as RadComboBox;
         cmbCities.DataSource = getCities();
         cmbCities.DataBind();
         RadComboBox cmbNationalities = e.Item.FindControl("cmbNationalities") as RadComboBox;
         cmbNationalities.DataSource = getNationalities();
         cmbNationalities.DataBind();
         CheckBox         chkActive = e.Item.FindControl("chkActive") as CheckBox;
         GridEditableItem dataItem  = e.Item as GridEditableItem;
         int PatientId = Convert.ToInt32(dataItem.GetDataKeyValue("patientId"));
         chkActive.Checked = db.Patients.Where(p => p.id == PatientId).Any(p => p.Sec_Users.IsActive == true);
         GridEditableItem editItem      = e.Item as GridEditableItem;
         string           patientCityID = editItem.GetDataKeyValue("patientCityID").ToString();
         cmbCities.SelectedValue        = editItem.GetDataKeyValue("patientCityID").ToString();
         cmbNationalities.SelectedValue = editItem.GetDataKeyValue("patientnatid").ToString();
     }
 }
コード例 #10
0
        protected void rgCoordinacion_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                if (!e.Item.GetType().Name.Equals("GridEditFormInsertItem"))
                {
                    BE_COORDINACION editableItem   = ((BE_COORDINACION)e.Item.DataItem);
                    RadComboBox     rcbTempEmpresa = (RadComboBox)e.Item.FindControl("rcbEmpresa");
                    if (rcbTempEmpresa != null)
                    {
                        rcbTempEmpresa.SelectedValue = editableItem.oBE_EMPRESA.ID.ToString();
                    }
                    RadComboBox rcbTempGerencia = (RadComboBox)e.Item.FindControl("rcbGerencia");
                    if (rcbTempGerencia != null)
                    {
                        this.odsGerencia.SelectParameters.Clear();
                        this.odsGerencia.SelectParameters.Add("empresa_id", System.Data.DbType.Guid, rcbTempEmpresa.SelectedValue);

                        rcbTempGerencia.DataBind();

                        rcbTempGerencia.SelectedValue = editableItem.oBE_GERENCIA.ID.ToString();
                    }
                    RadComboBox rcbTempArea = (RadComboBox)e.Item.FindControl("rcbArea");
                    if (rcbTempArea != null)
                    {
                        this.odsArea.SelectParameters.Clear();
                        this.odsArea.SelectParameters.Add("gerencia_id", System.Data.DbType.Guid, rcbTempGerencia.SelectedValue);

                        rcbTempArea.DataBind();

                        rcbTempArea.SelectedValue = editableItem.AREA_ID.ToString();
                    }
                }
            }
        }
コード例 #11
0
        protected void PopulateStatusList(object sender, string publicationTypeId)
        {
            RadComboBox rcbPublicationStatus = (RadComboBox)sender;

            rcbPublicationStatus.Items.Clear();
            rcbPublicationStatus.Items.Insert(0, new RadComboBoxItem("Выберите значение", Guid.Empty.ToString()));
            Guid gTypeId;

            if (Guid.TryParse(publicationTypeId, out gTypeId))
            {
                var publicationStatuses = DataManager.PublicationStatus.SelectByPublicationTypeID(gTypeId);
                foreach (var publicationStatus in publicationStatuses)
                {
                    rcbPublicationStatus.Items.Add(new RadComboBoxItem(publicationStatus.Title, publicationStatus.ID.ToString()));
                    if (publicationStatus.isFirst != null && (bool)publicationStatus.isFirst)
                    {
                        rcbPublicationStatus.SelectedIndex =
                            rcbPublicationStatus.FindItemIndexByValue(publicationStatus.ID.ToString());
                        rcbPublicationStatus.SelectedValue = publicationStatus.ID.ToString();
                        rcbPublicationStatus.Text          = publicationStatus.Title;
                    }
                }
                rcbPublicationStatus.DataBind();
            }
        }
コード例 #12
0
 private void BindCombo(DataTable theDT, string theTextField, string theValueField, DropDownList theDropDown = null, RadComboBox theComboBox = null)
 {
     theDropDown.Items.Clear();
     DataRow[] DR = theDT.Select("" + theValueField + " = 0");
     if (DR.Length < 1)
     {
         DataRow theDR = theDT.NewRow();
         theDR["" + theTextField + ""]  = "Select";
         theDR["" + theValueField + ""] = 0;
         theDT.Rows.InsertAt(theDR, 0);
     }
     if (theDropDown != null)
     {
         theDropDown.DataSource     = theDT;
         theDropDown.DataTextField  = theTextField;
         theDropDown.DataValueField = theValueField;
         theDropDown.DataBind();
     }
     else
     {
         theComboBox.DataSource     = theDT;
         theComboBox.DataTextField  = theTextField;
         theComboBox.DataValueField = theValueField;
         theComboBox.DataBind();
     }
 }
コード例 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    RadComboBox cmb_periodo = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_periodo") as RadComboBox;
                    RadComboBox cmb_año     = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_año") as RadComboBox;
                    RadComboBox cmb_mes     = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_mes") as RadComboBox;

                    cmb_año.DataBind();
                    cmb_año.Items.Insert(0, new RadComboBoxItem("--Todos--", "0"));
                    cmb_mes.DataBind();
                    cmb_mes.Items.Insert(0, new RadComboBoxItem("--Todos--", "0"));
                    cmb_periodo.DataBind();
                    cmb_periodo.Items.Insert(0, new RadComboBoxItem("--Todos--", "0"));

                    cargarMenu();
                    llenar_Años();
                    llenar_Meses();

                    llenargrilla1("", "");
                }
                catch (Exception ex)
                {
                    Exception mensaje = ex;
                    this.Session.Abandon();
                    //Response.Redirect("~/err_mensaje_seccion.aspx", true);
                }
            }
        }
コード例 #14
0
        /****************************************/

        /*********** LOAD DATASOURCE *****************/
        public void Load_DataSource_RadComboBox(RadComboBox _cbb)
        {
            _cbb.DataSource     = this.All.ToList();
            _cbb.DataTextField  = "DTTen";
            _cbb.DataValueField = "DTID";
            _cbb.DataBind();
        }
コード例 #15
0
 private void BindCountryDropDown(List <CountryElement> countries, RadComboBox countryRadComboBox)
 {
     countryRadComboBox.DataSource     = countries;
     countryRadComboBox.DataTextField  = "Name";
     countryRadComboBox.DataValueField = "IsoCode";
     countryRadComboBox.DataBind();
 }
コード例 #16
0
    private void AssignvaluesToUserControl(DataTable dt)
    {
        try
        {
            RadComboBox RadBusinessUnit = (RadComboBox)BU1.FindControl("RadBusinessUnit");
            RadBusinessUnit.DataSource     = dt;
            RadBusinessUnit.DataTextField  = "BUSINESSUNIT_CODE";
            RadBusinessUnit.DataValueField = "BUSINESSUNIT_ID";
            RadBusinessUnit.DataBind();

            RadComboBox RadDirectorate = (RadComboBox)BU1.FindControl("RadDirectorate");
            RadDirectorate.DataSource     = dt;
            RadDirectorate.DataTextField  = "DIRECTORATE_CODE";
            RadDirectorate.DataValueField = "DIRECTORATE_ID";
            RadDirectorate.DataBind();

            RadComboBox RadDepartment = (RadComboBox)BU1.FindControl("RadDepartment");
            RadDepartment.DataSource     = dt;
            RadDepartment.DataTextField  = "DEPARTMENT_NAME";
            RadDepartment.DataValueField = "DEPARTMENT_ID";
            RadDepartment.DataBind();

            RadComboBox RadEmployee = (RadComboBox)BU1.FindControl("RadEmployee");
            RadEmployee.DataSource     = dt;
            RadEmployee.DataTextField  = "EMPLOYEENAME";
            RadEmployee.DataValueField = "AVC_EMPID";
            RadEmployee.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_AVC", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
コード例 #17
0
 // LOAD DATASOURCE
 public void Load_AllChucVu_RadComboBox(RadComboBox _cbb)
 {
     _cbb.DataSource     = this.All.ToList();
     _cbb.DataTextField  = "CVTen";
     _cbb.DataValueField = "CVID";
     _cbb.DataBind();
 }
コード例 #18
0
 public void CargaDropTodos(object nombreDrop, string value, string text, DataTable dt)
 {
     if (nombreDrop.GetType() == typeof(DropDownList))
     {
         DropDownList drop = (DropDownList)nombreDrop;
         drop.DataSource     = dt;
         drop.DataValueField = value;
         drop.DataTextField  = text;
         drop.DataBind();
         ListItem li = new ListItem("Todos...", "0");
         drop.Items.Insert(0, li);
         drop.ClearSelection();
     }
     if (nombreDrop.GetType() == typeof(RadComboBox))
     {
         RadComboBox drop = (RadComboBox)nombreDrop;
         drop.DataSource     = dt;
         drop.DataValueField = value;
         drop.DataTextField  = text;
         drop.DataBind();
         RadComboBoxItem li = new RadComboBoxItem("Todos...", "0");
         drop.Items.Insert(0, li);
         drop.ClearSelection();
         drop.SelectedIndex = 0;
     }
 }
コード例 #19
0
 public void Load_AllAccount_ToRadComboBox(RadComboBox _cbb)
 {
     _cbb.DataSource     = this.All.ToList();
     _cbb.DataTextField  = "ACCEmail";
     _cbb.DataValueField = "ACCID";
     _cbb.DataBind();
 }
コード例 #20
0
        protected void rcbGerencia_SelectedIndexChanged(object sender, EventArgs e)
        {
            RadComboBox rcbTempGerencia     = (RadComboBox)sender;
            String      selected            = rcbTempGerencia.SelectedValue;
            RadComboBox rcbTempArea         = (RadComboBox)rcbTempGerencia.NamingContainer.FindControl("rcbArea");
            RadComboBox rcbTempCoordinacion = (RadComboBox)rcbTempGerencia.NamingContainer.FindControl("rcbCoordinacion");
            RadComboBox rcbTempPuesto       = (RadComboBox)rcbTempGerencia.NamingContainer.FindControl("rcbPuesto");

            rcbTempArea.ClearSelection();
            rcbTempPuesto.ClearSelection();
            rcbTempCoordinacion.ClearSelection();

            this.odsArea.SelectParameters.Clear();
            this.odsArea.SelectParameters.Add("gerencia_id", System.Data.DbType.Guid, selected);
            rcbTempArea.DataBind();

            this.odsCoordinacion.SelectParameters.Clear();
            this.odsCoordinacion.SelectParameters.Add("area_id", System.Data.DbType.Guid, rcbTempArea.SelectedValue);
            rcbTempCoordinacion.DataBind();

            this.odsPuesto.SelectParameters.Clear();
            this.odsPuesto.SelectParameters.Add("empresa_id", System.Data.DbType.Guid, Guid.Empty.ToString());
            this.odsPuesto.SelectParameters.Add("gerencia_id", System.Data.DbType.Guid, rcbTempGerencia.SelectedValue);
            rcbTempPuesto.DataBind();
        }
コード例 #21
0
 // LOAD DATASOURCE
 public void Load_DataSource_ComboBox(RadComboBox _comboBox)
 {
     _comboBox.DataSource     = this.All.ToList();
     _comboBox.DataValueField = "HSLID";
     _comboBox.DataTextField  = "HSLHeSo";
     _comboBox.DataBind();
 }
コード例 #22
0
        public static void FillCurrencyDDL(RadComboBox ddl, string defaultCode, bool displayLong)
        {
            // fill dropdown list with standard currency codes
            if (displayLong)
            {
                ddl.DataSource     = SessionManager.CurrencyList.OrderBy(l => l.CURRENCY_NAME);
                ddl.DataTextField  = "CURRENCY_NAME";
                ddl.DataValueField = "CURRENCY_CODE";
                ddl.DataBind();
            }
            else
            {
                foreach (CURRENCY cur in SessionManager.CurrencyList.OrderBy(l => l.CURRENCY_CODE))
                {
                    RadComboBoxItem item = new RadComboBoxItem(cur.CURRENCY_CODE, cur.CURRENCY_CODE);
                    item.ToolTip = cur.CURRENCY_NAME;
                    ddl.Items.Add(item);
                }
            }

            if (!string.IsNullOrEmpty(defaultCode))
            {
                ddl.SelectedValue = defaultCode;
            }
        }
コード例 #23
0
 protected void gvWERPFI_ItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridFilteringItem && e.Item.ItemIndex == -1)
     {
         DataTable         dtgvWERPFI    = new DataTable();
         GridFilteringItem filterItem    = (GridFilteringItem)e.Item;
         RadComboBox       RadComboBoxRR = (RadComboBox)filterItem.FindControl("RadComboBoxRR");
         dsRejectedRecords = (DataSet)Cache["RejectedFixedIncomeDetails" + adviserVo.advisorId.ToString()];
         DataTable dtcustMIS = new DataTable();
         dtgvWERPFI = dsRejectedRecords.Tables[0];
         dtcustMIS.Columns.Add("WRR_RejectReasonDescription");
         dtcustMIS.Columns.Add("RejectReasonCode");
         DataRow drcustMIS;
         foreach (DataRow dr in dtgvWERPFI.Rows)
         {
             drcustMIS = dtcustMIS.NewRow();
             drcustMIS["WRR_RejectReasonDescription"] = dr["WRR_RejectReasonDescription"].ToString();
             drcustMIS["RejectReasonCode"]            = dr["RejectReasonCode"].ToString();
             dtcustMIS.Rows.Add(drcustMIS);
         }
         DataView  view           = new DataView(dtgvWERPFI);
         DataTable distinctValues = view.ToTable(true, "WRR_RejectReasonDescription", "RejectReasonCode");
         RadComboBoxRR.DataSource     = distinctValues;
         RadComboBoxRR.DataValueField = dtcustMIS.Columns["RejectReasonCode"].ToString();
         RadComboBoxRR.DataTextField  = dtcustMIS.Columns["WRR_RejectReasonDescription"].ToString();
         RadComboBoxRR.DataBind();
     }
 }
コード例 #24
0
        //private gsGuiaVenta_ListarxOPResult GuiaVenta_ObtenerCambios()
        //{
        //    gsGuiaVenta_ListarxOPResult objGuiaVentasFlujo;
        //    try
        //    {
        //        objGuiaVentasFlujo = new gsGuiaVenta_ListarxOPResult();

        //        objGuiaVentasFlujo.id_agenda = lblCodigoCliente.Value;
        //        objGuiaVentasFlujo.ID_AgendaDireccion = int.Parse(cboFacturacionCliente.SelectedValue);
        //        objGuiaVentasFlujo.ID_AgendaDireccion2 = int.Parse(cboDespacho.SelectedValue);

        //        objGuiaVentasFlujo.DireccionOrigenAgenda = lblCodigoOrigen.Value;
        //        objGuiaVentasFlujo.DireccionOrigenSucursal = int.Parse(cboSucursalOrigen.SelectedValue);
        //        objGuiaVentasFlujo.DireccionOrigenReferencia = int.Parse(cboReferenciaOrigen.SelectedValue);
        //        objGuiaVentasFlujo.DireccionOrigenDireccion = int.Parse(cboFacturacionOrigen.SelectedValue);

        //        objGuiaVentasFlujo.DireccionDestinoAgenda = lblCodigoDestino.Value;
        //        objGuiaVentasFlujo.DireccionDestinoSucursal = int.Parse(cboSucursalDestino.SelectedValue);
        //        objGuiaVentasFlujo.DireccionDestinoReferencia = int.Parse(cboReferenciaDestino.SelectedValue);
        //        objGuiaVentasFlujo.DireccionDestinoDireccion = int.Parse(cboFacturacionDestino.SelectedValue);

        //        objGuiaVentasFlujo.ID_Transportista = lblCodigoTransportista.Value;

        //        objGuiaVentasFlujo.ID_Chofer = txtIDChofer.Text;
        //        objGuiaVentasFlujo.TransportistaChofer = txtChofer.Text;
        //        objGuiaVentasFlujo.TransportistaCertInscripcion = txtCertificado.Text;
        //        objGuiaVentasFlujo.TransportistaLicencia = txtLicencia.Text;
        //        objGuiaVentasFlujo.TransportistaMarca = txtVehiculoMarca.Text;

        //        objGuiaVentasFlujo.ID_Vehiculo  = txtVehiculoPlaca.Text;
        //        objGuiaVentasFlujo.TransportistaModelo = txtVehiculoModelo.Text;
        //        objGuiaVentasFlujo.TransportistaPlaca = txtVehiculoPlaca.Text;
        //        objGuiaVentasFlujo.TransportistaRUC = txtRUCTransporte.Text;

        //        objGuiaVentasFlujo.FechaDespacho = dpFechaDespacho.SelectedDate.Value;
        //        objGuiaVentasFlujo.FechaTraslado = dpFechaTraslado.SelectedDate.Value;
        //        objGuiaVentasFlujo.FechaEmision = dpFechaEmision.SelectedDate.Value;

        //        return objGuiaVentasFlujo;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        private void Referencia_Cargar(string idAgenda, int idSucursal, RadComboBox cbobox)
        {
            AgendaWCFClient       objAgendaWCF;
            VBG02699Result        objReferencia;
            List <VBG02699Result> lstReferencias;

            try
            {
                objAgendaWCF         = new AgendaWCFClient();
                objReferencia        = new VBG02699Result();
                objReferencia.ID     = -1;
                objReferencia.Nombre = "Ninguno";

                lstReferencias = objAgendaWCF.AgendaAnexoReferencia_ListarPorSucursal(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                                                      ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idSucursal, idAgenda).ToList();
                lstReferencias.Insert(0, objReferencia);

                cbobox.DataSource     = lstReferencias;
                cbobox.DataTextField  = "Nombre";
                cbobox.DataValueField = "ID";
                cbobox.DataBind();

                if (cbobox.Items.Count > 0)
                {
                    cbobox.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #25
0
        //private void Despacho_CargarTipo()
        //{
        //    DespachoWCFClient objDespachoWVF;
        //    try
        //    {
        //        objDespachoWVF = new DespachoWCFClient();
        //        cboOpDespacho.DataSource = objDespachoWVF.Despacho_ListarTipo(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
        //            ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario);
        //        cboOpDespacho.DataTextField = "Nombre";
        //        cboOpDespacho.DataValueField = "ID";
        //        cboOpDespacho.DataBind();

        //        if (cboOpDespacho.Items.Count > 0)
        //            cboOpDespacho.SelectedIndex = 0;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        //private void GuiaVentasFlujo_CargarTipo()
        //{
        //    GuiaVentasFlujoWCFClient objGuiaVentasFlujoWCF;
        //    try
        //    {
        //        objGuiaVentasFlujoWCF = new GuiaVentasFlujoWCFClient();
        //        cboOpTipoGuiaVentasFlujo.DataSource = objGuiaVentasFlujoWCF.GuiaVentasFlujo_ListarTipo(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
        //            ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario);
        //        cboOpTipoGuiaVentasFlujo.DataTextField = "Nombre";
        //        cboOpTipoGuiaVentasFlujo.DataValueField = "ID";
        //        cboOpTipoGuiaVentasFlujo.DataBind();

        //        if (cboOpTipoGuiaVentasFlujo.Items.Count > 0)
        //            cboOpTipoGuiaVentasFlujo.SelectedIndex = 0;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        //private void Documento_CagarTipoVenta()
        //{
        //    DocumentoWCFClient objDocumentoWCF;
        //    try
        //    {
        //        objDocumentoWCF = new DocumentoWCFClient();
        //        cboOpDocVenta.DataSource = objDocumentoWCF.Documento_ListarDocVenta(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
        //            ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario);
        //        cboOpDocVenta.DataTextField = "Nombre";
        //        cboOpDocVenta.DataValueField = "ID";
        //        cboOpDocVenta.DataBind();

        //        if (cboOpDocVenta.Items.Count > 0)
        //            cboOpDocVenta.SelectedIndex = 0;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        //private void Almacen_Cargar()
        //{
        //    AgendaWCFClient objAgendaWCF;
        //    try
        //    {
        //        objAgendaWCF = new AgendaWCFClient();
        //        cboAlmacen.DataSource = objAgendaWCF.AgendaAnexo_ListarAlmacen(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario);
        //        cboAlmacen.DataTextField = "AlmacenAnexo";
        //        cboAlmacen.DataValueField = "ID_AlmacenAnexo";
        //        cboAlmacen.DataBind();

        //        if (cboAlmacen.Items.Count > 0)
        //            cboAlmacen.SelectedIndex = 0;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        //private void Credito_Cargar(string idAgenda)
        //{
        //    CreditoWCFClient objCreditoWCF;
        //    try
        //    {
        //        objCreditoWCF = new CreditoWCFClient();

        //        var datasource = from x in objCreditoWCF.Credito_ListarCondicion(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
        //            ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idAgenda)
        //                         select new
        //                         {
        //                             ValueField = String.Format("{0},{1}", x.ID_CondicionCredito, x.DiasCredito),
        //                             TextField = String.Format("{0}", x.Nombre)
        //                         };

        //        cboTipoCredito.DataSource = datasource;
        //        cboTipoCredito.DataTextField = "TextField";
        //        cboTipoCredito.DataValueField = "ValueField";
        //        cboTipoCredito.DataBind();

        //        if (cboTipoCredito.Items.Count > 0)
        //        {
        //            cboTipoCredito.SelectedIndex = 0;
        //            txtDiasCredito.Text = cboTipoCredito.SelectedValue.Split(',')[1];
        //            dpFechaEmision.SelectedDate = DateTime.Now;
        //            dpFechaVencimiento.SelectedDate = DateTime.Now.AddDays(Int32.Parse(txtDiasCredito.Text));
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        //private void Envio_Cargar()
        //{
        //    EnvioWCFClient objEnvioWCF;
        //    try
        //    {
        //        objEnvioWCF = new EnvioWCFClient();

        //        cboTipoEnvio.DataSource = objEnvioWCF.Envio_ListarTipo(((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario);
        //        cboTipoEnvio.DataTextField = "Nombre";
        //        cboTipoEnvio.DataValueField = "ID";
        //        cboTipoEnvio.DataBind();

        //        if (cboTipoEnvio.Items.Count > 0)
        //            cboTipoEnvio.SelectedValue = "2";
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        //private void Sede_Cagar()
        //{
        //    SedeWCFClient objSedeWCF;
        //    VBG02689Result objSede;
        //    List<VBG02689Result> lstSedes;
        //    try
        //    {
        //        objSedeWCF = new SedeWCFClient();
        //        objSede = new VBG02689Result();
        //        objSede.Nombre = "Ninguno";
        //        objSede.ID_Sede = -1;

        //        lstSedes = objSedeWCF.RRHHSede_Listar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario).ToList();
        //        lstSedes.Insert(0, objSede);
        //        cboSede.DataSource = lstSedes;
        //        cboSede.DataTextField = "Nombre";
        //        cboSede.DataValueField = "ID_Sede";
        //        cboSede.DataBind();

        //        if (cboSede.Items.Count > 0)
        //            cboSede.SelectedIndex = 0;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}

        private void Sucursal_Cargar(string idAgenda, RadComboBox cbobox)
        {
            AgendaWCFClient       objAgendaWCFC;
            List <VBG00167Result> lstSucursal;
            VBG00167Result        objSucursal;

            try
            {
                objAgendaWCFC = new AgendaWCFClient();
                objSucursal   = new VBG00167Result();

                lstSucursal        = objAgendaWCFC.AgendaAnexo_ListarDireccionCliente(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idAgenda).ToList();
                objSucursal.ID     = -1;
                objSucursal.Nombre = "Central";
                lstSucursal.Insert(0, objSucursal);

                cbobox.DataSource     = lstSucursal;
                cbobox.DataTextField  = "Nombre";
                cbobox.DataValueField = "ID";
                cbobox.DataBind();

                if (cbobox.Items.Count > 0)
                {
                    cbobox.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #26
0
        private void Direccion_Cargar(string idAgenda, RadComboBox cbobox)
        {
            DireccionWCFClient objDireccionWCF;

            try
            {
                objDireccionWCF = new DireccionWCFClient();

                var dirFiscal = from x in objDireccionWCF.Direccion_ListarCliente(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                                                  ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idAgenda).ToList().FindAll(x => x.TipoDireccion == 104)
                                select new
                {
                    x.ID,
                    DisplayField = String.Format("{0} {1} {2} {3}", x.Abreviatura, x.Direccion, x.Numero, x.Distrito)
                };

                cbobox.DataSource     = dirFiscal;
                cbobox.DataValueField = "ID";
                cbobox.DataTextField  = "DisplayField";
                cbobox.DataBind();

                if (cbobox.Items.Count > 0)
                {
                    cbobox.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void gvAutoSIPReject_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridFilteringItem && e.Item.ItemIndex == -1)
            {
                DataTable         dtgvWERPSIP   = new DataTable();
                GridFilteringItem filterItem    = (GridFilteringItem)e.Item;
                RadComboBox       RadComboBoxRR = (RadComboBox)filterItem.FindControl("RadComboBoxRR");

                dsRejectedSIP = (DataSet)Cache["RejectedAutoSIPDetails" + adviserVo.advisorId.ToString()];
                DataTable dtSIP = new DataTable();
                dtgvWERPSIP = dsRejectedSIP.Tables[0];
                dtSIP.Columns.Add("WRR_RejectReasonDescription");
                dtSIP.Columns.Add("WRR_RejectReasonCode");
                DataRow drSIP;
                foreach (DataRow dr in dtgvWERPSIP.Rows)
                {
                    drSIP = dtSIP.NewRow();
                    drSIP["WRR_RejectReasonDescription"] = dr["WRR_RejectReasonDescription"].ToString();
                    drSIP["WRR_RejectReasonCode"]        = int.Parse(dr["WRR_RejectReasonCode"].ToString());
                    dtSIP.Rows.Add(drSIP);
                }
                DataView  view           = new DataView(dtgvWERPSIP);
                DataTable distinctValues = view.ToTable(true, "WRR_RejectReasonDescription", "WRR_RejectReasonCode");
                RadComboBoxRR.DataSource     = distinctValues;
                RadComboBoxRR.DataValueField = dtSIP.Columns["WRR_RejectReasonCode"].ToString();
                RadComboBoxRR.DataTextField  = dtSIP.Columns["WRR_RejectReasonDescription"].ToString();
                RadComboBoxRR.DataBind();
            }
        }
コード例 #28
0
 public static void bind_combobox(RadComboBox _obj, Int32 _id)
 {
     _obj.DataSource     = dL.Talk.List(_id);
     _obj.DataTextField  = "title";
     _obj.DataValueField = "talkid";
     _obj.DataBind();
 }
コード例 #29
0
        protected void cargarCadena()
        {
            RadComboBox cmb_cobertura = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cobertura") as RadComboBox;
            RadComboBox cmb_cadena    = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_cadena") as RadComboBox;
            RadComboBox cmb_ciudad    = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("cmb_ciudad") as RadComboBox;
            Label       lbl_cadena    = RadPanelBar_menu.FindChildByValue <RadPanelItem>("filtro").FindControl("lbl_cadena") as Label;

            cmb_cadena.Visible = false;
            lbl_cadena.Visible = false;

            DataTable dt = null;

            iservicio  = Convert.ToInt32(this.Session["Service"]);
            iidcompany = Convert.ToInt32(this.Session["companyid"].ToString());
            sidcanal   = this.Session["Canal"].ToString();

            if (cmb_cobertura.SelectedValue == "1" || cmb_ciudad.SelectedIndex > 0)
            {
                cmb_cadena.Visible = true;
                lbl_cadena.Visible = true;
                if (cmb_cobertura.SelectedValue == "1")
                {
                    cmb_ciudad.SelectedValue = "9";
                }
            }
            dt = oCoon.ejecutarDataTable("UP_WEBXPLORA_AD_OBTENER_NODECOMERCIAL_BY_cod_oficina", iservicio, sidcanal, iidcompany, cmb_ciudad.SelectedValue);

            cmb_cadena.DataSource     = dt;
            cmb_cadena.DataValueField = "id_NodeCommercial";
            cmb_cadena.DataTextField  = "commercialNodeName";
            cmb_cadena.DataBind();

            cmb_cadena.Items.Insert(0, new RadComboBoxItem("--Todas--", "0"));
        }
コード例 #30
0
 // set form input controls for insert/update
 protected void gvDayType_ItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
     {
         if (e.Item.OwnerTableView.DataMember == "DayTypeMaster")
         {
             ValidateDayType(e);
         }
     }
     if (e.Item is GridCommandItem)
     {
         GridCommandItem commandItem     = (GridCommandItem)e.Item;
         RadComboBox     ddlPrintOptions = (RadComboBox)commandItem.FindControl("ddlPrintOptions");
         if (ddlPrintOptions != null)
         {
             Hashtable ht_Reports = new Hashtable();
             ht_Reports.Add("@userid", Session["_UserID"].ToString());
             ht_Reports.Add("@formtypeid", Request.QueryString["FormType"]);
             DataTable dt_Reports = clsDAL.GetDataSet_admin("sp_Payroll_Get_Reports", ht_Reports).Tables[0];
             if (ddlPrintOptions != null)
             {
                 ddlPrintOptions.DataSource     = dt_Reports;
                 ddlPrintOptions.DataTextField  = "reportname";
                 ddlPrintOptions.DataValueField = "idd";
                 ddlPrintOptions.DataBind();
                 ddlPrintOptions.SelectedIndex = 0;
             }
         }
     }
 }
コード例 #31
0
    /// <summary>
    /// When edit button is clicked, the RadComboBoc of the selected row is intitalised.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        // Bind AutoComplete values for Manager Column
        if (e.Item is GridEditableItem)
        {
            GridDataItem  gdi = e.Item as GridDataItem;
            GridTableCell gdc = gdi["ManagerNameUnique"] as GridTableCell;

            RadComboBox ManagerCB = (RadComboBox)gdc.FindControl("ManagerRadComboBox");
            if (ManagerCB != null)
            {
                ManagerCB.DataSource = (from r in (Session["data"] as EmployeeDataContract).Employees
                                        select r.Name).ToList <string>();
                ManagerCB.DataBind();

                // Initialize the ComboBox with the already selected text.
                if (Session["ManagerInLabel"] != null)
                {
                    ManagerCB.SelectedIndex = (from i in ManagerCB.Items
                                               where i.Text == Session["ManagerInLabel"].ToString()
                                               select i.Index).First <int>();
                }
                Session["ManagerInLabel"] = null;
            }
        }
    }
コード例 #32
0
ファイル: MethodTour.cs プロジェクト: geolabgit/lgprep
 public static void FillApstDDL(RadComboBox ddlApst, List<TouristApstInfo> lstTouristApst, int intSelected, int intTerritoryID)
 {
     ddlApst.DataSource = lstTouristApst;
     ddlApst.DataTextField = "TuristApstakli";
     ddlApst.DataValueField = "TuristApstakli_ID";
     ddlApst.DataBind();
     ddlApst.SelectedValue = intSelected.ToString();
 }
コード例 #33
0
 protected void bindComboBox(RadComboBox r, DataSet d)
 {
     r.Items.Clear();
     r.DataTextField = "AutoSearchResult";
     r.DataSource = d;
     r.DataBind();
     r.Items.Insert(0, new RadComboBoxItem("", "0"));
     r.SelectedValue = "0";
 }
コード例 #34
0
    public void PopulateMasterSpeciality(RadComboBox rcbSpeciality)
    {
        DataSet dsSpeciality = objSpecialityBAL.SelectMasterSpeciality();

        if (dsSpeciality.Tables.Count > 0 && dsSpeciality.Tables[0].Rows.Count > 0)
        {
            rcbSpeciality.DataSource = dsSpeciality;
            rcbSpeciality.DataTextField = "DepartmentName";
            rcbSpeciality.DataValueField = "DepartmentId";
            rcbSpeciality.DataBind();
        }
        RadComboBoxItem CountryListItem = new RadComboBoxItem("--Select--", "--Select--");
        rcbSpeciality.Items.Insert(0, CountryListItem);
    }
コード例 #35
0
ファイル: AllProducts.ascx.cs プロジェクト: HedinRakot/KVS
        // public void cmbCustomerProducts_OnLoad(object sender, EventArgs e)
        public void cmbCustomerProducts_OnLoad(RadComboBox Box)
        {
            using (DataClasses1DataContext dbContext = new DataClasses1DataContext())
            {
                try
                {
                    //RadComboBox cmbCustomerProducts = ((RadComboBox)sender);

                    //cmbCustomerProducts.Items.Clear();
                    //cmbCustomerProducts.Text = string.Empty;

                    if (Session["editableProductId"] != null && Session["editableProductId"].ToString() != string.Empty)
                    {
                        string myProductId = Session["editableProductId"].ToString();
                        Box.Visible = true;
                        //var myCustomers = from cust in dbContext.Customer
                        //                  join custProd in dbContext.CustomerProduct on cust.Id equals custProd.CustomerId into JoinedCustProd
                        //                  from custProd in JoinedCustProd.DefaultIfEmpty()
                        //                  orderby cust.Name ascending
                        //                  select new
                        //                  {
                        //                      CustomerId = cust.Id,
                        //                      CustomerName = cust.Name,
                        //                      IsChecked = custProd.ProductId == new Guid(Session["selectedProductId"].ToString()) ? true : false
                        //                  };

                        var myCustomers = from cust in dbContext.Customer
                                          join lCust in dbContext.LargeCustomer on cust.Id equals lCust.CustomerId
                                          orderby cust.Name ascending
                                          select new
                                          {
                                              CustomerId = cust.Id,
                                              CustomerName = String.IsNullOrEmpty(cust.MatchCode) ? cust.Name : cust.Name + "(" + cust.MatchCode + ")",
                                              IsChecked = dbContext.CustomerProduct.SingleOrDefault(q => q.ProductId == new Guid(myProductId) && q.CustomerId == cust.Id) != null ? true : false
                                          };

                        Box.DataSource = myCustomers;
                        Box.DataBind();
                        //cmbCustomerProducts.DataSource = myCustomers;
                        //cmbCustomerProducts.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    dbContext.WriteLogItem("Product Error " + ex.Message, LogTypes.ERROR, "Product");
                    throw new Exception(ex.Message);
                }
            }
        }
コード例 #36
0
        public void getComboList_ID_Name(empStatus eStatus, RadComboBox cbx)
        {
            sqlStr = "EXEC proc_Get_EmpInfoIdName '" + (int)eStatus + "'";
            sqlCon = new SqlConnection(cnStr);
            sqlCon.Open();

            sqlDA = new SqlDataAdapter(sqlStr, sqlCon);
            dTable = new DataTable();
            sqlDA.Fill(dTable);

            cbx.DataSource = dTable;
            cbx.DataTextField = "FullName";
            cbx.DataValueField = "EmpId";
            cbx.DataBind();

            sqlCon.Close();
            sqlCon.Dispose();
        }
コード例 #37
0
        private void LoadControlToPage(int ReportId)
        {
            try
            {
                Panel.Controls.Clear();
                cls_Report_User objUser = new cls_Report_User();
                DataSet _ds = objUser.GetConfigReport(ReportId);
                DataTable _dtConfig = _ds.Tables[0];
                if (_dtConfig.Rows.Count == 0) return;
                ViewState["Config"] = _dtConfig;
                short TabIndex = 1;
                Label LB;
                string[] ArrRow =null;
                int t = 0;
                int k = 0;
                while (k < _dtConfig.Rows.Count)
                {
                    if (ArrRow == null)
                        Array.Resize(ref ArrRow, 1);
                    else
                        Array.Resize(ref ArrRow, ArrRow.Length + 1);
                    if (k < _dtConfig.Rows.Count - 1 && (Convert.ToInt32(_dtConfig.Rows[k]["Width"]) + Convert.ToInt32(_dtConfig.Rows[k + 1]["Width"]) <= (848 - 848 / 3)))
                    {

                        ArrRow[t] = k.ToString() + ":" + (k + 1).ToString();
                        k++;
                    }
                    else
                    {
                        ArrRow[t] = k.ToString();
                    }
                    t++;
                    k++;
                }
                //Lay max text

                string strMax = "";
                for (k = 0; k < ArrRow.Length; k++)
                {
                    if (ArrRow[k] != null && ArrRow[k].Length > 0)
                    {
                        if (ArrRow[k].IndexOf(":") >= 0)
                        {
                            string[] ArStr = ArrRow[k].Split(':');
                            if (_dtConfig.Rows[Convert.ToInt32(ArStr[0])]["Parameter_Name"].ToString().Length > strMax.Length)
                                strMax = _dtConfig.Rows[Convert.ToInt32(ArStr[0])]["Parameter_Name"].ToString();
                        }
                        else
                        {
                            if (_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Parameter_Name"].ToString().Length > strMax.Length)
                                strMax = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Parameter_Name"].ToString();
                        }
                    }
                }
                strMax += ": ";
                //
                for (k = 0; k < ArrRow.Length; k++)
                {
                    if (k > 0)
                    {
                        HtmlAnchor te = new HtmlAnchor();
                        te.InnerHtml = "<br />";
                        Panel.Controls.Add(te);
                        HtmlAnchor te1 = new HtmlAnchor();
                        te1.InnerHtml = "<br />";
                        Panel.Controls.Add(te1);
                    }
                    if (ArrRow[k].Length > 0)
                    {
                        if (ArrRow[k].IndexOf(":") >= 0)
                        {
                            string[] ArStr = ArrRow[k].Split(':');
                            for (int j = 0; j < ArStr.Length; j++)
                            {

                                LB = new Label();

                                if (j > 0)
                                {
                                  HtmlAnchor tex = new HtmlAnchor();
                                  //tex.InnerText =
                                    tex.InnerHtml = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                                    Panel.Controls.Add(tex);
                                }
                                string str = _dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Parameter_Name"].ToString() + ": ";
                                LB.Text = str;
                                Panel.Controls.Add(LB);
                                if(j==0)
                                if (str.Length < strMax.Length)
                                {
                                    string sadd ="";
                                    for (int y = 0; y <= strMax.Length - str.Length;y++ )
                                        sadd += "&nbsp;";
                                     HtmlAnchor add = new HtmlAnchor();
                                      add.InnerHtml  = sadd;
                                     Panel.Controls.Add(add);
                                }
                               string sCate = _dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Control_Type"].ToString();
                                if (sCate == "TextBox")
                                {
                                    TextBox TB = new TextBox();
                                    TB.ID = _dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Parameter_Code"].ToString();
                                    TB.Height =  Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Height"]);
                                    TB.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Width"]);
                                    TB.TabIndex = TabIndex;
                                    Panel.Controls.Add(TB);
                                }
                                if (sCate == "DatePicker")
                                {
                                    RadDatePicker date = new RadDatePicker();
                                    date.Height = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Height"]);
                                    date.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Width"]);
                                    date.Skin = "Vista";
                                    date.DateInput.DateFormat = "dd/MM/yyyy";
                                    date.ID = _dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Parameter_Code"].ToString();
                                   // date.Culture = new  System.Globalization.CultureInfo("Vietnamese");
                                    date.Font.Bold = true; date.Font.Name = "Times New Roman";
                                    date.Font.Size = 12;
                                    date.SelectedDate = DateTime.Now;
                                    date.TabIndex = TabIndex;
                                    Panel.Controls.Add(date);

                                }
                                if (sCate == "DateTimePicker")
                                {

                                    RadDateTimePicker date = new RadDateTimePicker();
                                    date.Height = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Height"]);
                                    date.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Width"]);
                                    date.Skin = "Vista";
                                    date.DateInput.DateFormat = "dd/MM/yyyy";
                                    date.ID = _dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Parameter_Code"].ToString();

                                    // date.Culture = new  System.Globalization.CultureInfo("Vietnamese");
                                    date.Font.Bold = true; date.Font.Name = "Times New Roman";
                                    date.Font.Size = 12;
                                    date.SelectedDate = DateTime.Now;
                                    date.TabIndex = TabIndex;
                                    Panel.Controls.Add(date);
                                }

                                if (sCate == "ComboBox")
                                {
                                    RadComboBox com = new RadComboBox();
                                    com.Skin = "Vista";
                                    com.Height = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Height"])*5;
                                    com.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Width"]);
                                    com.ID = _dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Parameter_Code"].ToString();

                                    com.EnableVirtualScrolling = true;
                                    string SQL = _dtConfig.Rows[Convert.ToInt32(ArStr[j])]["Data_SQL"].ToString();
                                    if (SQL.Length > 0)
                                    {
                                        DataTable _dt;
                                        if (_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["IsSP"] != null && Convert.ToBoolean(_dtConfig.Rows[Convert.ToInt32(ArStr[j])]["IsSP"]) == true)
                                        {
                                            int Index = SQL.IndexOf('@');
                                            if (Index >= 0)
                                                _dt = objUser.GetSP(SQL.Substring(0, Index), SQL.Substring(Index, SQL.Length - Index), Session["UserId"] == null ? "0" : Session["UserId"].ToString());
                                            else
                                                _dt = objUser.GetSP(SQL);
                                        }
                                        else
                                      _dt = objUser.GetSQL(SQL);
                                        com.DataValueField = "ID";
                                        com.DataTextField = "Name";
                                        com.DataSource = _dt;
                                        com.DataBind();
                                    }
                                    com.TabIndex = TabIndex;
                                    Panel.Controls.Add(com);
                                }
                                 TabIndex++;
                            }

                        }
                        else
                        {
                            LB = new Label();
                            string str = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Parameter_Name"].ToString() + ": ";
                            LB.Text = str;
                            Panel.Controls.Add(LB);

                                if (str.Length < strMax.Length)
                                {
                                    string sadd = "";
                                    for (int y = 0; y <= strMax.Length - str.Length; y++)
                                        sadd += "&nbsp;";
                                    HtmlAnchor add = new HtmlAnchor();
                                    add.InnerHtml = sadd;
                                    Panel.Controls.Add(add);
                                }
                            string sCate = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Control_Type"].ToString();
                            if (sCate == "TextBox")
                            {
                                TextBox TB = new TextBox();
                                TB.ID = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Parameter_Code"].ToString();
                                TB.Height = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Height"]);
                                TB.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Width"]);
                                TB.TabIndex = TabIndex;
                                Panel.Controls.Add(TB);
                            }
                            if (sCate == "DatePicker")
                            {
                                RadDatePicker date = new RadDatePicker();
                                date.Height = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Height"]);
                                date.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Width"]);
                                date.Skin = "Vista";
                                date.DateInput.DateFormat = "dd/MM/yyyy";
                                date.ID = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Parameter_Code"].ToString();
                                // date.Culture = new  System.Globalization.CultureInfo("Vietnamese");
                                date.Font.Bold = true; date.Font.Name = "Times New Roman";
                                date.Font.Size = 12;
                                date.SelectedDate = DateTime.Now;
                                date.TabIndex = TabIndex;
                                Panel.Controls.Add(date);
                            }
                            if (sCate == "DateTimePicker")
                            {
                                RadDateTimePicker date = new RadDateTimePicker();
                                date.Height = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Height"]);
                                date.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Width"]);
                                date.Skin = "Vista";
                                date.DateInput.DateFormat = "dd/MM/yyyy";
                                date.ID = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Parameter_Code"].ToString();
                                // date.Culture = new  System.Globalization.CultureInfo("Vietnamese");
                                date.Font.Bold = true; date.Font.Name = "Times New Roman";
                                date.Font.Size = 12;
                                date.SelectedDate = DateTime.Now;
                                date.TabIndex = TabIndex;
                                Panel.Controls.Add(date);
                            }

                            if (sCate == "ComboBox")
                            {
                                RadComboBox com = new RadComboBox();
                                com.Skin = "Vista";
                                com.Height = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Height"]) * 5;
                                com.Width = Convert.ToInt32(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Width"]);
                                com.ID = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Parameter_Code"].ToString();
                                com.EnableVirtualScrolling = true;
                                string SQL = _dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["Data_SQL"].ToString();
                                if (SQL.Length > 0)
                                {
                                    DataTable _dt;
                                    if (_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["IsSP"] != null && Convert.ToBoolean(_dtConfig.Rows[Convert.ToInt32(ArrRow[k])]["IsSP"]) == true)
                                    {
                                        int Index = SQL.IndexOf('@');
                                        if (Index >= 0)
                                            _dt = objUser.GetSP(SQL.Substring(0, Index), SQL.Substring(Index, SQL.Length - Index), Session["UserId"] == null ? "0" : Session["UserId"].ToString());
                                        else
                                            _dt = objUser.GetSP(SQL);
                                    }
                                    else
                                        _dt = objUser.GetSQL(SQL);
                                    com.DataValueField = "ID";
                                    com.DataTextField = "Name";
                                    com.DataSource = _dt;
                                    com.DataBind();
                                }
                                com.TabIndex = TabIndex;
                                Panel.Controls.Add(com);
                            }

                            TabIndex++;
                        }
                    }
                  }
                //
            }

            catch (Exception ex)
            {
            }
        }
コード例 #38
0
        public void getPaymentCurrency(RadComboBox cbx)
        {
            sqlStr = "SELECT * FROM Currency WHERE Active=1 ORDER BY CurrencyID ASC";
            sqlCon = new SqlConnection(cnStr);
            sqlCon.Open();

            sqlDA = new SqlDataAdapter(sqlStr, sqlCon);
            dTable = new DataTable();
            sqlDA.Fill(dTable);

            cbx.DataSource = dTable;
            cbx.DataTextField = "CurrencyName";
            cbx.DataValueField = "CurrencyID";
            cbx.DataBind();

            sqlCon.Close();
            sqlCon.Dispose();
        }
コード例 #39
0
 /// <summary>
 /// Populates the RAD combo box.
 /// </summary>
 /// <param name="e">The <see cref="Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs"/> instance containing the event data.</param>
 /// <param name="sourceListName">Name of the source list.</param>
 /// <param name="valueFieldName">Name of the value field.</param>
 /// <param name="textFieldName">Name of the text field.</param>
 private void PopulateRadComboBox(RadComboBoxItemsRequestedEventArgs e, RadComboBox objRadComboBox, string sourceListName, string valueFieldName, string textFieldName)
 {
     DataTable dtFieldName = null;
     StringBuilder strUserEnteredValue = new StringBuilder();
     try
     {
         if(!string.IsNullOrEmpty(e.Text))
         {
             strUserEnteredValue.Append(e.Text);
             //Commented in DREAM 4.0 For R%K Changes
             /*if(!sourceListName.Equals(BASINLIST))
             {
                 if(!strUserEnteredValue.ToString().Contains("*"))
                 {
                     strUserEnteredValue.Append("*");
                 }
             }
             else
             {
                 char[] charSpecialCharacter = { '*', '%' };
                 if(strUserEnteredValue.ToString().Contains("*") || strUserEnteredValue.ToString().Contains("%"))
                 {
                     strUserEnteredValue.Remove(strUserEnteredValue.ToString().IndexOfAny(charSpecialCharacter), (strUserEnteredValue.ToString().Length - strUserEnteredValue.ToString().IndexOfAny(charSpecialCharacter)));
                 }
             }*/
             //Added in DREAM 4.0 For R%K Changes
             //Starts
             if(!strUserEnteredValue.ToString().Contains("*"))
             {
                 strUserEnteredValue.Append("*");
             }
             //Ends
             dtFieldName = GetDataForComboBox(strUserEnteredValue.ToString(), sourceListName);
             if(dtFieldName != null && dtFieldName.Rows.Count > 0)
             {
                 int intItemsPerRequest = 111;
                 int intItemOffset = e.NumberOfItems;
                 int intEndOffset = Math.Min(intItemOffset + intItemsPerRequest, dtFieldName.Rows.Count);
                 e.EndOfItems = intEndOffset == dtFieldName.Rows.Count;
                 objRadComboBox.DataSource = dtFieldName;
                 objRadComboBox.DataTextField = textFieldName;
                 objRadComboBox.DataValueField = valueFieldName;
                 objRadComboBox.DataBind();
                 e.Message = dtFieldName.Rows.Count.ToString();
             }
             else
             {
                 e.Message = NORECORDFOUNDSEXCEPTIONMESSAGE;
             }
         }
     }
     finally
     {
         if(dtFieldName != null)
             dtFieldName.Dispose();
     }
 }
コード例 #40
0
 static void BindCombo(object dataSource, RadComboBox combo, string textField, string valueField)
 {
     combo.DataSource = dataSource;
     combo.DataTextField = textField;
     combo.DataValueField = valueField;
     combo.DataBind();
 }
コード例 #41
0
 private void BindStateCombo(RadComboBox sender, int contryId)
 {
     objBindCombo = new BindCombo();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "STATE_NAME";
     sender.DataValueField = "STATE_ID";
     sender.DataSource = objBindCombo.GetStateKeyValue(contryId);
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("", "0"));
     sender.SelectedValue = "0";
 }
コード例 #42
0
 private void BindCountryDropDown(List<CountryElement> countries, RadComboBox countryRadComboBox)
 {
     countryRadComboBox.DataSource = countries;
     countryRadComboBox.DataTextField = "Name";
     countryRadComboBox.DataValueField = "IsoCode";
     countryRadComboBox.DataBind();
 }
コード例 #43
0
    private void LoadListSalesmenToCombo(ICollection trom, RadComboBox comboBox, string firstItemText)
    {
        if (trom != null)
        {
            comboBox.DataSource = trom;
            comboBox.DataTextField = DataTextFieldName;
            comboBox.DataValueField = DataValueFieldName;
            comboBox.DataBind();

            if (trom.Count > 0)
            {
                var item = new RadComboBoxItem(firstItemText, "0");
                comboBox.Items.Insert(0, item);
            }
        }

    }
コード例 #44
0
 private void BindSecurityQuestionCombo(RadComboBox sender)
 {
     objUserMasterDAL = new UserMasterDal();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "SECURITY_QUESTION_DESC";
     sender.DataValueField = "SECURITY_QUESTION_ID";
     sender.DataSource = objUserMasterDAL.GetSecurityQuestion();
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("--Select--", "0"));
     sender.SelectedValue = "0";
 }
コード例 #45
0
        private void LoadControls()
        {
            ds = BankProject.DataProvider.KhanhND.B_BDYNAMICCONTROLS_GetControls(Request.QueryString["tabid"].ToString(), this.ID.ToString(), Session["DataKey"].ToString());
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (i > 0)
                {
                    Label lb = new Label();
                    lb.ID = "lbl" + ds.Tables[0].Rows[i]["DataControlID"].ToString();
                    lb.Text = VVTLabel;

                    RadComboBox rcb = new RadComboBox();
                    rcb.ID = "rcb" + ds.Tables[0].Rows[i]["DataControlID"].ToString();
                    rcb.AutoPostBack = true;
                    rcb.Items.Add(new RadComboBoxItem(""));
                    rcb.SelectedIndexChanged += rcb_SelectedIndexChanged;
                    rcb.AppendDataBoundItems = true;
                    rcb.Width = Unit.Parse(Width);
                    rcb.DataTextField = "TextField";
                    rcb.DataValueField = "ValueField";
                    if (DataSource != null)
                    {
                        rcb.DataSource = DataSource;
                        rcb.DataBind();
                        rcb.SelectedValue = ds.Tables[0].Rows[i]["Datavalue"].ToString();
                    }

                    ImageButton ibt = new ImageButton();
                    ibt.ID = "ibt" + ds.Tables[0].Rows[i]["DataControlID"].ToString();
                    ibt.ImageUrl = "~/Icons/Sigma/Delete_16X16_Standard.png";
                    ibt.Click += ibt_Click;

                    TableRow tr = new TableRow();
                    tr.ID = ds.Tables[0].Rows[i]["DataControlID"].ToString();

                    TableCell tc = new TableCell();
                    tc.CssClass = "MyLable";
                    tc.Controls.Add(lb);
                    tc.Width = Unit.Parse(LBWidth);

                    TableCell tc2 = new TableCell();
                    tc2.CssClass = "MyContent";
                    tc2.Width = Unit.Parse(Width);
                    tc2.Controls.Add(rcb);

                    TableCell tc3 = new TableCell();
                    tc3.Controls.Add(ibt);

                    tr.Cells.Add(tc);
                    tr.Cells.Add(tc2);
                    tr.Cells.Add(tc3);
                    tblMain.Rows.Add(tr);
                }
                else
                {
                    Label lb = new Label();
                    lb.ID = "lbl" + ds.Tables[0].Rows[i]["DataControlID"].ToString();
                    lb.Text = VVTLabel;

                    RadComboBox rcb = new RadComboBox();
                    rcb.ID = "rcb" + ds.Tables[0].Rows[i]["DataControlID"].ToString();
                    rcb.AutoPostBack = true;
                    rcb.Items.Add(new RadComboBoxItem(""));
                    rcb.SelectedIndexChanged += rcb_SelectedIndexChanged;
                    rcb.AppendDataBoundItems = true;
                    rcb.Width = Unit.Parse(Width);
                    rcb.DataTextField = "TextField";
                    rcb.DataValueField = "ValueField";
                    if (DataSource != null)
                    {
                        rcb.DataSource = DataSource;
                        rcb.DataBind();
                        rcb.SelectedValue = ds.Tables[0].Rows[i]["Datavalue"].ToString();
                    }
                    rcb.Enabled = Enabled;

                    ImageButton ibt = new ImageButton();
                    ibt.ID = "ibt" + ds.Tables[0].Rows[i]["DataControlID"].ToString();
                    ibt.ImageUrl = "~/Icons/Sigma/Add_16X16_Standard.png";
                    ibt.Click += ibtVVT_Click;
                    ibt.Enabled = Enabled;

                    TableRow tr = new TableRow();
                    tr.ID = ds.Tables[0].Rows[i]["DataControlID"].ToString();

                    TableCell tc = new TableCell();
                    tc.CssClass = "MyLable";
                    tc.Controls.Add(lb);
                    tc.Width = Unit.Parse(LBWidth);

                    TableCell tc2 = new TableCell();
                    tc2.CssClass = "MyContent";
                    tc2.Width = Unit.Parse(Width);
                    tc2.Controls.Add(rcb);

                    TableCell tc3 = new TableCell();
                    tc3.Controls.Add(ibt);

                    tr.Cells.Add(tc);
                    tr.Cells.Add(tc2);
                    tr.Cells.Add(tc3);
                    tblMain.Rows.Add(tr);
                }
            }
        }
コード例 #46
0
        /// <summary>
        /// Populates the RAD combo box.
        /// </summary>
        /// <param name="e">The <see cref="Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs"/> instance containing the event data.</param>
        /// <param name="sourceListName">Name of the source list.</param>
        /// <param name="valueFieldName">Name of the value field.</param>
        /// <param name="textFieldName">Name of the text field.</param>
        protected void PopulateRadComboBox(RadComboBoxItemsRequestedEventArgs e, RadComboBox objRadComboBox, string sourceListName, string valueFieldName, string textFieldName, bool populateFromSharePointList)
        {
            DataTable dtFieldName = null;
            StringBuilder strUserEnteredValue = new StringBuilder();
            try
            {
                if (!string.IsNullOrEmpty(e.Text))
                {
                    if (e.Text == "empty")
                    {
                        e.Text = string.Empty;
                    }
                    strUserEnteredValue.Append(e.Text);
                    if (!populateFromSharePointList)
                    {
                        strUserEnteredValue.Append("*");
                    }
                    dtFieldName = GetDataSource(sourceListName, strUserEnteredValue.ToString());

                    if (dtFieldName != null && dtFieldName.Rows.Count > 0)
                    {
                        int intItemsPerRequest = 111;
                        int intItemOffset = e.NumberOfItems;
                        int intEndOffset = Math.Min(intItemOffset + intItemsPerRequest, dtFieldName.Rows.Count);
                        e.EndOfItems = intEndOffset == dtFieldName.Rows.Count;
                        objRadComboBox.DataSource = dtFieldName;
                        objRadComboBox.DataTextField = textFieldName;
                        objRadComboBox.DataValueField = valueFieldName;
                        objRadComboBox.DataBind();
                        e.Message = dtFieldName.Rows.Count.ToString();
                        RadComboBoxItem radComboItem = new RadComboBoxItem(DEFAULTDROPDOWNTEXT);
                        objRadComboBox.Items.Insert(0, radComboItem);
                    }
                    else
                    {
                        e.Message = dtFieldName.Rows.Count.ToString();
                        RadComboBoxItem radComboItem = new RadComboBoxItem(DEFAULTDROPDOWNTEXT);
                        objRadComboBox.Items.Clear();
                        objRadComboBox.Items.Insert(0, radComboItem);
                        e.Message = NORECORDFOUNDSEXCEPTIONMESSAGE;
                    }
                }
            }
            finally
            {
                if (dtFieldName != null)
                    dtFieldName.Dispose();
            }
        }
コード例 #47
0
        /// <summary>
        /// Loads the lithostrat group controls.
        /// </summary>
        private void LoadLithostratGroup(string listName, string filteredValue, RadComboBox radCboLithostratGroup, string dataTextField, string dataValueField)
        {
            DataTable dtLithostratGroup = null;
            try
            {
                dtLithostratGroup = GetDataSource(listName, filteredValue);
                if (dtLithostratGroup != null && dtLithostratGroup.Rows.Count > 0)
                {
                    radCboLithostratGroup.DataSource = dtLithostratGroup;
                    radCboLithostratGroup.DataTextField = dataTextField;
                    radCboLithostratGroup.DataValueField = dataValueField;
                    radCboLithostratGroup.DataBind();
                    radCboLithostratGroup.Items.Insert(0, new RadComboBoxItem(DEFAULTDROPDOWNTEXT));
                    radCboLithostratGroup.SelectedIndex = 0;
                }
                else
                {
                    radCboLithostratGroup.ErrorMessage = NORECORDFOUNDSEXCEPTIONMESSAGE;
                }
            }
            catch (SoapException soapEx)
            {
                if (soapEx.Message.Equals(SOAPEXCEPTIONMESSAGE))
                {
                    radCboLithostratGroup.ErrorMessage = NORECORDFOUNDSEXCEPTIONMESSAGE;
                }
                else
                {
                    radCboLithostratGroup.ErrorMessage = UNEXPECTEDEXCEPTIONMESSAGE;
                    CommonUtility.HandleException(strCurrSiteURL, soapEx, 1);
                }
            }

            catch (WebException webEx)
            {
                radCboLithostratGroup.ErrorMessage = UNEXPECTEDEXCEPTIONMESSAGE;
                CommonUtility.HandleException(strCurrSiteURL, webEx, 1);
            }
            catch (Exception ex)
            {
                CommonUtility.HandleException(strCurrSiteURL, ex);
            }
            finally
            {
                if (dtLithostratGroup != null)
                {
                    if (dtLithostratGroup.DataSet != null)
                        dtLithostratGroup.DataSet.Dispose();
                    dtLithostratGroup.Dispose();
                }
            }
        }
コード例 #48
0
        protected void ibtVVT_Click(object sender, ImageClickEventArgs e)
        {
            DataSet dst = DataProvider.KhanhND.B_BDYNAMICCONTROLS_Update("0", Request.QueryString["tabid"].ToString(), this.ID.ToString(), "", "", Session["DataKey"].ToString());

            Label lb = new Label();
            lb.ID = "lbl" + dst.Tables[0].Rows[0]["DataControlID"].ToString();
            lb.Text = VVTLabel;

            RadComboBox rcb = new RadComboBox();
            rcb.ID = "rcb" + dst.Tables[0].Rows[0]["DataControlID"].ToString();
            rcb.AutoPostBack = true;
            rcb.Items.Add(new RadComboBoxItem(""));
            rcb.AppendDataBoundItems = true;
            rcb.Width = Unit.Parse(Width);
            rcb.DataTextField = "TextField";
            rcb.DataValueField = "ValueField";
            if (DataSource != null)
            {
                rcb.DataSource = DataSource;
                rcb.DataBind();
            }

            ImageButton ibt = new ImageButton();
            ibt.ID = "ibt" + dst.Tables[0].Rows[0]["DataControlID"].ToString();
            ibt.ImageUrl = "~/Icons/Sigma/Delete_16X16_Standard.png";
            ibt.Click += ibt_Click;

            TableRow tr = new TableRow();
            tr.ID = dst.Tables[0].Rows[0]["DataControlID"].ToString();

            TableCell tc = new TableCell();
            tc.CssClass = "MyLable";
            tc.Controls.Add(lb);
            tc.Width = Unit.Parse(LBWidth);

            TableCell tc2 = new TableCell();
            tc2.CssClass = "MyContent";
            tc2.Width = Unit.Parse(Width);
            tc2.Controls.Add(rcb);

            TableCell tc3 = new TableCell();
            tc3.Controls.Add(ibt);

            tr.Cells.Add(tc);
            tr.Cells.Add(tc2);
            tr.Cells.Add(tc3);
            tblMain.Rows.Add(tr);
        }
コード例 #49
0
 public void LoadComboBox(RadComboBox RadDropDown, string SQL, string DisplayField, string ValueField, bool AppendRow = true)
 {
     AppManager am = new AppManager();
     DataTable dt = am.DataAccess.RecordSet(SQL, new string[] { });
     if (AppendRow)
     {
         DataRow dRow = dt.NewRow();
         dRow[ValueField] = "0";
         dRow[DisplayField] = "";
         dt.Rows.InsertAt(dRow, 0);
     }
     RadDropDown.DataSource = dt;
     RadDropDown.DataTextField = DisplayField;
     RadDropDown.DataValueField = ValueField;
     RadDropDown.DataBind();
     if (AppendRow)
     {
         RadDropDown.SelectedValue = "0";
     }
 }
コード例 #50
0
        protected void SelectedCountry(object sender, EventArgs e)
        {
            string formID = Session["formpage"].ToString();

            RadComboBox countryDrop = (RadComboBox)sender;

            RadComboBox stateDrop = new RadComboBox();
            TextBox stateTextB = new TextBox();

            //if (formID == "1")
            //{
            //    countryDrop = (RadComboBox)FindControl("CountryLabelDropDown");
            //    stateTextB = (TextBox)FindControl("StateLabelTextBox");
            //    stateDrop = (RadComboBox)FindControl("StateLabelDropDown");
            //}
            //else
            //{
                countryDrop = (RadComboBox)FindControl("CountryLabel" + formID + "RadComboBox");
                stateTextB = (TextBox)FindControl("StateLabel" + formID + "TextBox");
                stateDrop = (RadComboBox)FindControl("StateLabel" + formID + "RadComboBox");
            //}

            DataSet dsState = doQuery("SELECT * FROM States WHERE country_id=" + countryDrop.SelectedValue);

            if (dsState.Tables.Count > 0)
                if (dsState.Tables[0].Rows.Count > 0)
                {
                    stateDrop.Items.Clear();
                    stateTextB.Visible = false;
                    stateDrop.Visible = true;

                    stateDrop.DataSource = dsState;
                    stateDrop.DataTextField = "state_name";
                    stateDrop.DataValueField = "state_id";
                    stateDrop.DataBind();

                    stateDrop.Items.Insert(0, new RadComboBoxItem("Please Select", "-1"));
                }
                else
                {
                    stateTextB.Visible = true;
                    stateDrop.Visible = false;
                }
            else
            {
                stateTextB.Visible = true;
                stateDrop.Visible = false;
            }

            if (countryDrop.SelectedValue != "223")
            {
                Panel temp = (Panel)FindControl(countryDrop.ID + "Local");
                temp.Visible = false;
                temp = (Panel)FindControl(countryDrop.ID + "Local2");
                temp.Visible = false;
                temp = (Panel)FindControl(countryDrop.ID + "International");
                temp.Visible = true;
            }
            else
            {
                Panel temp = (Panel)FindControl(countryDrop.ID + "Local");
                temp.Visible = true;
                temp = (Panel)FindControl(countryDrop.ID + "Local2");
                temp.Visible = true;
                temp = (Panel)FindControl(countryDrop.ID + "International");
                temp.Visible = false;
            }
        }
コード例 #51
0
        protected void Page_Init(object sender, EventArgs e)
        {
            SamesAsCheckBox3.Checked = false;
            SamesAsCheckBox32.Checked = false;
            SameAsLabel4CheckBox.Checked = false;
            SameAsBillingLabel4CheckBox.Checked = false;
            SameAsShippingLabel4CheckBox.Checked = false;

               StaticFieldsPanel1.Visible = false;
            StaticFieldsPanel2.Visible = false;
            StaticFieldsPanel3.Visible = false;
            StaticFieldsPanel4.Visible = false;
            StaticFieldsPanel5.Visible = false;
            StaticFieldsPanel6.Visible = false;
            StaticFieldsPanel7.Visible = false;
            StaticFieldsPanel8.Visible = false;
            StaticFieldsPanel9.Visible = false;

            if(Session["AccountCreateType"] == null)
                Session["AccountCreateType"] = "Create";

            bool isCreate = false;

            if (Session["AccountCreateType"] == "Create")
                isCreate = true;

            string message = "";

            try
            {
                if (Session["formpage"] == null)
                {
                    Session["formpage"] = "1";
                }

                bool drawForm = false;
                if (Session["RedrawForm"] == null)
                {
                    drawForm = true;
                }
                else
                {
                    if (bool.Parse(Session["RedrawForm"].ToString()))
                        drawForm = true;
                    else
                        drawForm = false;
                }

                if (!IsPostBack)
                {
                    drawForm = true;
                }
                //ErrorLabel.Text = "got here2";
                DataSet dsAll = doQuery("SELECT * FROM FormStaticPageFields");
                if (drawForm)
                {

                    string formID = Session["formpage"].ToString();

                    if (int.Parse(formID) < 7)
                    {

                        if (!isCreate)
                        {
                            Image theImage = (Image)FindControl("Image" + formID);
                            theImage.Visible = true;
                        }

                        DataSet ds = doQuery("SELECT NavTitle FROM FormPages WHERE ID=" + formID);
                        DataSet dsForm = doQuery("SELECT * FROM FormStaticPageFields WHERE FormPageID=" + formID);

                        DataSet dsCount = doQuery("SELECT DISTINCT FormPageID FROM FormStaticPageFields");

                        if (int.Parse(formID) < 6)
                        {
                            //ErrorLabel.Text = "got here";
                            ProductName.Text = ds.Tables[0].Rows[0]["NavTitle"].ToString();

                            if (formID == "2")
                            {
                                AllMoneyPanel.DefaultButton = "Button1";

                            }
                            else if(formID == "5")
                            {
                                AllMoneyPanel.DefaultButton = "Button5";
                                StaticFieldsPanel2.DefaultButton = "Button5";

                                BillingHidePanel.DefaultButton = "Button5";
                            }
                        }
                        else if(formID == "6")
                        {
                            ProductName.Text = "Review Order Information";
                        }
                        else if (formID == "7")
                        {
                            ProductName.Visible = false;

                            //Get the invoice
                            Explore.NetSuite.DataAccess.NDAL client = new Explore.NetSuite.DataAccess.NDAL();
                            Array theTransactions = (Array)client.GetTransactions(Session["UserID"].ToString(), DateTime.Now.AddMinutes(double.Parse("-10.00")), DateTime.Now);

                            //code recommended by john ogle. refer to bug 1688 in OA bug tracking system.
                            Dictionary<string, IEnumerable<Transaction>> invoiceMap = new Dictionary<string, IEnumerable<Transaction>>();
                            List<Transaction> invoices;

                            foreach (Transaction t in theTransactions)
                            {
                                if (t.Type != "SalesOrd")
                                {
                                    invoices = new List<Transaction>();

                                    if (invoiceMap.ContainsKey(t.CreatedFrom))
                                    {
                                        invoices = (List<Transaction>)invoiceMap[t.CreatedFrom];
                                    }
                                    else
                                    {
                                        invoiceMap.Add(t.CreatedFrom, invoices);
                                    }

                                    invoices.Add(t);
                                }
                            }

                            foreach (Transaction oneTrans in theTransactions)
                            {
                                if (oneTrans.Type == "SalesOrd" && oneTrans.OrderNumber == Session["OrderNumber"].ToString())
                                {
                                    SalesOrderHyperLink.NavigateUrl = oneTrans.PrintoutURL;
                                }
                            }
                        }
                        else if (formID == "8")
                        {
                            ProductName.Visible = false;
                        }

                        if (formID == "6")
                        {
                            Explore.NetSuite.DataAccess.NDAL client = new Explore.NetSuite.DataAccess.NDAL();

                            BuildIt(client, client.GetCustomer(Session["UserID"].ToString()));

                        }

                        Panel staticPanel = (Panel)FindControl("StaticFieldsPanel" + formID);
                        staticPanel.Visible = true;

                        if (dsAll.Tables.Count > 0)
                        {
                            for (int i = 0; i < dsAll.Tables[0].Rows.Count; i++)
                            {
                                Label theLabel = (Label)FindControl(dsAll.Tables[0].Rows[i]["LabelFormName"].ToString());
                                message += dsAll.Tables[0].Rows[i]["LabelFormName"].ToString();
                                theLabel.Text = dsAll.Tables[0].Rows[i]["LabelName"].ToString();
                            }
                        }

                        RadComboBoxItem item;

                        RadComboBox countryDrop = new RadComboBox();
                        RadComboBox stateDrop = new RadComboBox();
                        TextBox stateTextB = new TextBox();

                        for (int i = 0; i < dsCount.Tables[0].Rows.Count; i++)
                        {

                            countryDrop = (RadComboBox)FindControl("CountryLabel" + (i + 1).ToString() + "RadComboBox");
                            stateTextB = (TextBox)FindControl("StateLabel" + (i + 1).ToString() + "TextBox");
                            stateDrop = (RadComboBox)FindControl("StateLabel" + (i + 1).ToString() + "RadComboBox");

                            if (countryDrop != null)
                            {
                                message += "fin got here";
                                DataSet dsCountry = doQuery("SELECT * FROM Countries ORDER BY country_2_code asc");
                                countryDrop.Items.Clear();
                                countryDrop.DataSource = dsCountry;
                                countryDrop.DataTextField = "country_name";
                                countryDrop.DataValueField = "country_id";
                                countryDrop.DataBind();
                                //for (int n = 0; n < dsCountry.Tables["table"].Rows.Count; n++)
                                //{
                                //    item = new RadComboBoxItem(dsCountry.Tables["table"].Rows[n]["country_2_code"].ToString(),
                                //        dsCountry.Tables["table"].Rows[n]["country_id"].ToString());
                                //    countryDrop.Items.Add(item);
                                //}
                                dsCountry = doQuery("SELECT * FROM countries where country_name='" + ConfigurationManager.AppSettings.Get("defaultcountry") + "'");
                                countryDrop.SelectedValue = dsCountry.Tables["table"].Rows[0]["country_id"].ToString();

                                DataSet dsState = doQuery("SELECT * FROM states WHERE country_id=" + countryDrop.SelectedValue + " ORDER BY state_name ASC");

                                if (dsState.Tables["table"].Rows.Count > 0)
                                {
                                    stateDrop.Items.Clear();
                                    for (int n = 0; n < dsState.Tables["table"].Rows.Count; n++)
                                    {
                                        item = new RadComboBoxItem(dsState.Tables["table"].Rows[n]["state_name"].ToString(), dsState.Tables["table"].Rows[n]["state_code"].ToString());
                                        stateDrop.Items.Add(item);
                                    }
                                    stateTextB.Visible = false;
                                    stateDrop.Visible = true;
                                    stateDrop.Items.Insert(0, new RadComboBoxItem("Please Select...", "-1"));

                                }
                                else
                                {
                                    stateTextB.Visible = true;
                                    stateDrop.Visible = false;
                                }
                            }
                        }

                    }
                    else
                    {
                        GoToForm(int.Parse(formID), 1);
                    }

                }

                DataView dvHelp = new DataView(dsAll.Tables[0], "hasHelp='True'", "", DataViewRowState.CurrentRows);

                for (int j = 0; j < dvHelp.Count; j++)
                {
                    Panel helpPanel = (Panel)FindControl(dvHelp[j]["LabelFormName"].ToString() + "HelpPanel");
                    CreateHelp(dvHelp[j]["HelpText"].ToString(), j.ToString(), ref helpPanel);
                }

                SetBoxes();
                AddFields();

                if (drawForm)
                {
                    switch (Session["formpage"].ToString())
                    {
                        //case "1":
                        //    FillAccount();
                        //    break;
                        case "1":
                            RoleDropDown.Items.Clear();
                            DataSet ds = doQuery("SELECT * FROM ROLES ORDER BY ID ASC");
                            RadComboBoxItem item = new RadComboBoxItem();
                            item.Text = "Please Select...";
                            item.Value = "-1";
                            RoleDropDown.Items.Add(item);
                            for (int i = 0; i < ds.Tables["table"].Rows.Count; i++)
                            {
                                item = new RadComboBoxItem(ds.Tables["table"].Rows[i]["NAME"].ToString(),
                                    ds.Tables["table"].Rows[i]["NetSuiteID"].ToString());
                                RoleDropDown.Items.Add(item);
                            }

                            ds = new DataSet();
                            AccountDropDown.Items.Clear();
                            ds = doQuery("SELECT * FROM AccountType");
                            item = new RadComboBoxItem();
                            item.Text = "Please Select...";
                            item.Value = "-1";
                            AccountDropDown.Items.Add(item);
                            AccountDropDown.Width = 240;
                            for (int i = 0; i < ds.Tables["table"].Rows.Count; i++)
                            {
                                item = new RadComboBoxItem(ds.Tables["table"].Rows[i]["AccountType"].ToString(),
                                    ds.Tables["table"].Rows[i]["NetSuiteID"].ToString());
                                AccountDropDown.Items.Add(item);
                            }
                            break;
                        case "2":
                            StaticFieldsPanel2.DefaultButton = "Button1";
                            BillingHidePanel.DefaultButton = "Button1";
                            FillBilling();
                            break;
                        case "3":
                            FillShipping();
                            break;
                        case "4":
                            FillDelivery();
                            break;
                        case "5":
                            StaticFieldsPanel2.DefaultButton = "Button5";
                            BillingHidePanel.DefaultButton = "Button5";
                            GoToForm(5, 4);
                            //SetBoxes();
                            //BuildIt();
                            FillPayment();
                            break;
                        case "6":
                            GoToForm(6, 5);
                            Explore.NetSuite.DataAccess.NDAL client = new Explore.NetSuite.DataAccess.NDAL();

                            BuildIt(client, client.GetCustomer(Session["UserID"].ToString()));
                            FillPayment();
                            SetBoxes();
                            break;
                        default: break;
                    }
                }

            }
            catch (Exception ex)
            {
                ErrorLabel.Text = ex.ToString() + message;
            }

            if (Session["formpage"] == "2")
            {
                if (Session["InShopping"] != null)
                {
                    Button9.Visible = false;
                }
            }
        }
コード例 #52
0
 private void BindEmployeeCombo(RadComboBox sender)
 {
     objUserMasterDAL = new UserMasterDal();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "EMP_NAME";
     sender.DataValueField = "EMP_ID";
     sender.DataSource = objUserMasterDAL.GetEmployeeKeyValue();
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("", "0"));
     sender.SelectedValue = "0";
 }
コード例 #53
0
        private void BindComboBox(RadComboBox comboBox, bool hasAll, ItemType type)
        {
            string text = string.Empty;
            string value = string.Empty;
            comboBox.Items.Clear();

            switch (type)
            {
                case ItemType.AllRoles:
                    text = "rolename";
                    value = "roleid";
                    comboBox.DataSource = AllRoles;
                    break;
                case ItemType.AllSchools:
                    text = "name";
                    value = "id";
                    comboBox.DataSource = AllSchools;
                    break;
                case ItemType.AllSchoolTypes:
                    text = "name";
                    value = "name";
                    comboBox.DataSource = AllSchoolTypes;
                    break;
                case ItemType.AllPortals:
                    text = "portalname";
                    value = "id";
                    comboBox.DataSource = adm.GetPortalSelections();
                    break;
            }

            comboBox.DataTextField = text;
            comboBox.DataValueField = value;
            comboBox.DataBind();

            if (hasAll)
            {
                comboBox.Items.Add(new RadComboBoxItem("All", "All"));
            }
        }
コード例 #54
0
ファイル: Commont.cs プロジェクト: nguyenppt/tfinance0115
 //
 public static void initRadComboBox(ref RadComboBox cboList, string DataTextField, string DataValueField, object DataSource)
 {
     cboList.Items.Clear();
     //
     cboList.DataTextField = DataTextField;
     cboList.DataValueField = DataValueField;
     cboList.DataSource = DataSource;
     cboList.DataBind();
     if (cboList.Items.Count > 0)
     {
         cboList.Items.Insert(0, new RadComboBoxItem(""));
     }
 }
コード例 #55
0
 private void BindCountryCombo(RadComboBox sender)
 {
     objBindCombo = new BindCombo();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "COUNTRY_NAME";
     sender.DataValueField = "COUNTRY_ID";
     sender.DataSource = objBindCombo.GetCountryKeyValue();
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("", "0"));
     sender.SelectedValue = "0";
 }
コード例 #56
0
		private void bindCountryCombo(RadComboBox sender, DataSet source)
		{
			objBindCombo = new BindCombo();
			sender.Items.Clear();
			sender.ClearSelection();
			sender.DataTextField = "COUNTRY_NAME";
			sender.DataValueField = "COUNTRY_ID";
			if (source != null)
				sender.DataSource = source;
			else
				sender.DataSource = objBindCombo.GetAirLine();
			sender.DataBind();
			sender.Items.Insert(0, new RadComboBoxItem("", "0"));
			sender.SelectedValue = "0";
		}
コード例 #57
0
		//#region btnDeleteAirport_Click
		//protected void btnDeleteAirport_Click(object sender, EventArgs e)
		//{


		//    try
		//    {
		//        int serialNo = 0;
		//        ImageButton imgbtnDetailDelete = (ImageButton)sender;
		//        if (imgbtnDetailDelete != null)
		//            Int32.TryParse(imgbtnDetailDelete.CommandArgument, out serialNo);

		//        objAirlineMapDal = new AirlineMapDal();

		//        int result = objAirlineMapDal.DeleteAirportBySrNo(serialNo);
		//        if (result == 1)
		//        {
		//            Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Delete].ToString());
		//            Master.MessageCssClass = "successMessage";
		//            BindAirportGrid();
		//        }
		//        else if (result == 547)
		//        {
		//            Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Delete].ToString());
		//            Master.MessageCssClass = "errorMessage";
		//        }
		//        else
		//        {
		//            Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Delete].ToString());
		//            Master.MessageCssClass = "errorMessage";
		//        }
		//    }
		//    catch (Exception ex)
		//    {
		//        bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
		//        if (rethrow)
		//        { throw ex; }
		//    }
		//}
		//#endregion


		#endregion

		#region Method

		private void BindRegionCombo(RadComboBox sender, DataSet source)
		{
			objBindCombo = new BindCombo();
			sender.Items.Clear();
			sender.ClearSelection();
			sender.DataTextField = "REGION_LONG_NAME";
			sender.DataValueField = "REGION_ID";
			if (source != null)
				sender.DataSource = source;
			else
				sender.DataSource = objBindCombo.GetCityKeyValue(0, 0);
			sender.DataBind();
			sender.Items.Insert(0, new RadComboBoxItem("", "0"));
			sender.SelectedValue = "0";
		}
コード例 #58
0
 protected void bindComboBoxforquestion(RadComboBox r, DataSet d)
 {
     r.Items.Clear();
     r.DataTextField = "MAIN_GROUP";
     // r.DataValueField = "TEST_QUESTION_SRNO";
     r.DataSource = d;
     r.DataBind();
     r.Items.Insert(0, new RadComboBoxItem("", ""));
     r.SelectedValue = "";
 }
コード例 #59
0
 public void LoadComboBox(RadComboBox RadDropDown, string SQL, string DisplayField, string ValueField, string[] WhereCluseValue)
 {
     AppManager am = new AppManager();
     DataTable dt = am.DataAccess.RecordSet(SQL, WhereCluseValue);
     DataRow dRow = dt.NewRow();
     dRow[ValueField] = "0";
     dRow[DisplayField] = "";
     dt.Rows.Add(dRow);
     RadDropDown.DataSource = dt;
     RadDropDown.DataTextField = DisplayField;
     RadDropDown.DataValueField = ValueField;
     RadDropDown.DataBind();
     RadDropDown.SelectedValue = "0";
 }