public ActionResult getUserData() { var UserList = ClientsRecord.AllUserList(); var UserDat = Json(UserList, JsonRequestBehavior.AllowGet); return(UserDat); }
public ActionResult ClientList() { var clients = ClientsRecord.GetClients(); ViewBag.ClientsList = clients; return(View(clients)); }
public ActionResult ClientList(FormCollection form) { if (!String.IsNullOrEmpty(form["status"])) { string message = null; //if (Convert.ToString(form["status"]) == "success") { message = "Your payment has been done successfully."; } //if (Convert.ToString(form["status"]) == "failure") { message = "Your payment has not been done successfully. Please try again !"; } //return Content(message); return(RedirectToAction("Home", "Home")); } else { var clients = ClientsRecord.GetClients(); ViewBag.ClientsList = clients; return(View(clients)); } }
//[HttpPost] //public ActionResult EditFileDeatil(ClientsRecord client, string Command) //{ // if (!ModelState.IsValid) // { // return PartialView("_EditEmployee", emp); // } // else // { // Employee empObj = new Employee(); // empObj.ID = emp.Id; // empObj.Emp_ID = emp.Emp_ID; // empObj.Name = emp.Name; // empObj.Dept = emp.Dept; // empObj.City = emp.City; // empObj.State = emp.State; // empObj.Country = emp.Country; // empObj.Mobile = emp.Mobile; // bool IsSuccess = mobjModel.UpdateEmployee(empObj); // if (IsSuccess) // { // TempData["OperStatus"] = "Employee updated succeessfully"; // ModelState.Clear(); // return RedirectToAction("SearchEmployee", "ManageEmployee"); // } // } // return PartialView("_EditEmployee"); //} //public ActionResult ViewFileDetail(int id) //{ // var data = mobjModel.GetEmployeeDetail(id); // if (Request.IsAjaxRequest()) // { // EmployeeModel empObj = new EmployeeModel(); // empObj.Emp_ID = data.Emp_ID; // empObj.Name = data.Name; // empObj.Dept = data.Dept; // empObj.City = data.City; // empObj.State = data.State; // empObj.Country = data.Country; // empObj.Mobile = data.Mobile; // return View("_EmployeeDetail", empObj); // } // else // return View(data); //} public ActionResult Delete(int id) { using (DBClass context = new DBClass()) { DataTable dt = context.getData("Select UserName,FileName from UploadData where ID = '" + id + "'", CommandType.Text); string fileName = Convert.ToString(dt.Rows[0]["UserName"]) + '@' + Convert.ToString(dt.Rows[0]["FileName"]); var path = Path.Combine(Server.MapPath("~/Files"), fileName); if (System.IO.File.Exists(path)) { System.IO.File.Delete(path); } } bool check = ClientsRecord.DeleteFile(id, Session["UserName"].ToString()); var clients = ClientsRecord.GetClients(); ViewBag.ClientsList = clients; return(RedirectToAction("ClientList")); }