Exemplo n.º 1
0
        public ActionResult Create([Bind(Include = "id_request_participant,no_reg_parent,group_code,no_reg,allowance_idr,allowance_usd,allowance_jpy,created_date,modified_date,user_modified,active_flag")] tb_r_travel_request_participant tb_r_travel_request_participant)
        {
            if (ModelState.IsValid)
            {
                db.tb_r_travel_request_participant.Add(tb_r_travel_request_participant);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tb_r_travel_request_participant));
        }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Include = "Sr_no,Email,Password,Name,Address,City,Age,Status")] tbl_registration tbl_registration)
        {
            if (ModelState.IsValid)
            {
                db.tbl_registration.Add(tbl_registration);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbl_registration));
        }
Exemplo n.º 3
0
        public JsonResult ImageUpload(ImageViewModel model)
        {
            dbFilesEntities1 db = new dbFilesEntities1();
            int ImgId           = 0;
            var Lat             = "Latitude";
            var Lon             = "Longitude";
            var file            = model.ImageFile;

            byte[] Imagebyte = null;

            if (file != null)
            {
                //var fileName = Path.GetFileName(file.FileName);
                //var extention = Path.GetExtension(file.FileName);
                //var filenamewithoutextension = Path.GetFileNameWithoutExtension(file.FileName);

                file.SaveAs(Server.MapPath("/UploadImage/" + file.FileName));

                BinaryReader reader = new BinaryReader(file.InputStream);

                Imagebyte = reader.ReadBytes(file.ContentLength);

                StoreImage img = new StoreImage();
                img.Lat      = Lat;
                img.Lon      = Lon;
                img.ImgTitle = file.FileName;
                img.ImgByte  = Imagebyte;
                img.ImgPath  = "/UploadedImage/" + file.FileName;
                img.IsDelete = 0;
                db.StoreImages.Add(img);
                db.SaveChanges();

                ImgId = img.ImgId;
            }

            return(Json(ImgId, JsonRequestBehavior.AllowGet));
        }