Example #1
0
    public static ASPxListBox MontaListMultCk(ASPxListBox pListBox, string pTabela, string pCampoExibe, string pCampoValor, Boolean pExibeValor)
    {
        //Documentação - Chamada da Função
        //
        //String[] Campos = { "tipo", "descricao", "apelido" };
        //RgbDbLib.MontaComboFullCk(ListBoxModelo2, "tcobran", Campos, "tipo", true);
        //
        //Todas as Caracteristicas do Combo são montadas na Classe, a chamada passa do combo vazio.
        //1o. Campo da Lista é um CheckBox
        //Fim Documentação - Chamada da Função


        String       script = "SELECT " + pCampoExibe + "," + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK)";
        DataSet      ds     = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le = new ListEditItem();
            if (pExibeValor)
            {
                le.Text = dr[pCampoValor].ToString() + " - " + dr[pCampoExibe].ToString();
            }
            else
            {
                le.Text = dr[pCampoExibe].ToString();
            };

            le.Value = dr[pCampoValor].ToString();
            pListBox.Items.Add(le);
        }

        return(pListBox);
    }
Example #2
0
        protected void gridKhoaDaoTao_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxTextBox  txt_madaotao = gridKhoaDaoTao.FindEditFormTemplateControl("txt_madaotao") as ASPxTextBox;
            ASPxDateEdit date_tungay  = gridKhoaDaoTao.FindEditFormTemplateControl("date_tungay") as ASPxDateEdit;
            ASPxDateEdit date_denngay = gridKhoaDaoTao.FindEditFormTemplateControl("date_denngay") as ASPxDateEdit;
            ASPxMemo     memo_noidung = gridKhoaDaoTao.FindEditFormTemplateControl("memo_noidung") as ASPxMemo;
            ASPxMemo     memo_ghichu  = gridKhoaDaoTao.FindEditFormTemplateControl("memo_ghichu") as ASPxMemo;
            ASPxListBox  lbChoosen    = gridKhoaDaoTao.FindEditFormTemplateControl("lbChoosen") as ASPxListBox;

            string filename = string.Empty;

            if (Session["file"] != null)
            {
                filename = Session["file"].ToString();
                Session.Remove("file");
            }

            object idkhoadaotao = SqlHelper.ExecuteScalar(strconn, "[HRM_ANTOANVESINHLAODONG_UI]", 0, txt_madaotao.Text, date_tungay.Value, date_denngay.Value,
                                                          memo_noidung.Text, filename, memo_ghichu.Text, 0);

            foreach (ListEditItem item in lbChoosen.SelectedItems)
            {
                SqlHelper.ExecuteNonQuery(strconn, "[HRM_ANTOANVESINHLAODONG_KETQUA_UI]", 0, idkhoadaotao, item.Value, null, 0, null, 0);
            }
            gridKhoaDaoTao.CancelEdit();
            e.Cancel = true;
            load_data_grid();
        }
Example #3
0
    public static ASPxListBox MontaListMult(ASPxListBox pCombo, string pTabela, string[] pCamposExibe, string pCampoValor, Boolean pExibeValor)
    {
        //Documentação - Chamada da Função
        //
        //String[] Campos = { "tipo", "descricao", "apelido" };
        //RgbDbLib.MontaListMult(ListBoxModelo2, "tcobran", Campos, "tipo", true);
        //
        //O Search será sempre pelo 1o. campo do Select
        //O Campo de valor Não precisa ser passado na lista de campos, porque ele vem através de pCampoValor
        //Fim Documentação - Chamada da Função

        String script = "SELECT ";

        foreach (String item in pCamposExibe)
        {
            script = script + item + ",";
        }
        script = script + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK)";
        DataSet ds = SreDblib.GetDsScript(script);

        pCombo.DataSource = ds;
        pCombo.ValueField = pCampoValor;
        pCombo.DataBind();

        return(pCombo);
    }
Example #4
0
    public static ASPxListBox MontaList(ASPxListBox pCombo, string pTabela, string pCampoExibe, string pCampoValor, Boolean pExibeValor)
    {
        //Documentação - Chamada da Função
        //
        //RgbDbLib.MontaList(ASPxListBox1, "tcobran", "descricao", "tipo", true);
        //
        //Fim Documentação - Chamada da Função

        String       script = "SELECT " + pCampoExibe + "," + pCampoValor + " FROM " + pTabela + " WITH(NOLOCK)";
        DataSet      ds     = SreDblib.GetDsScript(script);
        ListEditItem le;

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            le = new ListEditItem();
            if (pExibeValor)
            {
                le.Text = dr[pCampoValor].ToString() + " - " + dr[pCampoExibe].ToString();
            }
            else
            {
                le.Text = dr[pCampoExibe].ToString();
            };
            le.Value = dr[pCampoValor].ToString();
            pCombo.Items.Add(le);
        }
        return(pCombo);
    }
