Пример #1
0
        static void Main(string[] args)
        {
            Batiment batiment1 = new Batiment("96 Jacques-Cartier", 3500, 3);

            Console.WriteLine(batiment1);
            Maison maison1 = new Maison("14 Adams", 850, 2, 4, "brique");

            Console.WriteLine(maison1);
            Entrepot entrepot1 = new Entrepot("123 boul. Industriel", 15000, 1, 8);

            Console.WriteLine(entrepot1);
        }
Пример #2
0
        private void remplirDGV1(Entrepot param)
        {
            DataTable d = new DataTable();

            d.Columns.Add("Id", typeof(int));

            dataGridView1.Refresh();

            foreach (Secteur unSecteur in param.GetAllSecteurs())
            {
                d.Rows.Add(unSecteur.IdSecteur);
            }
            dataGridView1.DataSource = d;
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Entrepot param2 = null;
            string   param  = comboBox1.Text;

            foreach (Entrepot unEntrepot in Entrepot.CollClasseEntrepot)
            {
                if (unEntrepot.IdEntrepot.ToString() == param)
                {
                    param2 = unEntrepot;
                    break;
                }
            }

            this.remplirDGVDernier(param2.GetLeDernier());
        }
Пример #4
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Entrepot param2 = null;
            string   param  = comboBox1.Text;

            foreach (Entrepot unEntrepot in Entrepot.CollClasseEntrepot)
            {
                if (unEntrepot.IdEntrepot.ToString() == param)
                {
                    param2 = unEntrepot;
                    break;
                }
            }

            remplirDGV1(param2);
        }
Пример #5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Entrepot E1 = new Entrepot(1);
            Entrepot E2 = new Entrepot(2);

            Secteur S1 = new Secteur(1);
            Secteur S2 = new Secteur(2);
            Secteur S3 = new Secteur(3);
            Secteur S4 = new Secteur(4);
            Secteur S5 = new Secteur(5);

            E1.AddSecteur(S1);
            E1.AddSecteur(S3);
            E2.AddSecteur(S2);
            E2.AddSecteur(S4);
            E2.AddSecteur(S5);

            foreach (Entrepot unentrepot in Entrepot.CollClasseEntrepot)
            {
                comboBox1.Items.Add(unentrepot.IdEntrepot);
            }
        }
Пример #6
0
        public async Task <IHttpActionResult> EditEntrePose(EntrpotInDto entrpotInDto)
        {
            try
            {
                var Entrepot = new Entrepot {
                    Id = entrpotInDto.Id
                };
                db.Entry(Entrepot).State = System.Data.Entity.EntityState.Unchanged;
                if (!string.IsNullOrWhiteSpace(entrpotInDto.EntrepotName))
                {
                    Entrepot.EntrepotName = entrpotInDto.EntrepotName;
                }
                if (entrpotInDto.User_id != null)
                {
                    Entrepot.User_id = entrpotInDto.User_id;
                }
                if (!string.IsNullOrWhiteSpace(entrpotInDto.EntrepotDes))
                {
                    Entrepot.EntrepotDes = entrpotInDto.EntrepotDes;
                }
                if (!string.IsNullOrWhiteSpace(entrpotInDto.EntrepotAddress))
                {
                    Entrepot.EntrepotAddress = entrpotInDto.EntrepotAddress;
                }
                if (await db.SaveChangesAsync() > 0)
                {
                    return(Json(new { code = 200, msg = "修改成功" }));
                }

                return(Json(new { code = 201, msg = "修改失败" }));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #7
0
        public async Task <IHttpActionResult> RemoveEntrePose(EntrpotInDto entrpotInDto)
        {
            try
            {
                foreach (var item in entrpotInDto.del_Id)
                {
                    var Entrepot = new Entrepot {
                        Id = item
                    };
                    db.Entry(Entrepot).State = System.Data.Entity.EntityState.Unchanged;
                    Entrepot.del_Enpto       = 1;
                }

                if (await db.SaveChangesAsync() > 0)
                {
                    return(Json(new { code = 200, msg = "删除成功" }));
                }
                return(Json(new { code = 201, msg = "删除失败" }));
            }
            catch (Exception)
            {
                throw;
            }
        }