Esempio n. 1
0
        protected void rpDepartmentList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Update")
            {
                using (db = new novartz_stajyer1Entities())
                {
                    Guid id = Guid.Parse(e.CommandArgument.ToString());
                    VW_FIRMDEPARTMENT department = db.VW_FIRMDEPARTMENT.SingleOrDefault(t => t.ID == id);

                    RECID = department.ID;
                    hdnDepartmentID.Value   = e.CommandArgument.ToString();
                    txtUpdateFirm.Text      = department.FIRMNAME;
                    txtUpdateBranch.Text    = department.FIRMBRANCHNAME;
                    txtUpdateDeparment.Text = department.NAME;
                }
                ScriptManager.RegisterStartupScript(this, GetType(), "", "OpenModal()", true);

                upModalUpdate.Update();
            }
            else if (e.CommandName == "Delete")//Eğer buton Delete butonu ise bunu yapacak.
            {
                using (db = new novartz_stajyer1Entities())
                {
                    Guid           id         = Guid.Parse(e.CommandArgument.ToString());
                    FIRMDEPARTMENT department = db.FIRMDEPARTMENT.SingleOrDefault(t => t.ID == id); //SinglorDefault tek veri çekmek için kulladığımız deyim
                                                                                                    //FIRMBRANCH test = (from t in db.FIRMBRANCH where t.ID == id select t).SingleOrDefault();
                    db.FIRMDEPARTMENT.Remove(department);                                           //silmek için kullandın removeyi
                    db.SaveChanges();
                    FillDepartment();
                    UpdatePanel.Update();
                }
            }
        }
Esempio n. 2
0
        //Buraya Kadar Firmaları seçtikten sonra Şubeleri Daha Sonra Bölümleri Seçmemizi Sağladık
        protected void rpWorkingList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Update")
            {
                using (db = new novartz_stajyer1Entities())
                {
                    Guid id = Guid.Parse(e.CommandArgument.ToString());
                    VW_FIRMDEPARTMENTMEMBER departmentMember = db.VW_FIRMDEPARTMENTMEMBER.SingleOrDefault(t => t.ID == id);
                    RECID = departmentMember.ID;
                    hdnDepartmentID.Value = e.CommandArgument.ToString();
                    lblFirmUpdate.Text    = departmentMember.FIRMNAME;
                    lblPersonel.Text      = departmentMember.FULLNAME;
                    lblBranchUpdate.Text  = departmentMember.FIRMBRANCHNAME;
                    FillDrp(DrpDepartmentUpdate, db.VW_FIRMDEPARTMENT.Where(t => t.FIRMBRANCHID == departmentMember.FIRMBRANCHID).ToList(), "ID", "NAME", "Seçiniz");
                    DrpDepartmentUpdate.SelectedValue = departmentMember.FIRMDEPARTMENTID.ToString();//Drop  seçileceği zaman; seçilmeden önceki hangi bölüme ait ise o bölüm seçili olarak gelmesini sağlıyor.
                    departmentMember.ISACTIVE         = dropmdlcd.SelectedValue == "0";
                }
                ScriptManager.RegisterStartupScript(this, GetType(), "", "OpenModal()", true);

                upModalUpdate.Update();
            }
            else if (e.CommandName == "Delete")//Eğer buton Delete butonu ise bunu yapacak.
            {
                using (db = new novartz_stajyer1Entities())
                {
                    Guid id = Guid.Parse(e.CommandArgument.ToString());
                    FIRMDEPARTMENTMEMBER department = db.FIRMDEPARTMENTMEMBER.SingleOrDefault(t => t.MEMBERID == id); //SinglorDefault tek veri çekmek için kulladığımız deyim
                                                                                                                      //FIRMBRANCH test = (from t in db.FIRMBRANCH where t.ID == id select t).SingleOrDefault();
                    db.FIRMDEPARTMENTMEMBER.Remove(department);                                                       //silmek için kullandın removeyi
                    db.SaveChanges();
                    FillDepartment();
                    UpdatePanel.Update();
                }
            }
        }