Example #5
0
        public static void AddCheckQuestionAdvanced(BusinessLogicLayer.Entities.FormBuilder.FormField Q, Panel QuestionPanel)
        {
            QuestionPanel.ToolTip = Q.FormFieldType.Name;
             Label QuestionTitle = new Label();
             QuestionTitle.Text = String.Format(@"<span class='fb-Title'>{0}</span>", Q.Title);
             //-----
             Label IsReqired = new Label();
             IsReqired.Text = (Q.IsRequired) ? "*Required" : "";
             //-----
             Label HelpText = new Label();
             HelpText.Text = Q.HelpText;
             //-----
             //Panel AnswerArea = new Panel();
             ASPxListBox chckbx = new ASPxListBox();
             chckbx.SelectionMode = ListEditSelectionMode.CheckColumn;
             chckbx.Width = new Unit(400);
             chckbx.ID = chckbx.ID = "CheckList" + Q.FormFieldId.ToString();
             foreach (BusinessLogicLayer.Entities.FormBuilder.FormFieldValue qa in Q.FormFieldValues)
             {

                 ListEditItem item = new ListEditItem();
                 item.Text = qa.FieldValue;
                 item.Value = qa.FormFieldValueId;
                 chckbx.Items.Add(item);
             }
             if (Q.IsRequired)
             {
                 chckbx.ValidationSettings.CausesValidation = true;
                 chckbx.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.Text;
                 chckbx.ValidationSettings.RequiredField.IsRequired = true;
             }
             //-----
             ControlsAdder(QuestionPanel, QuestionsTemplates.Paragraph, new Control[4] { QuestionTitle, IsReqired, HelpText, chckbx }, new String[4] { "@QuestionTitle", "@IsRequired", "@HelpText", "@AnswerTextBox" });
        }
Example #6
0
        protected void gridKhoaDaoTao_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxTextBox  txt_madaotao = gridKhoaDaoTao.FindEditFormTemplateControl("txt_madaotao") as ASPxTextBox;
            ASPxDateEdit date_tungay  = gridKhoaDaoTao.FindEditFormTemplateControl("date_tungay") as ASPxDateEdit;
            ASPxDateEdit date_denngay = gridKhoaDaoTao.FindEditFormTemplateControl("date_denngay") as ASPxDateEdit;
            ASPxMemo     memo_noidung = gridKhoaDaoTao.FindEditFormTemplateControl("memo_noidung") as ASPxMemo;
            ASPxMemo     memo_ghichu  = gridKhoaDaoTao.FindEditFormTemplateControl("memo_ghichu") as ASPxMemo;
            ASPxListBox  lbChoosen    = gridKhoaDaoTao.FindEditFormTemplateControl("lbChoosen") as ASPxListBox;

            string filename = string.Empty;

            if (Session["file"] != null)
            {
                filename = Session["file"].ToString();
                Session.Remove("file");
                string url  = String.Format("{0}/images/FileQD/{1}", DotNetNuke.Common.Globals.ApplicationPath, gridKhoaDaoTao.GetRowValues(gridKhoaDaoTao.FocusedRowIndex, "quyetdinh"));
                string file = Server.MapPath(url);
                if (File.Exists(file))
                {
                    File.Delete(file);
                }
            }

            object idkhoadaotao = SqlHelper.ExecuteNonQuery(strconn, "[HRM_ANTOANVESINHLAODONG_UI]", e.Keys["id"], txt_madaotao.Text, date_tungay.Value, date_denngay.Value,
                                                            memo_noidung.Text, filename, memo_ghichu.Text, 1);

            foreach (ListEditItem item in lbChoosen.SelectedItems)
            {
                SqlHelper.ExecuteNonQuery(strconn, "[HRM_ANTOANVESINHLAODONG_KETQUA_UI]", 0, e.Keys["id"], item.Value, null, 0, null, 0);
            }

            gridKhoaDaoTao.CancelEdit();
            e.Cancel = true;
            load_data_grid();
        }
Example #7
0
        private void FillDropdownLists()
        {
            using (Entities1 db = new Entities1())
            {
                drplvl1.DataSource = db.usp_CatogeriesSelect(null).ToList();
                drplvl1.ValueField = "ID";
                drplvl1.TextField  = "Name";

                //drplvl1.append = true;
                //--------------------
                drptower.DataSource = db.usp_TowersSelect(null).ToList();
                drptower.TextField  = "Name";
                drptower.ValueField = "ID";

                //----------------------
                drpissue.DataSource = db.usp_CommonIssuesSelect(null);
                drpissue.TextField  = "Name";
                drpissue.ValueField = "ID";

                ASPxListBox listBox = drpotheap.FindControl("listBox") as ASPxListBox;
                listBox.DataSource = db.usp_ApartmentsSelectByTower(1);
                listBox.TextField  = "Name";
                listBox.ValueField = "APID";
                // listBox.Items.("select All",-1);

                DataBind();
            }
        }
Example #8
0
        protected void lbAvailable_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            string      pline      = e.Parameter;
            ASPxListBox detectData = sender as ASPxListBox;

            initDetect(pline);
        }
