Example #1
0
        private void CBTruckNo_TextChanged(object sender, EventArgs e)
        {
            if (!CBTruckNo.Text.Trim().Equals(""))
            {
                ClearValue();
                CBOwner.Text = weighingLogic.GetOwner(CBTruckNo.Text);
                DataTable dt = new DataTable();
                if (CBTruckNo.SelectedValue != null)
                {
                    dt = weighingLogic.FindWeighingInfo(style, CBTruckNo.SelectedValue.ToString());
                    if ((dt != null) && (dt.Rows.Count > 0))
                    {
                        //CBTruckNo.Text = dt.Rows[0]["no"].ToString();
                        CBContract.Text          = dt.Rows[0]["ContractName"].ToString();
                        CBName.Text              = dt.Rows[0]["goodsName"].ToString() + dt.Rows[0]["goodsModel"].ToString();
                        CBTransportContract.Text = dt.Rows[0]["transportinfo"].ToString();
                        CBSite1.Text             = dt.Rows[0]["site1"].ToString();
                        CBSite2.Text             = dt.Rows[0]["site2"].ToString();
                        lblGrossWeight.Text      = dt.Rows[0]["grossWeight"].ToString();
                        lblTare.Text             = dt.Rows[0]["tare"].ToString();
                        lblSuttle.Text           = dt.Rows[0]["suttle"].ToString();
                        CBBarCode.Text           = dt.Rows[0]["barCode"].ToString();
                        switch (style)
                        {
                        //case WeighingStyle.InStyle:
                        //    textAsphaltum.Text = dt.Rows[0]["asphaltumSuttle"].ToString();
                        //    break;
                        case WeighingStyle.OutStyle:
                            CBProjectName.Text = dt.Rows[0]["projectName"].ToString() + dt.Rows[0]["position"].ToString();
                            CBSB.Text          = dt.Rows[0]["equipmentName"].ToString();
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            else
            {
                CBOwner.Text = "";
            }
        }
Example #2
0
        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            if (radioButton2.Checked)
            {
                //label1.ForeColor = Color.Tomato;
                style                   = WeighingStyle.InStyle;
                CBSB.Enabled            = false;
                CBProjectName.Enabled   = false;
                CBWarehouseInfo.Enabled = true;
                CBBatchNumber.Enabled   = true;
                RadioChanged();
                ClearValue();
                CBTruckNo.SelectedIndex = -1;
                this.BackgroundImage    = DasherStation.Properties.Resources._1;
                dt = weighingLogic.FindWeighingInfo(style, "");
                dataGridView1.DataSource = dt;
            }
        }