Esempio n. 3
0
        protected void btnAddDepartment_Click(object sender, EventArgs e)
        {
            if (ValidateDepartment())
            {
                using (db = new novartz_stajyer1Entities())
                {
                    FIRMDEPARTMENT rec = null;

                    if (DEPARTMENTID != Guid.Empty)
                    {
                        rec = db.FIRMDEPARTMENT.SingleOrDefault(t => t.ID == DEPARTMENTID);
                    }
                    else
                    {
                        rec    = new FIRMDEPARTMENT();
                        rec.ID = Guid.NewGuid();
                    }
                    rec.FIRMID = RECID; rec.FIRMBRANCHID = Guid.Parse(drpDepBranch.SelectedValue);
                    rec.NAME   = txtDepName.Text;


                    if (DEPARTMENTID == Guid.Empty)
                    {
                        db.FIRMDEPARTMENT.Add(rec);
                    }
                    MessageBox("İşleminiz Başarılı");
                    db.SaveChanges();
                    InitPage(false);
                    upDepartment.Update();
                }
            }
        }
Esempio n. 4
0
        public void DepartmentRegistration(string name)// Bölüm eklemek için Oluşturduğumuz fonksiyon.
        {
            FIRMDEPARTMENT rec = null;

            using (db = new novartz_stajyer1Entities())
            {
                rec        = new FIRMDEPARTMENT();
                rec.ID     = Guid.NewGuid();
                rec.NAME   = name;
                rec.FIRMID = Guid.Parse(drpFirms.SelectedValue);

                if (!dvBranch.Visible || drpBranch.SelectedValue == "0")
                {
                    rec.FIRMBRANCHID = null;
                }
                else
                {
                    rec.FIRMBRANCHID = Guid.Parse(drpBranch.SelectedValue);
                }

                db.FIRMDEPARTMENT.Add(rec);
                db.SaveChanges();
                FillDepartment();
                upDepartmentList.Update();
            };
            MessageBox("İşleminiz Başarılı");
        }
Esempio n. 5
0
        protected void btnSaveFirmDepartmentMember_Click(object sender, EventArgs e)//Yeni çalışan ekle kısmını yaptım kayıt yapıyor seçilen kısıma..
        {
            if (ValidateRecord())
            {
                Guid   id     = Guid.NewGuid();
                MEMBER member = null;
                using (db = new novartz_stajyer1Entities())
                {
                    member = new MEMBER
                    {
                        NAME         = txtmdlName.Text,
                        SURNAME      = txtmdlSurname.Text,
                        LOGINNAME    = txtmdlMail.Text,
                        BIRDDATE     = Convert.ToDateTime(txtmdlBirtday.Text),
                        PHONE        = txtmdlPhone.Text,
                        PASWORD      = txtmdlPassword.Text,
                        GENDER       = Convert.ToBoolean(drpmdlGender.SelectedValue == "1"),//Bayan ise true olarak çalışıyor
                        TYPEMEMBERID = Convert.ToByte(drpmdltypmember.SelectedValue),
                        CANLOGIN     = true,
                        ID           = id
                    };
                    db.MEMBER.Add(member);
                    db.SaveChanges();
                };
                if (drpmdltypmember.SelectedValue == "3")
                {
                    FIRMRESPONSIBLE rsp = null;
                    using (db = new novartz_stajyer1Entities())
                    {
                        Guid id3 = Guid.NewGuid();
                        rsp = new FIRMRESPONSIBLE
                        {
                            ID       = id3,
                            FIRMID   = Guid.Parse(DrpFirm.SelectedValue),
                            MEMBERID = id
                        };
                        db.FIRMRESPONSIBLE.Add(rsp);
                        db.SaveChanges();
                    }
                }


                FIRMDEPARTMENTMEMBER rec = null;
                using (db = new novartz_stajyer1Entities())
                {
                    Guid id2 = Guid.NewGuid();
                    rec = new FIRMDEPARTMENTMEMBER
                    {
                        ID = id2,
                        FIRMDEPARTMENTID = Guid.Parse(DrpDepartment.SelectedValue),
                        ISACTIVE         = dropmdlcd.SelectedValue == "1",
                        MEMBERID         = id
                    };
                    db.FIRMDEPARTMENTMEMBER.Add(rec);
                    db.SaveChanges();
                };
                MessageBox("İşleminiz Başarılı");
            }
        }
