Exemplo n.º 1
0
        private void frmIsTakibi_Load(object sender, EventArgs e)
        {
            lblPrjAd.Text = projeAD;
            lblSurec.Text = prosesAD;
            Tarih();

            using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
            {
                List <Users>     users = db.Users.Where(k => k.UserRole > 2).ToList();
                List <RoleNames> rols  = db.RoleNames.ToList();
                foreach (var item in users)
                {
                    rols.Add(rols.Where(r => r.RoleNameID == item.UserRole).FirstOrDefault());
                }
                List <Users> n_users = new List <Users>();

                foreach (var y in users.Select(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault()))
                {
                    cmbAnaliz.Properties.Items.Add(y);
                    cmbTable.Properties.Items.Add(y);
                    cmbProc.Properties.Items.Add(y);
                    cmbDllL.Properties.Items.Add(y);
                    cmbDllIs.Properties.Items.Add(y);
                    cmbArayuz.Properties.Items.Add(y);
                    cmbT1.Properties.Items.Add(y);
                    cmbT2.Properties.Items.Add(y);
                    cmbT3.Properties.Items.Add(y);
                    cmbT4.Properties.Items.Add(y);
                    cmbT5.Properties.Items.Add(y);
                }
            }
        }
        private void btnSurecEkle_Click(object sender, EventArgs e)
        {
            using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
            {
                if (this.updateP == true)
                {
                    var upd_list = db.Process.Where(p => p.ProcessID == this.prosesID).FirstOrDefault();
                    upd_list.ProcessName  = txtSrcAd.Text;
                    upd_list.StartDate    = Convert.ToDateTime(lblBasDate.Text);
                    upd_list.FinishDate   = Convert.ToDateTime(lblEndDate.Text);
                    upd_list.Duration     = GunFarki(Convert.ToDateTime(lblBasDate.Text), Convert.ToDateTime(lblEndDate.Text));
                    upd_list.CompleteRate = Convert.ToInt32(nmbOran.Value);
                    upd_list.Priority     = Convert.ToInt32(cmbOncelik.Text);
                    upd_list.Descriptions = txtAciklama.Text;
                    upd_list.Notes        = txtNot.Text;
                    db.SaveChanges();
                    MessageBox.Show("Güncelleme işlemi Başarılı..");
                }
                else
                {
                    if (TxtKontrol())
                    {
                        Process process = new Process();
                        process.CreateUserID = kID;
                        process.ProcessName  = txtSrcAd.Text;
                        process.StartDate    = Convert.ToDateTime(lblBasDate.Text);
                        process.FinishDate   = Convert.ToDateTime(lblEndDate.Text);
                        process.Duration     = GunFarki(Convert.ToDateTime(lblBasDate.Text), Convert.ToDateTime(lblEndDate.Text));
                        process.CompleteRate = Convert.ToInt32(nmbOran.Value);
                        process.Priority     = Convert.ToInt32(cmbOncelik.Text);
                        process.Descriptions = txtAciklama.Text;
                        process.Notes        = txtNot.Text;
                        process.ProjectID    = pId;

                        UserProcess up = new UserProcess();
                        up.UsersID = kID;

                        if (this.prosesID != 0)
                        {
                            process.ParentID = this.prosesID;
                            up.ProcessID     = this.prosesID;
                            up.UserRolesID   = db.UserRoles.Where(u => u.UserID == kID).Select(r => r.UserRolesID).FirstOrDefault();
                        }
                        else
                        {
                            process.ParentID = 0;
                        }


                        db.Process.Add(process);
                        db.SaveChanges();
                        MessageBox.Show(process.ProcessName + " | Süreç Eklema Başarılı..");
                    }
                    else
                    {
                        MessageBox.Show("Boş Alanlar Mevcut..!");
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void CreateNodes(TreeList tl)
        {
            using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
            {
                List <Projects> projeler = new List <Projects>();
                projeler = db.Projects.Where(k => k.CreateUserID == kID).ToList();

                foreach (var item in projeler)
                {
                    tl.BeginUnboundLoad();
                    //  string surec=item.Process.Where(p=>p.ProjectID==item.ProjectID).Select(p=>p.ProcessName);
                    // Create a root node .
                    TreeListNode parentForRootNodes = null;
                    TreeListNode rootNode           = tl.AppendNode(
                        new object[] { item.ProjectName, item.Process.Count, item.Users1.UserName + " " + item.Users1.UserSurname, item.StartDate.Value.ToShortDateString(), item.FinishDate.Value.ToShortDateString(), Aktiflik(item.isActive.Value), item.Budget + " TL", item.ProjectID },
                        parentForRootNodes);

                    string[] prosses_header = { "Süreç Adı", "Tamamlanma Oranı" };
                    tl.AppendNode(prosses_header, rootNode);
                    for (int i = 0; i < item.Process.Count; i++)
                    {
                        tl.AppendNode(new object[] { i + 1 + "-) " + item.Process.ToList()[i].ProcessName, "Tamamlanma: %" + item.Process.ToList()[i].CompleteRate }, rootNode);
                    }



                    tl.EndUnboundLoad();
                }
            }
        }
Exemplo n.º 4
0
 private void frmMusteriPrjEkle_Load(object sender, EventArgs e)
 {
     dateBaslangic1.MinDate = DateTime.Now;
     dateBitis1.MinDate     = DateTime.Now.AddDays(1);
     lblBasDate.Text        = dateBaslangic1.MinDate.ToShortDateString();
     lblEndDate.Text        = dateBitis1.MinDate.ToShortDateString();
     using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
     {
         foreach (var y in db.Users.Where(k => k.UserRole == 2).Select(k => k.UserName + " " + k.UserSurname))
         {
             cmbProjeLider.Items.Add(y);
         }
     }
     using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
     {
         if (Pupdate == true)
         {
             dateBaslangic1.MinDate     = db.Projects.Where(p => p.ProjectID == IDupdate).Select(s => s.StartDate).FirstOrDefault().Value;
             txtPrjAd.BackColor         = Color.Yellow;
             txtPrjAd.Text              = db.Projects.Where(p => p.ProjectID == IDupdate).Select(s => s.ProjectName).FirstOrDefault();
             txtButce.Text              = db.Projects.Where(p => p.ProjectID == IDupdate).Select(s => s.Budget).FirstOrDefault().ToString();
             lblBasDate.Text            = db.Projects.Where(p => p.ProjectID == IDupdate).Select(s => s.StartDate).FirstOrDefault().Value.ToShortDateString();
             lblEndDate.Text            = db.Projects.Where(p => p.ProjectID == IDupdate).Select(s => s.FinishDate).FirstOrDefault().Value.ToShortDateString();
             dateBaslangic1.Value       = db.Projects.Where(p => p.ProjectID == IDupdate).Select(s => s.StartDate).FirstOrDefault().Value;
             dateBitis1.Value           = db.Projects.Where(p => p.ProjectID == IDupdate).Select(s => s.FinishDate).FirstOrDefault().Value;
             txtButce.BackColor         = Color.Yellow;
             cmbProjeLider.SelectedItem = db.Projects.Where(p => p.ProjectID == IDupdate).Select(y => y.Users1.UserName + " " + y.Users1.UserSurname).FirstOrDefault();
         }
     }
 }
Exemplo n.º 5
0
        private void btnSil_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode != null)
            {
                using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
                {
                    DevExpress.XtraTreeList.Nodes.TreeListNode node = treeList1.FocusedNode;
                    int PID = Convert.ToInt32(node.GetDisplayText(treeList1.VisibleColumns[7]));
                    if (MessageBox.Show(node.GetDisplayText(treeList1.VisibleColumns[0]) + "\nprojesini silmek istiyor musunuz?", "Proje Silme", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        /*Projects category = db.Projects.Where(c => c.ProjectID == PID).FirstOrDefault();
                         * db.Projects.DeleteOnSubmit(category);
                         * db.SubmitChanges();*/

                        Projects p = db.Projects.Single(c => c.ProjectID == PID);
                        db.Projects.Remove(p);

                        db.SaveChanges();

                        this.Close();
                        frmMusteri m = new frmMusteri(this.kAd);
                        m.Show();
                    }
                    else
                    {
                    }
                }
            }
            else
            {
                MessageBox.Show("Lütfen Bir Proje Seçiniz..");
            }
        }
Exemplo n.º 6
0
        private void btnAltSurecEkle_Click(object sender, EventArgs e)
        {
            if (lstProsses.SelectedItems.Count != 0)
            {
                int seciliid = lstProsses.Items.IndexOf(lstProsses.SelectedItems[0]);

                string prosesAd = lstProsses.Items[seciliid].Text;

                int seciliPrjID = Convert.ToInt32(lstProsses.Items.IndexOf(lstProsses.FocusedItem));
                int prosesId    = Convert.ToInt32(lstProsses.Items[seciliPrjID].SubItems[8].Text);

                YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1();
                if (db.Process.Where(p => p.ProcessID == prosesId).Select(pro => pro.ParentID).FirstOrDefault() != 0)
                {
                    MessageBox.Show("Seçilen süreç zaten 'alt süreç' olarak sistemde mevcut..");
                }
                else
                {
                    this.Close();
                    frmProssesEkle pr = new frmProssesEkle(kID, prosesAd, prjID, prosesId);
                    pr.Show();
                }
            }
            else
            {
                MessageBox.Show("Bir Süreç Seçiniz..!");
            }
        }
Exemplo n.º 7
0
        public bool kayit(string adi, string soyadi, string kullaniciAdi, string sifre, string kullaniciRolu, DateTime tarih)
        {
            using (YazilimYonetimAraciEntities1 smt = new YazilimYonetimAraciEntities1())
            {
                Users user = new Users();

                string kAdi = smt.Users.Where(w => w.UserNickname == kullaniciAdi).Select(s => s.UserNickname).FirstOrDefault();
                if (kAdi != null)
                {
                    return(false);
                }
                else
                {
                    user.UserName        = adi;
                    user.UserSurname     = soyadi;
                    user.UserNickname    = kullaniciAdi;
                    user.UserPassword    = sifre;
                    user.UserRole        = Convert.ToInt32(smt.RoleNames.Where(k => k.RoleName == kullaniciRolu).Select(k => k.RoleNameID).FirstOrDefault());
                    user.UserCreatedDate = tarih;
                    smt.Users.Add(user);
                    smt.SaveChanges();

                    //rol kayıt
                    UserRoles ur = new UserRoles();
                    ur.UserID     = user.UsersID;
                    ur.RoleNameID = user.UserRole;
                    smt.UserRoles.Add(ur);
                    smt.SaveChanges();
                    return(true);
                }
            }
        }
Exemplo n.º 8
0
        private void btnlLogin_Click(object sender, EventArgs e)
        {
            using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
            {
                string currentnick = db.Users.Where(k => k.UserNickname == txtNick.Text && k.UserPassword == txtPass.Text).Select(s => s.UserNickname).FirstOrDefault();
                string currentpass = db.Users.Where(k => k.UserNickname == txtNick.Text && k.UserPassword == txtPass.Text).Select(s => s.UserPassword).FirstOrDefault();
                if (currentnick == txtNick.Text && currentpass == txtPass.Text)
                {
                    int rol = db.Users.Where(k => k.UserNickname == txtNick.Text && k.UserPassword == txtPass.Text).Select(s => s.UserRole).FirstOrDefault().Value;
                    if (rol == 1)
                    {
                        frmMusteri musteri = new frmMusteri(txtNick.Text, this);
                        musteri.Show();
                    }
                    else if (rol == 2)
                    {
                        frmYonetici yonetici = new frmYonetici(txtNick.Text, this);
                        yonetici.Show();
                    }
                    else if (rol > 2)
                    {
                        Log.Giris(txtNick.Text, db.Users.Where(k => k.UserNickname == txtNick.Text).Select(s => s.UsersID).FirstOrDefault());

                        frmCalisan calisan = new frmCalisan(txtNick.Text, this);
                        Log.LogEkle("\n<< Çalışan Ekranına Girildi >>\n");
                        calisan.Show();
                    }
                }

                else
                {
                    MessageBox.Show("Böyle Bir Kullanıcı Yok");
                }
            }
        }
Exemplo n.º 9
0
        private void btnGeri_Click(object sender, EventArgs e)
        {
            this.Close();
            YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1();
            string     kad = db.Users.Where(k => k.UsersID == kID).Select(u => u.UserNickname).FirstOrDefault();
            frmMusteri MUS = new frmMusteri(kad);

            MUS.Show();
        }
Exemplo n.º 10
0
        public frmMusteri(string kullaniciAdi)
        {
            YazilimYonetimAraciEntities1 DB = new YazilimYonetimAraciEntities1();

            kID      = DB.Users.Where(k => k.UserNickname == kullaniciAdi).Select(k => k.UsersID).FirstOrDefault();
            this.kAd = kullaniciAdi;
            InitializeComponent();
            CreateColumns(treeList1);
            CreateNodes(treeList1);
        }
Exemplo n.º 11
0
 private void Kayit_Load(object sender, EventArgs e)
 {
     using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
     {
         foreach (var item in db.RoleNames)
         {
             cmbKullaniciRol.Items.Add(item.RoleName);
         }
     }
 }
Exemplo n.º 12
0
        private void chxAktiflik_CheckedChanged(object sender, EventArgs e)
        {
            int seciliPrjID = Convert.ToInt32(lstProsses.Items.IndexOf(lstProsses.FocusedItem));

            YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1();
            var upd_list = db.Projects.Where(p => p.ProjectID == prjID).FirstOrDefault();

            upd_list.isActive     = chxAktiflik.Checked;
            chxAktiflik.ForeColor = upd_list.isActive.Value ? Color.Green : Color.Red;
            db.SaveChanges();
        }
Exemplo n.º 13
0
        private void ListeDoldur()
        {
            using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
            {
                List <Process> surecler = new List <Process>();
                surecler = db.Process.Where(k => k.ProjectID == prjID).ToList();

                List <Process> ana_surecler = new List <Process>();
                ana_surecler = db.Process.Where(k => k.ProjectID == prjID && k.ParentID == 0).ToList();

                chxAktiflik.Checked = db.Projects.Where(p => p.ProjectID == prjID).Select(s => s.isActive.Value).FirstOrDefault();

                int gecici = 0;
                for (int i = 0; i < ana_surecler.Count; i++)
                {
                    List <Process> alt_surecler = new List <Process>();
                    alt_surecler = surecler.Where(p => p.ParentID == ana_surecler[i].ProcessID).ToList();

                    lstProsses.Items.Add(ana_surecler[i].ProcessName);
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].StartDate.Value.ToShortDateString());
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].FinishDate.Value.ToShortDateString());
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].Duration.ToString());
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].CompleteRate.ToString());
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].Priority.ToString());
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].Notes);
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].Descriptions);
                    lstProsses.Items[i + gecici].SubItems.Add(ana_surecler[i].ProcessID.ToString());


                    //ALT SÜREÇLER
                    if (alt_surecler != null)
                    {
                        for (int j = 0; j < alt_surecler.Count; j++)
                        {
                            lstProsses.Items.Add("      " + alt_surecler[j].ProcessName);
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].StartDate.Value.ToShortDateString());
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].FinishDate.Value.ToShortDateString());
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].Duration.ToString());
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].CompleteRate.ToString());
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].Priority.ToString());
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].Notes);
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].Descriptions);
                            lstProsses.Items[i + gecici + 1].SubItems.Add(alt_surecler[j].ProcessID.ToString());

                            gecici++;
                        }
                    }
                }
            }
        }