Example #9
0
        protected void ProdCat_ListBox_Init(object sender, EventArgs e)
        {
            string docnum = MOPNum_Combo.Text.ToString();

            empty = string.IsNullOrEmpty(docnum);
            ASPxListBox list = sender as ASPxListBox;

            list.Columns.Clear();
            list.Items.Clear();

            //if (empty)
            list.DataSource = MRPClass.ProCategoryTable_WithoutAll();
            //else
            //list.DataSource = MRPClass.ProCategoryTable_Filter("");

            ListBoxColumn l_value = new ListBoxColumn();

            l_value.FieldName = "NAME";
            l_value.Caption   = "Code";
            l_value.Width     = 100;
            list.Columns.Add(l_value);

            ListBoxColumn l_text = new ListBoxColumn();

            l_text.FieldName = "DESCRIPTION";
            l_text.Caption   = "Description";
            l_text.Width     = 350;
            list.Columns.Add(l_text);

            list.ValueField = "NAME";
            list.TextField  = "DESCRIPTION";
            list.DataBind();
            list.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
            list.ClientEnabled  = false;
        }
Example #10
0
        public ASPxListBox lstFormSelector()
        {
            //if (api != null)
            if (dt_redcapforms.HasRows())
            {
                ASPxListBox lst = new ASPxListBox();
                lst.ID = "lstRedcapForms";
                lst.ClientInstanceName = "lstRedcapForms";
                lst.Caption            = "All REDCap Forms:";
                lst.ValueType          = typeof(string);
                lst.SelectionMode      = ListEditSelectionMode.Multiple;
                lst.Width = 400;
                //lst.DataBind();

                foreach (DataRow row in dt_redcapforms.Rows)
                {
                    ListEditItem itm = new ListEditItem();
                    itm.Value = row["instrument_name"].ToString();
                    itm.Text  = row["instrument_name"].ToString();
                    lst.Items.Add(itm);
                }


                return(lst);
            }
            else
            {
                return(null);
            }
        }
Example #11
0
    protected void listBoxLocation_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
    {
        //string pline = e.Parameter;
        string[]    param    = e.Parameter.Split(',');
        string      sss1     = param[0];
        string      sss2     = param[1];
        string      sss3     = param[2];
        ASPxListBox location = sender as ASPxListBox;

        //如果是装配工位排除已经对应过站点的工位
        string sql = "";

        if (sss2 == "A")
        {
            sql = "SELECT A.RMES_ID,A.LOCATION_CODE,A.LOCATION_CODE LOCATION_NAME FROM CODE_LOCATION A WHERE A.PLINE_CODE='"
                  + sss1 + "' AND NOT EXISTS(SELECT * FROM REL_STATION_LOCATION C WHERE C.LOCATION_CODE=A.RMES_ID  and c.LOCATION_FLAG='A' and PLINE_CODE='" + sss1 + "' ) "
                  + " AND NOT EXISTS(SELECT * FROM REL_STATION_LOCATION D WHERE D.LOCATION_CODE=A.RMES_ID   and D.station_code='" + sss3 + "' ) " //and c.LOCATION_FLAG='B'
                  + " ORDER BY A.LOCATION_CODE";                                                                                                  //
        }
        if (sss2 == "B")
        {
            sql = "SELECT A.RMES_ID,A.LOCATION_CODE,A.LOCATION_CODE LOCATION_NAME FROM CODE_LOCATION A WHERE A.PLINE_CODE='" + sss1 + "' "
                  + " AND NOT EXISTS(SELECT * FROM REL_STATION_LOCATION C WHERE C.LOCATION_CODE=A.RMES_ID   and c.station_code='" + sss3 + "' ) " //and c.LOCATION_FLAG='B'
                  + " ORDER BY A.LOCATION_CODE";
        }
        //如果是查看工位显示所有工位
        DataTable dt = dc.GetTable(sql);

        location.DataSource = dt;
        location.DataBind();
    }
        public void InstantiateIn(System.Web.UI.Control container)
        {
            ASPxListBox listbox = new ASPxListBox();

            listbox.ClientInstanceName = "listbox";
            listbox.Width         = Unit.Parse("100%");
            listbox.ID            = "listBox";
            listbox.SelectionMode = ListEditSelectionMode.CheckColumn;
            List <DictionaryItem> itemslist = new List <DictionaryItem>();

            using (TestDBEntities entity = new TestDBEntities())
            {
                itemslist = entity.DictionaryItem.Where(oo => oo.DictionaryItemCode.StartsWith(CodeCat) && oo.DictionaryItemCode.Length == 7).ToList();
            }
            StringBuilder allitem = new StringBuilder();

            foreach (DictionaryItem item in itemslist)
            {
                allitem.Append(item.DictionaryItemValue + ";");
            }
            allitem.Remove(allitem.Length - 1, 1);
            listbox.Items.Add("(全选)", allitem.ToString());
            foreach (DictionaryItem item in itemslist)
            {
                listbox.Items.Add(item.DictionaryItemName, item.DictionaryItemValue);
            }
            listbox.ClientSideEvents.SelectedIndexChanged = "OnListBoxSelectionChanged";
            container.Controls.Add(listbox);
        }
