Exemple #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (!AllowExit)
     {
         DialogResult dialogResult = RtlMessageBox.Show("آیا اطمینان از ثبت اطلاعات در دیتا بیس را دارید؟", "تاییدیه ثبت ", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             label3.Text      = "در حال ثبت در دیتابیس";
             label3.ForeColor = Color.Navy;
             button3.Enabled  = false;
             button4.Enabled  = false;
             Bg.RunWorkerAsync();
         }
         else if (dialogResult == DialogResult.No)
         {
         }
     }
     else
     {
         this.Close();
     }
 }
Exemple #2
0
        private void btnEnteshar_Click(object sender, EventArgs e)
        {
            if (!AllowExit)
            {
                btnEnteshar.Enabled = false;
                btnCancel.Enabled   = false;
                listRes             = new List <RestaurantContract>()
                {
                    new RestaurantContract()
                    {
                        Restaurant = 28, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 29, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 32, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 38, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 40, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 41, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 42, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 44, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 49, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 50, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 51, Contract = 2021
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 35, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 27, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 30, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 31, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 33, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 34, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 37, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 36, Contract = 2022
                    },
                    new RestaurantContract()
                    {
                        Restaurant = 53, Contract = 2022
                    }
                };



                listSchedules        = db.Schedules.Where(p => p.SDate.CompareTo(date) >= 0 & p.Meal_Id_Fk != 3 & p.Restaurant_Id_Fk == 26).ToList();
                countTotal           = listRes.Count() * listSchedules.Count();
                progressBar1.Maximum = countTotal;
                int x = 0;

                DialogResult dialogResult = RtlMessageBox.Show("آیا اطمینان از ثبت اطلاعات در دیتا بیس را دارید؟", "تاییدیه ثبت ", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    lblNotification.Text      = "در حال ثبت در دیتابیس";
                    lblNotification.ForeColor = Color.Navy;

                    Bg.RunWorkerAsync();
                }
                else if (dialogResult == DialogResult.No)
                {
                }
            }

            else
            {
                this.Close();
            }
        }