Exemplo n.º 14
0
 public bool girisKontrol(string kullaniciAdi, string sifre)
 {
     using (YazilimYonetimAraciEntities1 smt = new YazilimYonetimAraciEntities1())
     {
         string kAdi = smt.Users.Where(w => w.UserNickname == kullaniciAdi).Select(s => s.UserNickname).FirstOrDefault();
         string sfr  = smt.Users.Where(w => w.UserPassword == sifre).Select(s => s.UserPassword).FirstOrDefault();
         if (kAdi == null || sfr == null)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }
Exemplo n.º 15
0
        private void btnDegistir_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (treeList1.FocusedNode != null)
            {
                using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
                {
                    DevExpress.XtraTreeList.Nodes.TreeListNode node = treeList1.FocusedNode;
                    int PID = Convert.ToInt32(node.GetDisplayText(treeList1.VisibleColumns[7]));

                    this.Close();
                    frmMusteriPrjEkle pupdate = new frmMusteriPrjEkle(kID, true, PID);
                    pupdate.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Lütfen Bir Proje Seçiniz..");
            }
        }
Exemplo n.º 16
0
        public frmProssesEkle(int kID, string projead, int pId, int prosesID, bool up)
        {
            InitializeComponent();
            this.kID        = kID;
            lblProjeAd.Text = projead;
            this.pId        = pId;
            this.prosesID   = prosesID;
            this.updateP    = up;
            YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1();

            txtSrcAd.Text = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.ProcessName).FirstOrDefault().ToString(); txtSrcAd.BackColor = Color.Yellow;

            lblBasDate.Text      = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.StartDate).FirstOrDefault().Value.ToShortDateString();
            dateBaslangic1.Value = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.StartDate).FirstOrDefault().Value;
            lblEndDate.Text      = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.FinishDate).FirstOrDefault().Value.ToShortDateString();
            dateBitis1.Value     = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.FinishDate).FirstOrDefault().Value;
            txtSure.Text         = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.Duration).FirstOrDefault().ToString(); txtSure.BackColor = Color.Yellow;
            nmbOran.Value        = Convert.ToDecimal(db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.CompleteRate).FirstOrDefault()); nmbOran.BackColor = Color.Yellow;
            cmbOncelik.Text      = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.Priority).FirstOrDefault().ToString(); cmbOncelik.BackColor = Color.Yellow;
            txtNot.Text          = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.Notes).FirstOrDefault(); txtNot.BackColor = Color.Yellow;
            txtAciklama.Text     = db.Process.Where(p => p.ProcessID == prosesID).Select(pr => pr.Descriptions).FirstOrDefault(); txtAciklama.BackColor = Color.Yellow;
            btnSurecEkle.Text    = "SÜREÇ GÜNCELLE";
        }