Example #13
0
    /// <summary>
    /// 绑定产品ID号信息
    /// </summary>
    public void BindProId()
    {
        if (cmbWorkPlace.SelectedIndex < 0)
        {
            return;
        }

        //DataTable dtProId = CommonFunction.GetLotWorkProId(cmbWorkPlace.SelectedItem.Value.ToString());
        DataTable dtProId = CommonFunction.GetProId();

        ASPxListBox proidListBox = (ASPxListBox)checkComboBox.FindControl("lbx_proid");

        foreach (DataRow drItem in dtProId.Rows)
        {
            ListEditItem listEditItem = new ListEditItem();
            listEditItem.Text  = Convert.ToString(drItem["PRODUCT_CODE"]);
            listEditItem.Value = Convert.ToString(drItem["PRODUCT_CODE"]);
            proidListBox.Items.Add(listEditItem);
        }
        ViewState["dtProId"] = dtProId;
        ListEditItem listItem = new ListEditItem();

        listItem.Text  = "(Select All)";
        listItem.Value = string.Empty;
        proidListBox.Items.Insert(0, listItem);
    }
Example #14
0
        protected void GRID_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxGridView grid          = (ASPxGridView)sender;
            ASPxTextBox  txtNombre     = (ASPxTextBox)grid.FindEditFormTemplateControl("ASPxNombre");
            ASPxListBox  cmbMateriales = (ASPxListBox)grid.FindEditFormTemplateControl("ASPxListBox");

            MATERIAL newKit = new MATERIAL();

            newKit.M_NOMBRE              = txtNombre.Text;
            newKit.M_TIPO                = "Kit";
            newKit.M_MEDIDA_COMPRA       = 1;
            newKit.M_MEDIDA_DISTRIBUCION = 1;
            newKit.M_STOCK_BAJO          = 1;
            newKit.M_STOCK_IDEAL         = 100;
            newKit.M_STOCK_REAL          = 0;

            CRUD_Material.Create(newKit);
            int kit_id = CRUD_Material.Read(newKit.M_NOMBRE);

            foreach (ListEditItem item in cmbMateriales.Items)
            {
                MATERIAL_KIT mat = new MATERIAL_KIT();
                mat.M_ID        = kit_id;
                mat.MAT_M_ID    = CRUD_Material.Read(item.Value.ToString());
                mat.MK_CANTIDAD = 1;

                CRUD_Kit.Create(mat);
            }

            e.Cancel = true;
            grid.CancelEdit();
        }
 private void PopulateResourceEditors(Appointment apt, AppointmentFormTemplateContainer container)
 {
     if (ResourceSharing)
     {
         ASPxListBox edtMultiResource = ddResource.FindControl("edtMultiResource") as ASPxListBox;
         if (edtMultiResource == null)
         {
             return;
         }
         SetListBoxSelectedValues(edtMultiResource, apt.ResourceIds);
         List <String> multiResourceString = GetListBoxSeletedItemsText(edtMultiResource);
         string        stringResourceNone  = SchedulerLocalizer.GetString(SchedulerStringId.Caption_ResourceNone);
         ddResource.Value = stringResourceNone;
         if (multiResourceString.Count > 0)
         {
             ddResource.Value = String.Join(", ", multiResourceString.ToArray());
         }
         ddResource.JSProperties.Add("cp_Caption_ResourceNone", stringResourceNone);
     }
     else
     {
         if (!Object.Equals(apt.ResourceId, ResourceEmpty.Id))
         {
             edtResource.Value = apt.ResourceId.ToString();
         }
         else
         {
             edtResource.Value = SchedulerIdHelper.EmptyResourceId;
         }
     }
 }
Example #16
0
        protected void Continuar(object sender, EventArgs e)
        {
            ASPxButton boton = (ASPxButton)sender;
            Control    main  = boton.Parent;

            ASPxListBox list = (ASPxListBox)main.FindControl("ASPxListBox1");

            if (list.Items.Count == 0)
            {
                return;
            }

            SOLICITUD_COMPRA compra = new SOLICITUD_COMPRA();

            compra.E_ID     = 1;
            compra.SC_FECHA = DateTime.Now;
            CRUD_SolicitudCompra.Create(compra);

            int id_compra = (Int32)CRUD_SolicitudCompra.getEnd().SC_ID;

            foreach (ListEditItem item in list.Items)
            {
                MATERIAL material = CRUD_Material.Read(item.Value.ToString(), 0);
                DETALLE_SOLICITUD_COMPRA detalle = new DETALLE_SOLICITUD_COMPRA();
                detalle.SC_ID        = id_compra;
                detalle.M_ID         = material.M_ID;
                detalle.DSC_CANTIDAD = material.M_STOCK_IDEAL - material.M_STOCK_REAL;

                CRUD_SolicitudCompraDetalle.Create(detalle);
            }

            Response.Redirect("SolicitudCompra.aspx", true);
        }
Example #17
0
        public static ASPxListBox ApplyDataSource(this ASPxListBox source, IEnumerable dataSource)
        {
            source.DataSource = dataSource;
            source.DataBindItems();

            return(source);
        }
