Beispiel #1
0
        private void shpUpdate_Click(object sender, EventArgs e)
        {
            if (this.shpIdTxt.Text == "" || this.shpProTxt.Text == "" || this.comboBox2.Text == "")
            {
                MessageBox.Show("Insert the data");
            }
            else
            {
                ShipmentR i = new ShipmentR();

                i.ShipmentId       = Convert.ToInt32(this.shpIdTxt.Text);
                i.ShipmentProgress = Convert.ToInt32(this.shpProTxt.Text);
                i.Status           = this.comboBox2.GetItemText(this.comboBox2.SelectedItem);

                ShipmentRepository sr = new ShipmentRepository();
                if (sr.Update(i))
                {
                    List <ShipmentR> iList = sr.GetAllShipment();
                    this.dataGrid3.DataSource = iList;

                    this.shpIdTxt.Text  = "";
                    this.shpProTxt.Text = "";
                    this.comboBox2.Text = "";
                }
                else
                {
                    MessageBox.Show("Can Not Update Shipment", "Update Error");
                }
            }
        }