Esempio n. 6
0
        protected void rpFirmBranchList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Update":
                if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
                {
                    using (db = new novartz_stajyer1Entities())
                    {
                        Guid selectedBranchID = Guid.Parse(e.CommandArgument.ToString());
                        lblBranchIsUpdate.Text = "Güncelleyiniz";
                        FIRMBRANCH rec = db.FIRMBRANCH.SingleOrDefault(t => t.ID == selectedBranchID);
                        if (rec != null)
                        {
                            FillDrp(drpBranchC, db.CITY.ToList(), "ID", "NAME");

                            txtBranchName.Text = rec.NAME;
                            txtBranchAddr.Text = rec.ADRESS;
                            txtBranchPho.Text  = rec.PHONE;
                            txtBranchEm.Text   = rec.EMAIL;
                            if (rec.CITYID.HasValue)
                            {
                                FillDrp(drpBranchCD, db.CITYDISTRICT.Where(t => t.CITYID == rec.CITYID).ToList(), "ID", "NAME", "Seçiniz");
                                drpBranchC.SelectedValue = rec.CITYID.ToString();
                            }
                            if (rec.CITYDISTRICTID.HasValue)
                            {
                                drpBranchCD.SelectedValue = rec.CITYDISTRICTID.ToString();
                            }

                            BRANCHID = selectedBranchID;
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenBranchModal", "$('#mdlNewBranch').modal('show');", true);
                            upMdlNewBranch.Update();
                        }
                    }
                }
                break;

            case "Delete":

                using (db = new novartz_stajyer1Entities())
                {
                    Guid selectedBranchID = Guid.Parse(e.CommandArgument.ToString());

                    FIRMBRANCH rec = db.FIRMBRANCH.SingleOrDefault(t => t.ID == selectedBranchID);
                    if (rec != null)
                    {
                        db.FIRMBRANCH.Remove(rec);
                        db.SaveChanges();
                        InitPage(false);
                        upMdlNewBranch.Update();
                    }
                }
                break;
            }
        }