Example #18
0
        protected void ASPxListBox1_Callback(object sender, CallbackEventArgsBase e)
        {
            string[] param  = e.Parameter.Split(',');
            string   type   = param[0];
            string   pline1 = ASPxComboBoxPline.SelectedItem.Value.ToString();
            //string pline1 = param[1];
            //string begindate1 = param[1] ;
            string      begindate1 = ASPxDateEdit1.Date.ToString("yyyy-MM-dd");
            ASPxListBox location   = sender as ASPxListBox;

            if (type == "ALL")
            {
                //大线和改制返修如何区分,根据计划制定人员?
                string sql = "select plan_code||'; '||plan_so||'; '||plan_qty||'; '||pline_code ID1 from data_plan where pline_code='" + pline1 + "' and (plan_type='C' or plan_type='D') and begin_date=to_date('" + begindate1 + "','yyyy-mm-dd') and  confirm_flag='Y' and bom_flag='N' and item_flag='N' and third_flag='N' and run_flag='N' order by plan_code";

                DataTable dt = dc.GetTable(sql);
                location.DataSource = dt;
                location.DataBind();
            }
            if (type == "ALLW")
            {
                string sql = "select plan_code||'; '||plan_so||'; '||plan_qty||'; '||pline_code ID1 from data_plan where pline_code='" + pline1 + "' and (plan_type='C' or plan_type='D') and confirm_flag='Y' and bom_flag='N' and item_flag='N' and third_flag='N' and run_flag='N' order by plan_code";

                DataTable dt = dc.GetTable(sql);
                location.DataSource = dt;
                location.DataBind();
            }
            string sql1 = "select rmes_id,plan_code,plan_so,plan_qty,pline_code from data_plan where pline_code='" + pline1 + "' and (plan_type='C' or plan_type='D') and begin_date=to_date('" + begindate1 + "','yyyy-mm-dd') and  confirm_flag='Y' and bom_flag='N' and item_flag='N' and third_flag='N' and run_flag='N' order by plan_code";

            ASPxListBoxLocation.DataSource = dc.GetTable(sql1);
            ASPxListBoxLocation.DataBind();
        }
Example #19
0
        //初始化JHDM
        //private void initJHDM()
        //{
        //    string sql = " select distinct b.PLAN_CODE||'--'||b.PLAN_SO AS PLAN_CODE,b.PLAN_SEQ,  b.PLAN_QTY,b.BEGIN_DATE from DATA_PLAN b "
        //        + " where b.BEGIN_DATE>=to_date('" + DTPicker1.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') and b.BEGIN_DATE<=to_date('" + DTPicker2.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') "
        //        + " AND  B.PLINE_CODE = rh_get_data('G','" + txtPCode.Text.Trim() + "','','','') ";
        //    //string sql = " select distinct b.PLAN_CODE, b.PLAN_SO ,b.PLAN_SEQ,  b.PLAN_QTY,b.BEGIN_DATE from DATA_PLAN b WHERE "
        //    //    + " b.BEGIN_DATE>=to_date('" + DTPicker1.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') and b.BEGIN_DATE<=to_date('" + DTPicker2.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') AND "
        //    //    + " B.PLINE_CODE in(select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "') ";
        //    if (txtSO.Text.Trim() != "")
        //    {
        //        sql += " AND b.PLAN_SO = '" + txtSO.Text.Trim() + "' ";
        //    }
        //    sql += " ORDER BY PLAN_CODE ";

        //    //sqlJhdm.SelectCommand = sql;
        //    //sqlJhdm.DataBind();

        //    DataTable dt = dc.GetTable(sql);
        //    listJhdm.DataSource = dt;
        //    listJhdm.DataBind();
        //}
        //使用callback初始化JHDM
        protected void listJhdm_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            ASPxListBox jhdmList = sender as ASPxListBox;

            string sql = " select distinct b.PLAN_CODE||'--'||b.PLAN_SO AS PLAN_CODE,b.PLAN_SEQ,  b.PLAN_QTY,b.BEGIN_DATE from DATA_PLAN b "
                         + " where b.BEGIN_DATE>=to_date('" + DTPicker1.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') and b.BEGIN_DATE<=to_date('" + DTPicker2.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') ";

            if (txtPCode.Text.Trim() != "")
            {
                sql += " AND b.PLINE_CODE = '" + txtPCode.Value.ToString() + "' ";
            }
            //string sql = " select distinct b.PLAN_CODE, b.PLAN_SO ,b.PLAN_SEQ,  b.PLAN_QTY,b.BEGIN_DATE from DATA_PLAN b WHERE "
            //    + " b.BEGIN_DATE>=to_date('" + DTPicker1.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') and b.BEGIN_DATE<=to_date('" + DTPicker2.Date.ToString("yyyy/MM/dd") + "','yyyy-MM-dd') AND "
            //    + " B.PLINE_CODE in(select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "') ";
            if (txtSO.Text.Trim() != "")
            {
                sql += " AND b.PLAN_SO = UPPER('" + txtSO.Text.Trim() + "') ";
            }
            sql += " ORDER BY PLAN_CODE ";

            //sqlJhdm.SelectCommand = sql;
            //sqlJhdm.DataBind();

            DataTable dt = dc.GetTable(sql);

            jhdmList.DataSource = dt;
            jhdmList.DataBind();
        }
