Exemplo n.º 1
0
        public static void BuildComboDistinct(DropDownList zCombo, string TableName, string TextFiledName, string ValueFieldName, string OrderFieldName, string WhereString, string BlankText, string BlankValue)
        {
            ComboSourceFlow cmbFlow = new ComboSourceFlow();
            DataTable dt = cmbFlow.GetSourceDistinct(TableName, TextFiledName, ValueFieldName, OrderFieldName, WhereString);
            if (dt != null)
            {
                zCombo.Items.Clear();
                zCombo.DataSource = dt;
                zCombo.DataTextField = TextFiledName;
                zCombo.DataValueField = ValueFieldName;
                zCombo.DataBind();

                if (BlankText != null || BlankValue != null)
                {
                    ListItem itm = new ListItem(BlankText, BlankValue);
                    zCombo.Items.Insert(0, itm);
                }

            }
        }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ControlUtil.SetDblTextBox(this.txtCost);
            ControlUtil.SetDblTextBox(this.txtPrice);
            ControlUtil.SetIntTextBox(this.txtLeadtime);
            ControlUtil.SetIntTextBox(this.txtLeadtimePD);
            ControlUtil.SetDblTextBox(this.txtAge);
            ControlUtil.SetIntTextBox(this.txtLotSize);
            ControlUtil.SetIntTextBox(this.txtLotSizePD);
            ControlUtil.SetIntTextBox(this.txtPacksize);

            this.rbtOrderType.Items.Clear();
            this.rbtOrderType.Items.Add(new ListItem(Constz.OrderType.PO.Name, Constz.OrderType.PO.Code)); ;
            this.rbtOrderType.Items.Add(new ListItem(Constz.OrderType.PD.Name, Constz.OrderType.PD.Code));
            this.rbtOrderType.Items.Add(new ListItem(Constz.OrderType.AR.Name, Constz.OrderType.AR.Code));

            this.rbtIsVat.Items.Clear();
            this.rbtIsVat.Items.Add(new ListItem(Constz.VAT.Included.Name, Constz.VAT.Included.Code)); ;
            this.rbtIsVat.Items.Add(new ListItem(Constz.VAT.NotIncluded.Name, Constz.VAT.NotIncluded.Code));

            this.rbtIsDiscount.Items.Clear();
            this.rbtIsDiscount.Items.Add(new ListItem(Constz.Discount.Calculated.Name, Constz.Discount.Calculated.Code)); ;
            this.rbtIsDiscount.Items.Add(new ListItem(Constz.Discount.NotCalculated.Name, Constz.Discount.NotCalculated.Code));

            this.rbtIsEdit.Items.Clear();
            this.rbtIsEdit.Items.Add(new ListItem(Constz.Edit.Editable.Name, Constz.Edit.Editable.Code)); ;
            this.rbtIsEdit.Items.Add(new ListItem(Constz.Edit.DisEditable.Name, Constz.Edit.DisEditable.Code));

            this.rbtIsRefund.Items.Clear();
            this.rbtIsRefund.Items.Add(new ListItem(Constz.Refund.Yes.Name, Constz.Refund.Yes.Code)); ;
            this.rbtIsRefund.Items.Add(new ListItem(Constz.Refund.No.Name, Constz.Refund.No.Code));

            ComboSourceFlow TypeFlow = new ComboSourceFlow();
            this.cmbProductType.DataSource = TypeFlow.GetSource("PRODUCTTYPE", "NAME", "LOID", "NAME", "(TYPE = '" + Constz.ProductType.Type.FG.Code + "' OR TYPE = '" + Constz.ProductType.Type.Others.Code + "') AND ACTIVE = '" + Constz.ActiveStatus.Active + "' ");
            this.cmbProductType.DataTextField = "NAME";
            this.cmbProductType.DataValueField = "LOID";
            this.cmbProductType.DataBind();

            ComboSourceFlow UnitFlow = new ComboSourceFlow();
            this.cmbUnit.DataSource = UnitFlow.GetSource("UNIT", "NAME", "LOID", "NAME", "ACTIVE = '" + Constz.ActiveStatus.Active + "'  AND (TYPE = '" + Constz.UnitType.FG.Code + "' OR TYPE = '" + Constz.UnitType.ALL.Code + "')");
            this.cmbUnit.DataTextField = "NAME";
            this.cmbUnit.DataValueField = "LOID";
            this.cmbUnit.DataBind();

            ComboSourceFlow UnitPackFlow = new ComboSourceFlow();
            this.cmbUnitPack.DataSource = UnitPackFlow.GetSource("UNIT", "NAME", "LOID", "NAME", "ACTIVE = '" + Constz.ActiveStatus.Active + "' ");
            this.cmbUnitPack.DataTextField = "NAME";
            this.cmbUnitPack.DataValueField = "LOID";
            this.cmbUnitPack.DataBind();

            ComboSourceFlow ProduceGroupFlow = new ComboSourceFlow();
            this.cmbProduceGroup.DataSource = TypeFlow.GetSource("PRODUCEGROUP", "NAME", "LOID", "RANK", "");
            this.cmbProduceGroup.DataTextField = "NAME";
            this.cmbProduceGroup.DataValueField = "LOID";
            this.cmbProduceGroup.DataBind();

            ResetState(Convert.ToDouble(Request["loid"] == null ? "0" : Request["loid"]));
            getDataToGroup();
            CheckOrderType();
        }
    }
Exemplo n.º 3
0
        public static void BuildCombo(ComboBox zCombo, string TableName, string TextFiledName, string ValueFieldName, string OrderFieldName, string WhereString, string BlankText, string BlankValue)
        {
            ComboSourceFlow cmbFlow = new ComboSourceFlow();
            DataTable dt = cmbFlow.GetSource(TableName, TextFiledName, ValueFieldName, OrderFieldName, WhereString);
            if (dt != null)
            {
                //zCombo.Items.Clear(); UPDATE BY NANG
                if (BlankText != null || BlankValue != null)
                {
                    DataRow dRow = dt.NewRow();
                    dRow[TextFiledName] = BlankText;
                    dRow[ValueFieldName] = BlankValue;
                    dt.Rows.InsertAt(dRow, 0);
                }

                zCombo.DataSource = dt;
                zCombo.DisplayMember = TextFiledName;
                zCombo.ValueMember = ValueFieldName;
            }
        }