Esempio n. 7
0
        protected void rpBranchList_ItemCommand(object source, RepeaterCommandEventArgs e)//Repaetr içindeki Butonları temsil eder...
        {
            if (e.CommandName == "Update")
            {
                using (db = new novartz_stajyer1Entities())
                {
                    Guid          id     = Guid.Parse(e.CommandArgument.ToString());
                    VW_FIRMBRANCH branch = db.VW_FIRMBRANCH.SingleOrDefault(t => t.ID == id);
                    RECID                = branch.ID;
                    hdnBranchID.Value    = e.CommandArgument.ToString();
                    txtBranchName.Text   = branch.NAME;
                    txtBranchPhone.Text  = branch.PHONE;
                    txtBranchAdress.Text = branch.ADRESS;
                    txtBranchMail.Text   = branch.EMAIL;
                    if (branch.CITYID.HasValue)
                    {
                        drpBranchCity.SelectedValue = branch.CITYID.ToString();
                        drpBranchCity_SelectedIndexChanged(null, null);
                        if (branch.CITYDISTRICTID.HasValue)
                        {
                            drpBranchDiscrit.SelectedValue = branch.CITYDISTRICTID.ToString();
                        }
                    }
                }
                ScriptManager.RegisterStartupScript(this, GetType(), "", "OpenModal()", true);
            }
            else if (e.CommandName == "Delete")//Eğer buton Delete butonu ise bunu yapacak.
            {
                using (db = new novartz_stajyer1Entities())
                {
                    Guid       id     = Guid.Parse(e.CommandArgument.ToString());
                    FIRMBRANCH branch = db.FIRMBRANCH.SingleOrDefault(t => t.ID == id); //SinglorDefault tek veri çekmek için kulladığımız deyim
                                                                                        //FIRMBRANCH test = (from t in db.FIRMBRANCH where t.ID == id select t).SingleOrDefault();
                    db.FIRMBRANCH.Remove(branch);                                       //silmek için kullandın removeyi
                    db.SaveChanges();
                    FillBranch();
                    UpdatePanel.Update();
                }
            }

            //else if (e.CommandName == "Delete")//Eğer buton Delete butonu ise bunu yapacak.
            //{
            //    using (db = new novartz_stajyer1Entities())
            //    {
            //        Guid id = Guid.Parse(e.CommandArgument.ToString());
            //        FIRMBRANCH branch = db.FIRMBRANCH.SingleOrDefault(t => t.ID == id);//SinglorDefault tek veri çekmek için kulladığımız deyim
            //                                                                           //FIRMBRANCH test = (from t in db.FIRMBRANCH where t.ID == id select t).SingleOrDefault();
            //        db.FIRMBRANCH.Remove(branch);//silmek için kullandın removeyi
            //        db.SaveChanges();
            //        FillBranch();
            //        UpdatePanel.Update();

            //    }
            //}
        }
Esempio n. 8
0
 protected void btnUpdateSaveServer_Click(object sender, EventArgs e)
 {
     using (db = new novartz_stajyer1Entities())
     {
         FIRMDEPARTMENT rec = db.FIRMDEPARTMENT.SingleOrDefault(t => t.ID == RECID);
         rec.NAME = txtUpdateDeparment.Text;
         db.SaveChanges();
         FillDepartment();
         UpdatePanel.Update();
     }
 }
Esempio n. 9
0
 protected void btnUpdateSaveServer_Click(object sender, EventArgs e)//Güncelleme Bölümünde kaydetme işlemini yaptık...
 {
     using (db = new novartz_stajyer1Entities())
     {
         FIRMDEPARTMENTMEMBER rec = db.FIRMDEPARTMENTMEMBER.SingleOrDefault(t => t.ID == RECID);
         rec.FIRMDEPARTMENTID = Guid.Parse(DrpDepartmentUpdate.SelectedValue);
         rec.ISACTIVE         = Convert.ToBoolean(DrpcdUpdate.SelectedValue == "1");
         db.SaveChanges();
         FillDepartment();
         UpdatePanel.Update();
     }
 }
Esempio n. 10
0
        protected void btnAddBranch_Click(object sender, EventArgs e)
        {
            if (ValidateBranch())
            {
                using (db = new novartz_stajyer1Entities())
                {
                    FIRMBRANCH rec = null;

                    if (BRANCHID != Guid.Empty)
                    {
                        rec = db.FIRMBRANCH.SingleOrDefault(t => t.ID == BRANCHID);
                    }
                    else
                    {
                        rec        = new FIRMBRANCH();
                        rec.ID     = Guid.NewGuid();
                        rec.FIRMID = RECID;
                    }
                    rec.NAME   = txtBranchName.Text;
                    rec.ADRESS = txtBranchAddr.Text;
                    rec.PHONE  = txtBranchPho.Text;
                    rec.EMAIL  = txtBranchEm.Text;

                    if (drpBranchC.SelectedValue == "0")
                    {
                        rec.CITYID = null;
                    }
                    else
                    {
                        rec.CITYID = Convert.ToByte(drpBranchC.SelectedValue);
                    }


                    if (drpBranchCD.SelectedValue == "0")
                    {
                        rec.CITYDISTRICTID = null;
                    }
                    else
                    {
                        rec.CITYDISTRICTID = Convert.ToInt16(drpBranchCD.SelectedValue);
                    }

                    if (BRANCHID == Guid.Empty)
                    {
                        db.FIRMBRANCH.Add(rec);
                    }
                    MessageBox("İşleminiz Başarılı");
                    db.SaveChanges();
                    InitPage(false);
                    upBranch.Update();
                }
            }
        }
