public JsonResult showupdatemember(int id)
        {
            var dto = new LMS.Entities.NewMemberDTO();

            dto = LMS.DAL.NewMemberDAO.loaddatainupdateform(id);
            var d = new
            {
                memerid    = dto.Memberid,
                name       = dto.MemberName,
                fathername = dto.FatherName,
                email      = dto.Email,
                phone      = dto.Phone,
                cnic       = dto.Cnic,
                picture    = dto.Picture,
            };

            return(Json(d, JsonRequestBehavior.AllowGet));
        }
        public JsonResult updatemember2(string name, string fathername, string cnic, string phone, string email, int id)
        {
            var dTO        = new LMS.Entities.NewMemberDTO();
            var uniqueName = "";

            if (Request.Files["Image"] != null)
            {
                var file = Request.Files["Image"];
                if (file.FileName != "")
                {
                    var ext = System.IO.Path.GetExtension(file.FileName);

                    //Generate a unique name using Guid
                    uniqueName = Guid.NewGuid().ToString() + ext;

                    //Get physical path of our folder where we want to save images
                    var rootPath = Server.MapPath("~/UploadedFiles");

                    var fileSavePath = System.IO.Path.Combine(rootPath, uniqueName);

                    // Save the uploaded file to "UploadedFiles" folder
                    file.SaveAs(fileSavePath);

                    dTO.Picture = uniqueName;
                }
            }
            dTO.Cnic       = cnic;
            dTO.Email      = email;
            dTO.Phone      = phone;
            dTO.FatherName = fathername;
            dTO.MemberName = name;
            var pid  = LMS.DAL.NewMemberDAO.updatedataintable(dTO, id);
            var data = new
            {
                success = true,
                p       = pid,
            };

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