Example #20
0
        protected void lbSelectedFields_SelectedIndexChanged(object sender, EventArgs e)
        {
            ASPxListBox _sender = (ASPxListBox)sender;

            txtFieldDispName.Text = _sender.SelectedItem.GetValue("DisplayName").ToString();
            cbFieldSort.Value     = _sender.SelectedItem.GetValue("Sort");
        }
Example #21
0
        public static void Popula_LST_Orcamentos(ASPxListBox oList, Int32 Nro_Oportunidade, object SessionLoginInfo)
        {
            //**************
            //* Declarações
            //**************
            List <Oportunidade_Orcamentos_Fields> oOrcamentos = new List <Oportunidade_Orcamentos_Fields>();
            Oportunidade_Orcamentos_Manager       oOportunidadeOrcamentosManager = new Oportunidade_Orcamentos_Manager(DBConnection.GetConnectionFromSession(SessionLoginInfo));
            string ItemText = string.Empty;

            //********************************************
            //* Obtem lista de orçamentos da oportunidade
            //********************************************
            oOrcamentos = oOportunidadeOrcamentosManager.GetRecords(Nro_Oportunidade);

            //************************
            //* Insere ítens na lista
            //************************
            if (!oOportunidadeOrcamentosManager.Error)
            {
                foreach (Oportunidade_Orcamentos_Fields oOrcamento in oOrcamentos)
                {
                    if (oOrcamento.data_orcamento != null)
                    {
                        ItemText  = "N° " + oOrcamento.PK_cod_orcamento;
                        ItemText += " - " + ObtemEstagioOrcamento(oOrcamento.estagio_orcamento);
                        ItemText += " (" + oOrcamento.data_orcamento.Value.ToString("dd/MM/yyyy") + ")";
                        oList.Items.Add(ItemText, oOrcamento.PK_cod_orcamento);
                    }
                }
            }
        }
