示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RTLSEntities ctx = new RTLSEntities();

            if (string.IsNullOrEmpty(Request.QueryString["dlt"]) == false)
            {
                int dlt   = Convert.ToInt32(Request.QueryString["dlt"]);
                var sorgu = ctx.TBL_Haritalar.SingleOrDefault(x => x.ID == dlt);
                sorgu.dlt       = 1;
                sorgu.dlt_Zaman = DateTime.Now;
                ctx.SaveChanges();
            }
            int MapID = Convert.ToInt32(Request.QueryString["MapID"]);

            baslik.InnerHtml = ctx.TBL_Map.SingleOrDefault(x => x.ID == MapID).Map;

            var bolge = ctx.TBL_Haritalar.Where(x => x.dlt == 0 && x.Map_ID == MapID).OrderBy(x => x.HaritaAdi);

            RList.DataSource = bolge.ToList();
            RList.DataBind();
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RTLSEntities ctx = new RTLSEntities();

            if (string.IsNullOrEmpty(Request.QueryString["dlt"]) == false)
            {
                int dlt   = Convert.ToInt32(Request.QueryString["dlt"]);
                var sorgu = ctx.TBL_Map.SingleOrDefault(x => x.ID == dlt);
                sorgu.dlt       = 1;
                sorgu.dlt_Zaman = DateTime.Now;
                ctx.SaveChanges();
            }
            if (string.IsNullOrEmpty(Request.QueryString["d"]) == false)
            {
                string d  = Request.QueryString["d"];
                int    id = Convert.ToInt32(Request.QueryString["id"]);

                if (id == 0)
                {
                    TBL_Map dep = new TBL_Map();
                    dep.dlt = 0;
                    dep.Map = Request.QueryString["name"];
                    ctx.TBL_Map.Add(dep);
                    ctx.SaveChanges();
                }
                else
                {
                    TBL_Map dep = ctx.TBL_Map.SingleOrDefault(x => x.ID == id && x.dlt == 0);
                    dep.Map = Request.QueryString["name"];
                    ctx.SaveChanges();
                }
                Response.Redirect("map.aspx");
            }


            var map = ctx.TBL_Map.Where(x => x.dlt == 0).OrderBy(x => x.Map);

            RList.DataSource = map.ToList();
            RList.DataBind();
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RTLSEntities ctx = new RTLSEntities();

            if (string.IsNullOrEmpty(Request.QueryString["dlt"]) == false)
            {
                int dlt   = Convert.ToInt32(Request.QueryString["dlt"]);
                var sorgu = ctx.TBL_Personel.SingleOrDefault(x => x.ID == dlt);
                sorgu.dlt = 1;
                ctx.SaveChanges();
            }

            var personel = from p in ctx.TBL_Personel
                           join f in ctx.TBL_Firmalar
                           on p.Firma_ID equals f.ID
                           join d in ctx.TBL_Departman
                           on p.Departman_ID equals d.ID
                           join g in ctx.TBL_Gorev
                           on p.Gorev_ID equals g.ID
                           where p.dlt == 0
                           select new
            {
                p.ID,
                p.Ad,
                p.Soyad,
                p.TagNo,
                p.TagTipi,
                p.KamraIp,
                f.Firma,
                d.Departman,
                g.Gorev
            };

            RList.DataSource = personel.ToList();
            RList.DataBind();
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RTLSEntities ctx = new RTLSEntities();

            gorevekle.Visible = false;
            if (string.IsNullOrEmpty(Request.QueryString["dlt"]) == false)
            {
                int dlt   = Convert.ToInt32(Request.QueryString["dlt"]);
                var sorgu = ctx.TBL_Departman.SingleOrDefault(x => x.ID == dlt);
                sorgu.dlt = 1;
                ctx.SaveChanges();
            }
            if (string.IsNullOrEmpty(Request.QueryString["dltG"]) == false)
            {
                int dlt   = Convert.ToInt32(Request.QueryString["dltG"]);
                var sorgu = ctx.TBL_Gorev.SingleOrDefault(x => x.ID == dlt);
                sorgu.dlt = 1;
                ctx.SaveChanges();
            }
            if (string.IsNullOrEmpty(Request.QueryString["d"]) == false)
            {
                string d  = Request.QueryString["d"];
                int    id = Convert.ToInt32(Request.QueryString["id"]);
                if (d == "departman")
                {
                    if (id == 0)
                    {
                        TBL_Departman dep = new TBL_Departman();
                        dep.dlt       = 0;
                        dep.Departman = Request.QueryString["name"];
                        ctx.TBL_Departman.Add(dep);
                        ctx.SaveChanges();
                    }
                    else
                    {
                        TBL_Departman dep = ctx.TBL_Departman.SingleOrDefault(x => x.ID == id && x.dlt == 0);
                        dep.Departman = Request.QueryString["name"];
                        ctx.SaveChanges();
                    }
                    Response.Redirect("departman.aspx");
                }
                else if (d == "gorev")
                {
                    if (id == 0)
                    {
                        TBL_Gorev gor = new TBL_Gorev();
                        gor.dlt          = 0;
                        gor.Gorev        = Request.QueryString["name"];
                        gor.Departman_ID = Convert.ToInt32(Request.QueryString["DID"]);
                        ctx.TBL_Gorev.Add(gor);
                        ctx.SaveChanges();
                    }
                    else
                    {
                        TBL_Gorev gor = ctx.TBL_Gorev.SingleOrDefault(x => x.ID == id && x.dlt == 0);
                        gor.Gorev = Request.QueryString["name"];
                        ctx.SaveChanges();
                    }
                    Response.Redirect("departman.aspx?DID=" + Request.QueryString["DID"]);
                }
            }


            var departman = ctx.TBL_Departman.Where(x => x.dlt == 0).OrderBy(x => x.Departman);

            RList.DataSource = departman.ToList();
            RList.DataBind();

            if (string.IsNullOrEmpty(Request.QueryString["DID"]) == false)
            {
                gorevekle.Visible = true;
                int DID = Convert.ToInt32(Request.QueryString["DID"]);

                var dep = ctx.TBL_Departman.SingleOrDefault(x => x.ID == DID);
                gorevBaslik.InnerHtml = dep.Departman + " Görevleri";
                var gorev = ctx.TBL_Gorev.Where(x => x.dlt == 0 && x.Departman_ID == DID).OrderBy(x => x.Gorev);
                RListG.DataSource = gorev.ToList();
                RListG.DataBind();
            }
        }