Exemplo n.º 17
0
        public static void Cikis()
        {
            cikis = DateTime.Now.ToString();
            using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
            {
                UserLogDetails ul  = new UserLogDetails();
                UserLogs       u_l = new UserLogs();
                ul.LogDate     = DateTime.Now;
                ul.UserLogName = "Giriş: " + giris + Environment.NewLine + " | Çıkış: " + cikis + Environment.NewLine;
                u_l.UserLogDetails.Add(ul);
                db.Users.Where(u => u.UsersID == CurrentID).FirstOrDefault().UserLogs.Add(u_l);

                db.SaveChanges();
            }


            yaz(log);

            log       = "";
            CurrentID = 0;
            giris     = "";
            cikis     = "";
        }
Exemplo n.º 18
0
        private void btnAltSurecDuzenle_Click(object sender, EventArgs e)
        {
            if (lstProsses.SelectedItems.Count != 0)
            {
                int seciliid = lstProsses.Items.IndexOf(lstProsses.SelectedItems[0]);

                string prosesAd = lstProsses.Items[seciliid].Text;

                int seciliPrjID = Convert.ToInt32(lstProsses.Items.IndexOf(lstProsses.FocusedItem));
                int prosesId    = Convert.ToInt32(lstProsses.Items[seciliPrjID].SubItems[8].Text);

                YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1();


                this.Close();
                frmProssesEkle pr = new frmProssesEkle(kID, prosesAd, prjID, prosesId, true);
                pr.Show();
            }
            else
            {
                MessageBox.Show("Bir Süreç Seçiniz..!");
            }
        }