Esempio n. 11
0
        public void BranchRegistration(string name)//******//
        {
            FIRMBRANCH rec = null;

            using (db = new novartz_stajyer1Entities())
            {
                rec = new FIRMBRANCH
                {
                    NAME   = name,
                    FIRMID = Guid.Parse(drpFirm.SelectedValue),
                    ID     = Guid.NewGuid()
                };
                db.FIRMBRANCH.Add(rec);
                db.SaveChanges();
            };
            MessageBox("İşleminiz Başarılı");
            FillBranch();
        }
Esempio n. 12
0
        protected void btnAddDepartmentMember_Click(object sender, EventArgs e)
        {
            if (ValidateDepartmentMember())
            {
                Guid   id     = Guid.NewGuid();
                MEMBER member = null;
                using (db = new novartz_stajyer1Entities())
                {
                    member = new MEMBER
                    {
                        NAME         = txtDepMemberName.Text,
                        SURNAME      = txtDepMemberSurname.Text,
                        LOGINNAME    = txtDepMemberEmail.Text,
                        BIRDDATE     = Convert.ToDateTime(txtDepMemberBirthday.Text),
                        PHONE        = txtDepMemberTelephone.Text,
                        PASWORD      = txtDepMemberPassword.Text,
                        CANLOGIN     = true,
                        GENDER       = drpDepMemberGender.SelectedValue == "1",
                        TYPEMEMBERID = 2,
                        ID           = id,
                    };
                    db.MEMBER.Add(member);
                    db.SaveChanges();
                };

                FIRMDEPARTMENTMEMBER rec = null;
                using (db = new novartz_stajyer1Entities())
                {
                    Guid id2 = Guid.NewGuid();
                    rec = new FIRMDEPARTMENTMEMBER
                    {
                        ID = id2,
                        FIRMDEPARTMENTID = Guid.Parse(drpDepMemberDepartment.SelectedValue),
                        ISACTIVE         = drpDepMemberStatus.SelectedValue == "1",
                        MEMBERID         = id
                    };
                    db.FIRMDEPARTMENTMEMBER.Add(rec);
                    db.SaveChanges();
                    InitPage(false);
                    upDepartmentMember.Update();
                };
                MessageBox("İşleminiz Başarılı");
            }
        }
Esempio n. 13
0
        protected void btnNewRandevu_Click(object sender, EventArgs e)
        {
            if (ValidateNewReservation())
            {
                RESERVATION rec = new RESERVATION();
                using (db = new novartz_stajyer1Entities())
                {
                    rec.ID       = Guid.NewGuid();
                    rec.MEMBERID = TEMPRESERVATION.MEMBERID;
                    rec.TYPERESERVATIONSTATUSID = TEMPRESERVATION.TYPERESERVATIONSTATUSID;
                    rec.FIRMDEPARTMENTMEMBERID  = TEMPRESERVATION.FIRMDEPARTMENTMEMBERID;
                    rec.DATE = TEMPRESERVATION.DATE;
                    db.RESERVATION.Add(rec);
                    db.SaveChanges();

                    TEMPRESERVATION = new RESERVATION();
                }
            }
        }
