예제 #1
0
        public ActionResult davakayit(string test, string tip, string tc, string davaad)
        {
            DavakayitViewModel dkn = new DavakayitViewModel();

            dkn.avukats = db.avukats.ToList();
            string yol = tip; //kurumsal bireysel için dosya yolu

            try
            {
                string subyol = "/uploads/" + yol + "/" + tc;
                //müşteri klasör işlemi

                foreach (string file in Request.Files)
                {
                    HttpPostedFileBase http = Request.Files[file];

                    //dosya ekleme işlemi
                    string tamyol = "/uploads/" + yol + "/" + tc + "/aktifdavalar/" + davaad + "/" + http.FileName;
                    Request.Files[file].SaveAs(Server.MapPath(tamyol));
                }
                ViewBag.alertler = "success";
            }
            catch (Exception)
            {
                ViewBag.alertler = "error";
                throw;
            }
            return(View(dkn));
        }
예제 #2
0
        public ActionResult davakayit()
        {
            DavakayitViewModel dkn = new DavakayitViewModel();

            dkn.avukats = db.avukats.ToList();
            return(View(dkn));
        }
예제 #3
0
        public ActionResult kurumsaldavalar()
        {
            DavakayitViewModel dtb = new DavakayitViewModel();

            dtb.bitenDavalars = db.bitendavalars.ToList();
            dtb.avukats       = db.avukats.ToList();
            dtb.davalars      = db.davalars.ToList();

            return(View(dtb));
        }
예제 #4
0
        public ActionResult Davasil()
        {
            OurDbContext       db  = new OurDbContext();
            DavakayitViewModel dkb = new DavakayitViewModel();

            dkb.bitenDavalars = db.bitendavalars.ToList();
            dkb.davalars      = db.davalars.ToList();
            dkb.avukats       = db.avukats.ToList();

            return(View(dkb));
        }
예제 #5
0
        public ActionResult kurumsaldavalar(string davaId, string durum)
        {
            try
            {
                OurDbContext       db  = new OurDbContext();
                DavakayitViewModel dkb = new DavakayitViewModel();
                dkb.bitenDavalars = db.bitendavalars.ToList();
                dkb.davalars      = db.davalars.ToList();
                dkb.avukats       = db.avukats.ToList();
                Object mst;
                if (durum == "aktif")
                {
                    mst = db.davalars.Where(x => x.DavaId.ToString() == davaId).FirstOrDefault();
                }
                else
                {
                    mst = db.bitendavalars.Where(x => x.DavaId.ToString() == davaId).FirstOrDefault();
                }
                string yol = "kurumsal";

                Davalar      test  = null;
                BitenDavalar testb = null;
                try
                {
                    test = (Davalar)mst;
                }
                catch (Exception)
                {
                    testb = (BitenDavalar)mst;
                }
                string subyol = "/uploads/" + yol + "/";
                if (test != null)
                {
                    subyol += test.Musteriler.musteriTc + "/aktifdavalar/" + test.DavaAdi;
                }
                else if (testb != null)
                {
                    if (testb.Musteriler != null)
                    {
                        subyol += testb.Musteriler.musteriTc + "/bitendavalar/" + testb.DavaAdi;
                    }
                    else
                    {
                        subyol += testb.BMusteriler.musteriTc + "/bitendavalar/" + testb.DavaAdi;
                    }
                }

                try
                {
                    foreach (string file in Request.Files)
                    {
                        HttpPostedFileBase http = Request.Files[file];

                        //dosya ekleme işlemi
                        string tamyol = subyol + "/" + http.FileName;
                        Request.Files[file].SaveAs(Server.MapPath(tamyol));
                    }
                }
                catch (Exception)
                {
                    throw;
                }
                return(View(dkb));
            }
            catch (Exception)
            {
                throw;
            }
        }