Esempio n. 1
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                idSave = int.Parse(SaveExp_DAL.quantityElement().Substring(3)) + 1;
                SaveExp newSaveEx = new SaveExp();
                newSaveEx.ID                 = IDS + idSave.ToString();
                newSaveEx.Ngay               = DateTime.Now.ToString();
                newSaveEx.Y                  = pbx_Object.Location.Y;
                newSaveEx.X                  = pbx_Object.Location.X;
                newSaveEx.Vt                 = float.Parse(khoicau.vt + "");
                newSaveEx.ThoiGian           = float.Parse(khoicau.time + "");
                newSaveEx.A                  = float.Parse(khoicau.a + "");
                newSaveEx.BanKinh            = float.Parse(khoicau.R + "");
                newSaveEx.KhoiLuongRiengVat  = float.Parse(khoiluongriengvat + "");
                newSaveEx.KhoiLuongRiengChat = float.Parse(khoiluongriengchatlong + "");

                bool result = SaveExp_BUL.InsertSave(newSaveEx);

                if (result)
                {
                    MessageBox.Show("Save success!", "Notice");
                }
                else
                {
                    MessageBox.Show("Fail", "Notice");
                }
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
                MessageBox.Show("Invalid dang an oshi!");
            }
        }
        public static bool InsertSave(SaveExp saveExp)
        {
            /*Call method insert city into THANHPHO_DAL layer*/
            bool result = SaveExp_DAL.InsertSave(saveExp);

            return(result);
        }
        public static bool DeleteSave(string id)
        {
            bool result = SaveExp_DAL.DeleteSave(id);

            return(result);
        }
 public static List <SaveExp> LoadSave()
 {
     return(SaveExp_DAL.LoadSave());
 }