Esempio n. 14
0
        protected void rpFirmDepartmentList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Update":
                if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
                {
                    using (db = new novartz_stajyer1Entities())
                    {
                        Guid selectedDepartmentID = Guid.Parse(e.CommandArgument.ToString());
                        lblDepartmentIsUpdate.Text = "Güncelleyiniz";
                        FIRMDEPARTMENT rec = db.FIRMDEPARTMENT.SingleOrDefault(t => t.ID == selectedDepartmentID);
                        if (rec != null)
                        {
                            drpDepBranch.SelectedValue = rec.FIRMBRANCHID.ToString();
                            txtDepName.Text            = rec.NAME;
                            DEPARTMENTID = selectedDepartmentID;
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenDepartmentModal", "$('#mdlNewDepartment').modal('show');", true);
                            upDepartment.Update();
                        }
                    }
                }
                break;

            case "Delete":

                using (db = new novartz_stajyer1Entities())
                {
                    Guid selectedDepartmentID = Guid.Parse(e.CommandArgument.ToString());

                    FIRMDEPARTMENT rec = db.FIRMDEPARTMENT.SingleOrDefault(t => t.ID == selectedDepartmentID);
                    if (rec != null)
                    {
                        db.FIRMDEPARTMENT.Remove(rec);
                        db.SaveChanges();
                        InitPage(false);
                        upDepartment.Update();
                    }
                }
                break;
            }
        }
Esempio n. 15
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            using (db = new novartz_stajyer1Entities())
            {
                FIRM rec = db.FIRM.SingleOrDefault(t => t.ID == RECID);

                rec.NAME           = txtFirmName.Text;
                rec.DESCRIPTION    = txtFirmOwner.Text;
                rec.TYPESEKTORID   = Convert.ToByte(drpFirmSector.SelectedValue);
                rec.ADRESS         = txtFirmAddress.Text;
                rec.PHONE          = txtFirmPhone.Text;
                rec.EMAIL          = txtFirmEmail.Text;
                rec.CITYID         = Convert.ToByte(drpFirmCity.SelectedValue);          //byte gönderdiğin için onu byte çevirmesi lazım
                rec.CITYDISTRICTID = Convert.ToInt16(drpFirmCityDistrict.SelectedValue); // citydistrictid smallint olduğu için toınt16 ya çevirdik bytedan büyük7
                //db.FIRM.Add(rec); bu fonksiyonu eklersen de yeni kayıt ekleme yapar
                db.SaveChanges();
            }

            InitPage(false);
        }
Esempio n. 16
0
        public void MemberRegistion(string name, string lastname, string phone, string mail, string password)
        {
            MEMBER rec = null;

            using (db = new novartz_stajyer1Entities())
            {
                rec = new MEMBER
                {
                    NAME         = name,
                    SURNAME      = lastname,
                    PHONE        = phone,
                    LOGINNAME    = mail,
                    PASWORD      = password,
                    TYPEMEMBERID = 1, // todo: typemember drp den seçilecek
                    ID           = Guid.NewGuid()
                };

                db.MEMBER.Add(rec);
                db.SaveChanges();
            };
        }
Esempio n. 17
0
        protected void btnUpdateSaveServer_Click(object sender, EventArgs e)//Bilgileri Güncelleme işlemini yapıyoruz Burada....
        {
            if (ValidateRecord())
            {
                using (db = new novartz_stajyer1Entities())
                {
                    FIRMBRANCH branch = db.FIRMBRANCH.SingleOrDefault(t => t.ID == RECID);
                    branch.NAME   = txtBranchName.Text;
                    branch.PHONE  = txtBranchPhone.Text;
                    branch.EMAIL  = txtBranchMail.Text;
                    branch.ADRESS = txtBranchAdress.Text;
                    if (drpBranchCity.SelectedValue != "0")
                    {
                        branch.CITYID = Convert.ToByte(drpBranchCity.SelectedValue);
                    }
                    else
                    {
                        branch.CITYID = null;
                    }
                    if (drpBranchCity.SelectedValue != "0")
                    {
                        branch.CITYDISTRICTID = Convert.ToInt16(drpBranchDiscrit.SelectedValue);
                    }
                    else
                    {
                        branch.CITYDISTRICTID = null;
                    }

                    db.SaveChanges();
                    FillBranch();
                    UpdatePanel.Update();
                }
                MessageBox("Güncellendi Bilgileriniz...");
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "", "OpenModal()", true);
            }
        }
