public JsonResult CancelDelete(int RowId, int EmpId, int Operation)
 {
     NuPortalDBService.NuPortalService dBservice = new NuPortalDBService.NuPortalService();
     dBservice.Url = Constants.DBService;
     try
     {
         string jsonString = dBservice.CancelItem(RowId, EmpId, Operation);
         if (jsonString != string.Empty)
         {
             return(Json(jsonString, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         GeneralFunctions genFun = new GeneralFunctions();
         genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name,
                         Convert.ToString(ControllerContext.RouteData.Values["action"]),
                         Convert.ToString(ControllerContext.RouteData.Values["controller"]));
         genFun = null;
         return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
     }
     finally
     {
         dBservice = null;
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
 public JsonResult GetDefaultValues(int CategoryType, int Operation)
 {
     NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
     dbService.Url = Constants.DBService;
     try
     {
         string jsonString = dbService.CancelItem(Convert.ToInt32(Session["CompanyId"]), CategoryType, Operation);
         if (jsonString != string.Empty)
         {
             return(Json(jsonString, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         GeneralFunctions genFun = new GeneralFunctions();
         genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name,
                         Convert.ToString(ControllerContext.RouteData.Values["action"]),
                         Convert.ToString(ControllerContext.RouteData.Values["controller"]));
         genFun = null;
         return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
     }
     finally
     {
         dbService = null;
     }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }
Exemplo n.º 3
0
 public JsonResult BindTasks(int Project, int EmpId)
 {
     NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService();
     dbService.Url = Constants.DBService;
     try
     {
         string JsonString = dbService.CancelItem(Project, EmpId == 0 ? Convert.ToInt16(Session["EmpId"]) : EmpId, 8);
         if (JsonString != string.Empty)
         {
             return(Json(JsonString, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         GeneralFunctions genFun = new GeneralFunctions();
         genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name,
                         Convert.ToString(ControllerContext.RouteData.Values["action"]),
                         Convert.ToString(ControllerContext.RouteData.Values["controller"]));
         genFun = null;
     }
     finally { dbService.Dispose(); }
     return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet));
 }