Example #22
0
    protected void OnListBoxDataBinding(object sender, EventArgs e)
    {
        ASPxListBox listBox = sender as ASPxListBox;
        GridViewDataItemTemplateContainer container = (GridViewDataItemTemplateContainer)listBox.NamingContainer;

        Session["CategoryID"] = container.KeyValue;
        listBox.DataSource    = AccessDataSource1;
    }
        protected A_PAUserTemplate getSelectedDetail()
        {
            List <int>         TemplateItem       = new List <int>();
            List <int>         ItemSequence       = new List <int>();
            List <int>         TemplateSection    = new List <int>();
            List <decimal>     TemplateScore      = new List <decimal>();
            List <decimal>     TemplateAmount     = new List <decimal>();
            List <bool>        IsFirstReview      = new List <bool>();
            List <int>         FirstReviewUserID  = new List <int>();
            List <bool>        IsSecondReview     = new List <bool>();
            List <int>         SecondReviewUserID = new List <int>();
            List <bool>        IsMultiReview      = new List <bool>();
            List <List <int> > MultiReviewUserID  = new List <List <int> >();
            A_PAUserTemplate   PAUserTemplate     = new A_PAUserTemplate();

            for (int i = 0; i < gvList.Rows.Count; i++)
            {
                CheckBox cbsSelect = gvList.Rows[i].FindControl("cbSelect") as CheckBox;
                if (cbsSelect.Checked)
                {
                    TemplateItem.Add(int.Parse(gvList.DataKeys[i].Value.ToString()));
                    DropDownList ddlItemSequence = gvList.Rows[i].FindControl("ddlSequence") as DropDownList;
                    ItemSequence.Add(int.Parse(ddlItemSequence.SelectedValue.ToString()));
                    DropDownList ddlPASection = gvList.Rows[i].FindControl("ddlPASection") as DropDownList;
                    TemplateSection.Add(int.Parse(ddlPASection.SelectedValue.ToString()));
                    TextBox txtScore = gvList.Rows[i].FindControl("txtPAItemScore") as TextBox;
                    TemplateScore.Add(decimal.Parse(txtScore.Text.Trim()));
                    TextBox txtAmount = gvList.Rows[i].FindControl("txtPAItemAmount") as TextBox;
                    TemplateAmount.Add(decimal.Parse(txtAmount.Text.Trim()));
                    ASPxCheckBox ASPxcbFirstReview = gvList.Rows[i].FindControl("ASPxcbFirstReview") as ASPxCheckBox;
                    IsFirstReview.Add(ASPxcbFirstReview.Checked);
                    DropDownList ddlFirstReviewUserID = gvList.Rows[i].FindControl("ddlFirstReviewUserID") as DropDownList;
                    FirstReviewUserID.Add(int.Parse(ddlFirstReviewUserID.SelectedValue.ToString()));
                    ASPxCheckBox ASPxcbSecondReview = gvList.Rows[i].FindControl("ASPxcbSecondReview") as ASPxCheckBox;
                    IsSecondReview.Add(ASPxcbSecondReview.Checked);
                    DropDownList ddlSecondReviewUserID = gvList.Rows[i].FindControl("ddlSecondReviewUserID") as DropDownList;
                    SecondReviewUserID.Add(int.Parse(ddlSecondReviewUserID.SelectedValue.ToString()));
                    ASPxCheckBox ASPxcbMultiReview = gvList.Rows[i].FindControl("ASPxcbMultiReview") as ASPxCheckBox;
                    IsMultiReview.Add(ASPxcbMultiReview.Checked);
                    ASPxListBox albMultiReview = gvList.Rows[i].FindControl("albMultiReview") as ASPxListBox;
                    MultiReviewUserID.Add(getEachMultiReviewID(albMultiReview));
                }
            }
            PAUserTemplate.UserID                         = int.Parse(base.Request["UserID"]);
            PAUserTemplate.A_PATemplateItem               = TemplateItem;
            PAUserTemplate.A_Sequence                     = ItemSequence;
            PAUserTemplate.A_PATemplateSection            = TemplateSection;
            PAUserTemplate.A_PATemplateScore              = TemplateScore;
            PAUserTemplate.A_PATemplateAmount             = TemplateAmount;
            PAUserTemplate.A_PATemplateIsFirstReview      = IsFirstReview;
            PAUserTemplate.A_PATemplateFirstReviewUserID  = FirstReviewUserID;
            PAUserTemplate.A_PATemplateIsSecondReview     = IsSecondReview;
            PAUserTemplate.A_PATemplateSecondReviewUserID = SecondReviewUserID;
            PAUserTemplate.A_PATemplateIsMultiReview      = IsMultiReview;
            PAUserTemplate.A_PATemplateMultiReviewUserID  = MultiReviewUserID;
            return(PAUserTemplate);
        }
 private void AddListBoxItems(ASPxListBox listBox, XmlNodeList games, string filteringString)
 {
     foreach (XmlNode game in games)
     {
         string gameNameAndYear = string.Format("{0} ({1})", game.Attributes["name"].Value, game.Attributes["year"].Value);
         string itemText        = GetItemText(gameNameAndYear, filteringString);
         listBox.Items.Add(itemText);
     }
 }
 private void moveItems(ASPxListBox targetlistBox, ASPxListBox sourcelistBox)
 {
     for (int i = 0; i < sourcelistBox.SelectedItems.Count; i++)
     {
         targetlistBox.Items.Add(sourcelistBox.SelectedItems[i]);
     }
     targetlistBox.UnselectAll();
     sourcelistBox.UnselectAll();
 }
        protected List <int> getEachMultiReviewID(ASPxListBox listbox)
        {
            List <int> eachReviewID = new List <int>();

            for (int i = 0; i < listbox.SelectedItems.Count; i++)
            {
                eachReviewID.Add(int.Parse(listbox.SelectedValues[i].ToString()));
            }
            return(eachReviewID);
        }
 protected override void OnInit(EventArgs e)
 {
     //ASPxListBox lbTransactionTypes = (ASPxListBox)ComboTransactionType.FindControl("lbTransactionTypes");
     LBTTYPES = (ASPxListBox)ComboTransactionType.FindControl("lbTransactionTypes");
     if (IsRequiredField)
     {
         ComboTransactionType.SetValidation(this.ValidationGroup);
     }
     ComboTransactionType.DataBind();
 }
Example #28
0
        private void SaveTieuChuan(ASPxListBox lst, int idchucdanh, string proc)
        {
            int l = SqlHelper.ExecuteNonQuery(strconn, proc, 0, idchucdanh, 0, 2);

            foreach (ListEditItem sItem in lst.SelectedItems)
            {
                int id = Convert.ToInt32(sItem.Value.ToString());
                int n  = SqlHelper.ExecuteNonQuery(strconn, proc, 0, idchucdanh, id, 0);
            }
        }
