コード例 #1
0
        public void Update()
        {
            FunctionSummaryViewModel vm = DataContext as FunctionSummaryViewModel;

            if (vm != null && vm.Stats != null)
            {
                Chart.IsAutoFitEnabled = true;
                WorkChart.PlotY(vm.Stats.Samples.Select(s => s.Work));
                WaitChart.PlotY(vm.Stats.Samples.Select(s => s.Wait));
            }
            else
            {
                WorkChart.Plot(Array.Empty <double>(), Array.Empty <double>());
                WaitChart.Plot(Array.Empty <double>(), Array.Empty <double>());
            }
        }
コード例 #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            checkBox3.Enabled = false;
            checkBox4.Enabled = false;
            checkBox5.Enabled = false;
            checkBox6.Enabled = false;
            try
            {
                using (CCareMSEntities db = new CCareMSEntities())
                {
                    model.Name       = txtname.Text.Trim();
                    model.NationalID = txtNID.Text.Trim();
                    model.NIDPic     = ConvertFiltoByte(this.picbox.ImageLocation);

                    model.Email   = txtNID.Text.Trim();
                    model.Address = txtAddress.Text.Trim();


                    model.UserPic    = ConvertFiltoByte(this.userpic.ImageLocation);
                    model.Type       = type;
                    model.Experience = txtexperience.Text.Trim();
                    model.ExSalary   = txtexsal.Text.Trim();
                    model.Education  = txtedu.Text.Trim();
                    model.Mobile     = txtmobile.Text.Trim();
                    model.BirthDate  = datePicker.Value;
                    model.Status     = "Free";

                    model1.Username = Log.recby;


                    model1 = db.WorkCharts.Where(x => x.Username == model1.Username).FirstOrDefault();


                    db.Entry(model1).State = System.Data.Entity.EntityState.Modified;
                    db.Entry(model).State  = System.Data.Entity.EntityState.Modified;
                    db.SaveChanges();
                    MessageBox.Show("your profile is successfully updated");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Please change once more");
                throw;
            }
        }
コード例 #3
0
        private void btn_fri_CheckedChanged(object sender, EventArgs e)
        {
            model1.Username = Log.recby;
            using (CCareMSEntities db = new CCareMSEntities())
            {
                model1 = db.WorkCharts.Where(x => x.Username == model1.Username).FirstOrDefault();
                if (btn_sun.Checked)
                {
                    model1.Friday = "Booked";
                }
                else
                {
                    model1.Friday = "Free";
                }

                db.Entry(model1).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }
        }
コード例 #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     panelpro.Show();
     btn_haire.Enabled = true;
     btn_save.Show();
     try
     {
         if (dgvNannies.CurrentRow.Index != -1)
         {
             search = txtSearch1.Text;
             using (CCareMSEntities db = new CCareMSEntities())
             {
                 model1             = db.NannyDatas.Where(x => x.Username == search).FirstOrDefault();
                 model2             = db.WorkCharts.Where(x => x.Username == search).FirstOrDefault();
                 txt_n.Text         = model1.Name;
                 txtt.Text          = model1.Username;
                 txtBirth.Text      = Convert.ToString(model1.BirthDate);
                 txtedu.Text        = model1.Education;
                 txtem.Text         = model1.Email;
                 txtexperience.Text = model1.Experience;
                 txtexsal.Text      = model1.ExSalary;
                 NidPic.Image       = ConvertBytetoImage(model1.NIDPic);
                 userpic.Image      = ConvertBytetoImage(model1.UserPic);
                 txtmobile.Text     = model1.Mobile;
                 txtGen.Text        = model1.Gander;
                 if (model2.Saturday == "Free")
                 {
                     free = " Saturday";
                 }
                 if (model2.Sunday == "Free")
                 {
                     free = free + " Sunday";
                 }
                 if (model2.Monday == "Free")
                 {
                     free = free + " Monday";
                 }
                 if (model2.Tuesday == "Free")
                 {
                     free = free + " Tuesday";
                 }
                 if (model2.Wednesday == "Free")
                 {
                     free = free + " Wednesday";
                 }
                 if (model2.Thursday == "Free")
                 {
                     free = free + " Thursday";
                 }
                 if (model2.Friday == "Free")
                 {
                     free = free + " Friday";
                 }
                 txtFree.Text = free;
             }
         }
     }
     catch
     {
         MessageBox.Show("Something wrong happend");
     }
 }
コード例 #5
0
        private void NannyView_Load(object sender, EventArgs e)
        {
            model.Username  = Log.recby;
            model1.Username = Log.recby;
            preq.Hide();
            using (CCareMSEntities db = new CCareMSEntities())
            {
                model                 = db.NannyDatas.Where(x => x.Username == model.Username).FirstOrDefault();
                model1                = db.WorkCharts.Where(x => x.Username == model1.Username).FirstOrDefault();
                txtname.Text          = model.Name;;
                txtNID.Text           = model.NationalID;
                txtAddress.Text       = model.Address;
                txtemail.Text         = model.Email;
                userpic.Image         = ConvertBytetoImage(model.UserPic);
                picbox.Image          = ConvertBytetoImage(model.NIDPic);
                txtexsal.Text         = model.ExSalary;
                txtexperience.Text    = model.Experience;
                txtedu.Text           = model.Education;
                txtLabel.Text         = model.Username;
                txtt.Text             = model.Type;
                txtmobile.Text        = model.Mobile;
                txtname.Enabled       = false;
                txtNID.Enabled        = false;
                txtAddress.Enabled    = false;
                txtemail.Enabled      = false;
                userpic.Enabled       = false;
                picbox.Enabled        = false;
                txtexsal.Enabled      = false;
                txtexperience.Enabled = false;
                txtedu.Enabled        = false;
                txtLabel.Enabled      = false;
                txtt.Enabled          = false;
                checkBox3.Enabled     = false;
                checkBox4.Enabled     = false;
                checkBox5.Enabled     = false;
                checkBox6.Enabled     = false;
                btn_sat.Enabled       = false;
                btn_sun.Enabled       = false;
                btn_mon.Enabled       = false;
                btn_tues.Enabled      = false;
                btn_wed.Enabled       = false;
                btn_thurs.Enabled     = false;
                btn_fri.Enabled       = false;
                if (model1.Saturday == "Free")
                {
                    free = " Saturday";
                }
                if (model1.Sunday == "Free")
                {
                    free = free + " Sunday";
                }
                if (model1.Monday == "Free")
                {
                    free = free + " Monday";
                }
                if (model1.Tuesday == "Free")
                {
                    free = free + " Tuesday";
                }
                if (model1.Wednesday == "Free")
                {
                    free = free + " Wednesday";
                }
                if (model1.Thursday == "Free")
                {
                    free = free + " Thursday";
                }
                if (model1.Friday == "Free")
                {
                    free = free + " Friday";
                }
                txtFree.Text = free;
            }

            row1     = dgvrequest.RowCount;
            row.Text = Convert.ToString(row1);
        }