Exemplo n.º 19
0
        private void btnKaydet_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (cmbKontrol())
            {
                using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
                {
                    //ANALİZ
                    WorkFollow wfAnaliz = new WorkFollow();
                    wfAnaliz.WorkFollowDetailsID = 1;
                    wfAnaliz.ProcessID           = prosesID;
                    wfAnaliz.StartDate           = dtAnaliz.Value;
                    wfAnaliz.FinishDate          = dtBAnaliz.Value;
                    wfAnaliz.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbAnaliz.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfAnaliz.CompleteRate = Convert.ToInt32(nmbAnaliz.Value);
                    db.WorkFollow.Add(wfAnaliz);
                    db.SaveChanges();

                    //TABLE
                    WorkFollow wfTable = new WorkFollow();
                    wfTable.WorkFollowDetailsID = 2;
                    wfTable.ProcessID           = prosesID;
                    wfTable.StartDate           = dtTable.Value;
                    wfTable.FinishDate          = dtBTable.Value;
                    wfTable.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbTable.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfTable.CompleteRate = Convert.ToInt32(nmbTable.Value);
                    db.WorkFollow.Add(wfTable);
                    db.SaveChanges();

                    //PROC
                    WorkFollow wfProc = new WorkFollow();
                    wfProc.WorkFollowDetailsID = 3;
                    wfProc.ProcessID           = prosesID;
                    wfProc.StartDate           = dtProc.Value;
                    wfProc.FinishDate          = dtBProc.Value;
                    wfProc.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbProc.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfProc.CompleteRate = Convert.ToInt32(nmbProc.Value);
                    db.WorkFollow.Add(wfProc);
                    db.SaveChanges();



                    //DLL LİSTE
                    WorkFollow wfDLLliste = new WorkFollow();
                    wfDLLliste.WorkFollowDetailsID = 4;
                    wfDLLliste.ProcessID           = prosesID;
                    wfDLLliste.StartDate           = dtDllL.Value;
                    wfDLLliste.FinishDate          = dtBDllL.Value;
                    wfDLLliste.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbDllL.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfDLLliste.CompleteRate = Convert.ToInt32(nmbDllL.Value);
                    db.WorkFollow.Add(wfDLLliste);
                    db.SaveChanges();

                    //DLL İŞLEM
                    WorkFollow wfDLLIslem = new WorkFollow();
                    wfDLLIslem.WorkFollowDetailsID = 5;
                    wfDLLIslem.ProcessID           = prosesID;
                    wfDLLIslem.StartDate           = dtDllI.Value;
                    wfDLLIslem.FinishDate          = dtBDllI.Value;
                    wfDLLIslem.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbDllIs.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfDLLIslem.CompleteRate = Convert.ToInt32(nmbDllI.Value);
                    db.WorkFollow.Add(wfDLLIslem);
                    db.SaveChanges();

                    //ARAYÜZ
                    WorkFollow wfArayuz = new WorkFollow();
                    wfArayuz.WorkFollowDetailsID = 6;
                    wfArayuz.ProcessID           = prosesID;
                    wfArayuz.StartDate           = dtArayuz.Value;
                    wfArayuz.FinishDate          = dtBArayuz.Value;
                    wfArayuz.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbArayuz.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfArayuz.CompleteRate = Convert.ToInt32(nmbArayuz.Value);
                    db.WorkFollow.Add(wfArayuz);
                    db.SaveChanges();

                    //TEST1
                    WorkFollow wfTest_1 = new WorkFollow();
                    wfTest_1.WorkFollowDetailsID = 7;
                    wfTest_1.ProcessID           = prosesID;
                    wfTest_1.StartDate           = dtT1.Value;
                    wfTest_1.FinishDate          = dtBT1.Value;
                    wfTest_1.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbT1.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfTest_1.CompleteRate = Convert.ToInt32(nmbT1.Value);
                    db.WorkFollow.Add(wfTest_1);
                    db.SaveChanges();

                    //TEST2
                    WorkFollow wfTest_2 = new WorkFollow();
                    wfTest_2.WorkFollowDetailsID = 8;
                    wfTest_2.ProcessID           = prosesID;
                    wfTest_2.StartDate           = dtT2.Value;
                    wfTest_2.FinishDate          = dtBT2.Value;
                    wfTest_2.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbT2.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfTest_2.CompleteRate = Convert.ToInt32(nmbT2.Value);
                    db.WorkFollow.Add(wfTest_2);
                    db.SaveChanges();

                    //TEST3
                    WorkFollow wfTest_3 = new WorkFollow();
                    wfTest_3.WorkFollowDetailsID = 9;
                    wfTest_3.ProcessID           = prosesID;
                    wfTest_3.StartDate           = dtT3.Value;
                    wfTest_3.FinishDate          = dtBT3.Value;
                    wfTest_3.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbT3.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfTest_3.CompleteRate = Convert.ToInt32(nmbT3.Value);
                    db.WorkFollow.Add(wfTest_3);
                    db.SaveChanges();


                    //TEST4
                    WorkFollow wfTest_4 = new WorkFollow();
                    wfTest_4.WorkFollowDetailsID = 10;
                    wfTest_4.ProcessID           = prosesID;
                    wfTest_4.StartDate           = dtT4.Value;
                    wfTest_4.FinishDate          = dtBT4.Value;
                    wfTest_4.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbT4.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfTest_4.CompleteRate = Convert.ToInt32(nmbT4.Value);
                    db.WorkFollow.Add(wfTest_4);
                    db.SaveChanges();

                    //TEST5
                    WorkFollow wfTest_5 = new WorkFollow();
                    wfTest_5.WorkFollowDetailsID = 11;
                    wfTest_5.ProcessID           = prosesID;
                    wfTest_5.StartDate           = dtT5.Value;
                    wfTest_5.FinishDate          = dtBT5.Value;
                    wfTest_5.UserID       = db.Users.Where(k => k.UserName + " " + k.UserSurname + " - " + db.RoleNames.Where(r => r.RoleNameID == k.UserRole).Select(ro => ro.RoleName).FirstOrDefault() == cmbT5.Text).Select(k => k.UsersID).FirstOrDefault();
                    wfTest_5.CompleteRate = Convert.ToInt32(nmbT5.Value);
                    db.WorkFollow.Add(wfTest_5);
                    db.SaveChanges();
                    MessageBox.Show("Kaydedildi...");
                }
            }
            else
            {
                MessageBox.Show("Lütfen Kişileri Boş Bırakmayın...");
            }
        }