Example #29
0
        protected void lbAvailable_callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            ASPxListBox lstBox = sender as ASPxListBox;

            DataSet ds = SqlHelper.ExecuteDataset(strconn, "[HRM_GET_KHOADAOTAO]", e.Parameter, 1, 1);

            lstBox.DataSource = ds.Tables[0];
            lstBox.TextField  = "hoten";
            lstBox.ValueField = "id";
            lstBox.DataBind();
        }
        protected void Ingresar(object sender, EventArgs e)
        {
            ASPxButton boton = (ASPxButton)sender;
            Control    main  = boton.Parent;

            string encargado = "Bodega";
            Label  usuario   = (Label)main.Parent.Parent.FindControl("lblUsuario");

            if (usuario != null)
            {
                encargado = usuario.Text;
            }

            ASPxListBox  list      = (ASPxListBox)main.FindControl("ASPxListBox1");
            ASPxComboBox combo     = (ASPxComboBox)main.FindControl("ASPxComboBox1");
            string       id_compra = ASPxComboBox1.SelectedItem.Value.ToString();

            if (list.Items.Count == 0)
            {
                return;
            }

            SOLICITUD_COMPRA compra = CRUD_SolicitudCompra.Read(Int32.Parse(id_compra));

            RECEPCION_MATERIAL recepcion = new RECEPCION_MATERIAL();

            recepcion.RM_ENCARGADO_RECEPCION = encargado;
            recepcion.RM_FECHA = DateTime.Now;
            CRUD_RecepcionMaterial.Create(recepcion);

            int id_recep = (Int32)CRUD_RecepcionMaterial.getEnd().RM_ID;

            foreach (ListEditItem item in list.Items)
            {
                MATERIAL material = CRUD_Material.Read(Int32.Parse(item.GetValue("M_ID").ToString()));
                DETALLE_RECEPCION_MATERIAL detalle = new DETALLE_RECEPCION_MATERIAL();
                detalle.RM_ID        = id_recep;
                detalle.M_ID         = material.M_ID;
                detalle.DRM_CANTIDAD = Int32.Parse(item.GetValue("D_CANTIDAD").ToString());

                CRUD_RecepcionMaterialDetalle.Create(detalle);
            }

            compra.E_ID = 2;
            CRUD_SolicitudCompra.Update(compra);

            COMPRA_RECEPCION ligar = new COMPRA_RECEPCION();

            ligar.SC_ID = compra.SC_ID;
            ligar.RM_ID = id_recep;
            CRUD_CompraRecepcion.Create(ligar);

            Response.Redirect("~/RecepcionMaterial.aspx");
        }
Example #31
0
        protected void UsedByServersListoBox_OnDataBinding(object sender, EventArgs e)
        {
            ASPxListBox lb = (ASPxListBox)sender;
            DataTable   dt = VSWebBL.ConfiguratorBL.TravelerBL.Ins.GetTravelerTestWhenScan();


            lb.DataSource = dt;
            lb.TextField  = "TestScanServer";
            lb.ValueField = "TestScanServer";
            lb.DataBind();
        }
Example #32
0
 protected void FillListBox(DevExpress.Web.ASPxHiddenField.ASPxHiddenField hf, ASPxListBox lb)
 {
     if (lb.Items.Count > 0)
     {
         object[] itemCollection = new object[lb.Items.Count];
         int i = 0;
         foreach (ListEditItem item in lb.Items)
         {
             itemCollection[i] = item.GetValue("Task").ToString() + ";" + item.GetValue("Param").ToString();
             i++;
         }
         hf["LoadDataList"] = itemCollection;
     }
 }
Example #33
0
        /// <summary>
        /// Binds the DataTable to Listbox with given value and text fields
        /// </summary>
        /// <param name="lstBox">Name of the Listbox to process</param>
        /// <param name="dt">DataTable to Bind</param>
        /// <param name="strValue">Value field name as string</param>
        /// <param name="strText">Text fiels name as string</param>
        public static void BindListBox(ASPxListBox lstBox, DataTable dt, string strValue, string strText)
        {
            //clsDataFunctionsBAL objFunctions = null;

            try
            {
                if (DataTableHasRows(dt))
                {
                    lstBox.DataSource = dt;
                    lstBox.ValueField = strValue;
                    lstBox.TextField = strText;
                    lstBox.DataBindItems();
                }
            }
            catch (Exception ex)
            {
                //objFunctions = new clsDataFunctionsBAL();
                //objFunctions.SaveErrorLog(ex.Message, m_strModule, MethodBase.GetCurrentMethod().Name);
            }
            finally
            {
                //objFunctions = null;
            }
        }
 void SetListBoxSelectedValues(ASPxListBox listBox, IEnumerable values)
 {
     listBox.Value = null;
     foreach(object value in values) {
         ListEditItem item = listBox.Items.FindByValue(value.ToString());
         if(item != null)
             item.Selected = true;
     }
 }
Example #35
0
 private TaskStruct GetTSFromGV(ASPxListBox lb)
 {
     TaskStruct res = new TaskStruct();
     return res;
 }
 List<String> GetListBoxSeletedItemsText(ASPxListBox listBox)
 {
     List<String> result = new List<string>();
     foreach(ListEditItem editItem in listBox.Items) {
         if(editItem.Selected)
             result.Add(editItem.Text);
     }
     return result;
 }
Example #37
0
        /// <summary>
        /// Gets the Values or Text of the Selected Items in the DropdownEdit
        /// </summary>
        /// <param name="DropdownEdit">DropdownEdit name in which we have to process</param>
        /// <param name="ListBoxName">Name of the Listbox within the Dropdown Edit</param>
        /// <param name="IsText">bool value to get Text or Value</param>
        /// <returns>Returns the Comma separated Value</returns>
        public static string GetListBoxSelectedData(ASPxListBox ListBoxName, bool IsText)
        {
            StringBuilder fieldNames = new StringBuilder();

            if (ListBoxName != null)
            {
                if (ListBoxName.SelectedItems.Count > 0)
                {
                    foreach (ListEditItem item in ListBoxName.SelectedItems)
                    {
                        fieldNames.Append((IsText == true ? item.Text.ToString() : item.Value.ToString()) + ",");
                    }
                    fieldNames.Remove(fieldNames.Length - 1, 1);
                }
            }
            return fieldNames.ToString();
        }