Esempio n. 18
0
        public void FirmRegistion(string Firmname, string Firmowner, string sector, string city, string citydistrict, string address, string phone, string mail)
        {
            FIRM rec = null;

            using (db = new novartz_stajyer1Entities())
            {
                rec = new FIRM
                {
                    ID             = Guid.NewGuid(),
                    NAME           = Firmname,
                    DESCRIPTION    = Firmowner,
                    PHONE          = phone,
                    EMAIL          = mail,
                    TYPESEKTORID   = Convert.ToByte(sector),
                    CITYID         = Convert.ToByte(city),
                    CITYDISTRICTID = Convert.ToInt16(citydistrict),
                    ADRESS         = address
                };
                db.FIRM.Add(rec);
                db.SaveChanges();
            };
        }
Esempio n. 19
0
        protected void rpFirmDepMemberList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Update":
                if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
                {
                    using (db = new novartz_stajyer1Entities())
                    {
                        Guid selectedMemberID = Guid.Parse(e.CommandArgument.ToString());
                        lblDepartmentMemberIsUpdate.Text = "Güncelleyiniz";
                        VW_FIRMDEPARTMENTMEMBER rec = db.VW_FIRMDEPARTMENTMEMBER.SingleOrDefault(t => t.ID == selectedMemberID);
                        if (rec != null)
                        {
                            FillDrp(drpDepMemberBranch, db.FIRMBRANCH.Where(d => d.FIRMID == RECID).ToList(), "ID", "NAME", "Şubesizler");
                            if (rec.FIRMBRANCHID.HasValue)
                            {
                                drpDepMemberBranch.SelectedValue = rec.FIRMBRANCHID.Value.ToString();
                            }
                            drpDepMemberBranch_SelectedIndexChanged(null, null);
                            drpDepMemberDepartment.SelectedValue = rec.FIRMDEPARTMENTID.ToString();
                            txtDepMemberTelephone.Text           = rec.PHONE;
                            txtDepMemberName.Text     = rec.NAME;
                            txtDepMemberSurname.Text  = rec.SURNAME;
                            txtDepMemberBirthday.Text = rec.BIRDDATE.ToString();
                            if (rec.GENDER.HasValue)
                            {
                                drpDepMemberGender.SelectedValue = rec.GENDER.Value ? "1" : "0";
                            }
                            drpDepMemberStatus.SelectedValue = rec.ISACTIVE ? "1" : "0";
                            drpDepMemEmail.Text = rec.LOGINNAME;
                            DEPARTMENTMEMBERID  = selectedMemberID;
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "OpenDepartmentMemberModal", "$('#mdlNewDepartmentMember').modal('show');", true);
                            upMdlNewDepartmentMember.Update();
                        }
                    }
                }
                break;

            case "Delete":     // OLMADI BU KISIMM!!!

                using (db = new novartz_stajyer1Entities())
                {
                    Guid selectedMemberID = Guid.Parse(e.CommandArgument.ToString());

                    FIRMDEPARTMENTMEMBER rec = db.FIRMDEPARTMENTMEMBER.SingleOrDefault(t => t.ID == selectedMemberID);
                    if (rec != null)
                    {
                        //hata kontrolü yap 547
                        db.FIRMDEPARTMENTMEMBER.Remove(rec);
                        db.SaveChanges();
                        //  InitPage(false);
                        //  upMdlNewDepartmentMember.Update();
                    }



                    MEMBER mem = db.MEMBER.SingleOrDefault(t => t.ID == rec.MEMBERID);
                    if (mem != null)
                    {
                        db.MEMBER.Remove(mem);
                        db.SaveChanges();
                        InitPage(false);
                        upDepartmentMember.Update();
                    }
                }

                break;
            }
        }