Exemplo n.º 20
0
        private void btnProjeEkle_Click(object sender, EventArgs e)
        {
            if (Pupdate)
            {
                using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
                {
                    var currentuser = db.Users.Where(k => k.UsersID == kID).Select(k => k.UserName + " " + k.UserSurname).FirstOrDefault();
                    if (TxtKontrol())
                    {
                        Projects prj = db.Projects.Where(p => p.ProjectID == IDupdate).FirstOrDefault();
                        if (prj.Users1.UserName + " " + prj.Users1.UserSurname == cmbProjeLider.Text)
                        {
                            var currentprs = prj.Process;
                            prj.Process = currentprs;
                        }
                        prj.ProjectName   = txtPrjAd.Text;
                        prj.Budget        = Convert.ToDecimal(txtButce.Text);
                        prj.isActive      = false;
                        prj.CreateUserID  = kID;
                        prj.ProjectUserID = db.Users.Where(k => k.UserName + " " + k.UserSurname == cmbProjeLider.Text).Select(k => k.UsersID).FirstOrDefault();
                        prj.StartDate     = Convert.ToDateTime(lblBasDate.Text);
                        prj.FinishDate    = Convert.ToDateTime(lblEndDate.Text);

                        db.SaveChanges();
                        MessageBox.Show("Projeniz Başarıyla Güncellendi..\n" + "Proje Adı: " + prj.ProjectName + "\nMüşteri: " + currentuser.ToString() +
                                        "\nProje Yöneticisi: " + db.Users.Where(y => y.UsersID == prj.ProjectUserID).Select(k => k.UserName + " " + k.UserSurname).FirstOrDefault());
                    }
                    else
                    {
                        MessageBox.Show("Boş Alanlar Mevcut..!");
                    }
                }
            }
            else
            {
                using (YazilimYonetimAraciEntities1 db = new YazilimYonetimAraciEntities1())
                {
                    var currentuser = db.Users.Where(k => k.UsersID == kID).Select(k => k.UserName + " " + k.UserSurname).FirstOrDefault();
                    if (TxtKontrol())
                    {
                        Projects prj = new Projects();
                        prj.ProjectName   = txtPrjAd.Text;
                        prj.Budget        = Convert.ToDecimal(String.Format("{0:c}", txtButce.Text));
                        prj.isActive      = false;
                        prj.CreateUserID  = kID;
                        prj.ProjectUserID = db.Users.Where(k => k.UserName + " " + k.UserSurname == cmbProjeLider.Text).Select(k => k.UsersID).FirstOrDefault();
                        prj.StartDate     = Convert.ToDateTime(lblBasDate.Text);
                        prj.FinishDate    = Convert.ToDateTime(lblEndDate.Text);

                        db.Projects.Add(prj);
                        db.SaveChanges();
                        MessageBox.Show("İsteğiniz Başarıyla Eklendi..\n" + "Proje Adı: " + prj.ProjectName + "\nMüşteri: " + currentuser.ToString() +
                                        "\nProje Yöneticisi: " + db.Users.Where(y => y.UsersID == prj.ProjectUserID).Select(k => k.UserName + " " + k.UserSurname).FirstOrDefault());
                    }
                    else
                    {
                        MessageBox.Show("Boş Alanlar Mevcut..!");
                    }
                }
            }
        }