public JsonResult SaveCheckListAccount(CheckListAccountLink checkListAccountLink) { string[] CheckListIDs = checkListAccountLink.CheckListIDS; for (int i = 0; i < CheckListIDs.Length; i++) { Console.WriteLine(CheckListIDs[i]); CheckListAccount checkListAccount = new CheckListAccount { UserID = HttpContext.User.Identity.Name, CheckListID = Convert.ToInt32(CheckListIDs[i].ToString()), DeliverableID = Convert.ToInt32(checkListAccountLink.DeliverableID.ToString()), DeliverableDetailID = Convert.ToInt32(checkListAccountLink.DeliverableDetailID.ToString()), ProjectID = Convert.ToInt32(checkListAccountLink.ProjectID.ToString()), StageID = Convert.ToInt32(checkListAccountLink.Stage.ToString()), StatusID = Convert.ToInt32(checkListAccountLink.State.ToString()), ResourceEmail = checkListAccountLink.ResourceName, Notes = "", }; bool response = CABusinessProjectTrackingAPIClient.GetHttpResponse <bool>(checkListAccount, CABPTMethodConstants.ADDNEWCHECKLISTACOUNTLINK); string result = JsonConvert.SerializeObject(""); } return(Json("", JsonRequestBehavior.AllowGet)); }
//public JsonResult GetCheckListAccountLink(pdDTO del) //{ // CheckListAccountResponse checkListAccountResponse = new CheckListAccountResponse(); // string queryString = "?UserID=" + HttpContext.User.Identity.Name; // checkListAccountResponse.CheckListAccountList = CABusinessProjectTrackingAPIClient.GetHttpResponse<List<CheckListAccount>>(queryString, CABPTMethodConstants.GETCHECKLISTACOUNTLIST); // checkListAccountResponse.StateList= CABusinessProjectTrackingAPIClient.GetHttpResponse<List<State>>(queryString, CABPTMethodConstants.GETStateList); // if(checkListAccountResponse.CheckListAccountList !=null && checkListAccountResponse.CheckListAccountList.Count > 0) // { // checkListAccountResponse.CheckListAccountList = checkListAccountResponse.CheckListAccountList.ToList().Where(x => x.ProjectID == del.pid && x.DeliverableID == del.did && x.DeliverableDetailID == del.dtlid).ToList(); // } // string result = JsonConvert.SerializeObject(checkListAccountResponse); // return Json(result, JsonRequestBehavior.AllowGet); //} public JsonResult GetCheckListAccountLink(CheckListAccount checkListAccount) { CheckListAccountResponse checkListAccountResponse = new CheckListAccountResponse(); string queryString = "?UserID=" + HttpContext.User.Identity.Name; checkListAccount.UserID = HttpContext.User.Identity.Name; checkListAccount.CreatedDate = DateTime.Now; checkListAccount.UpdatedDate = DateTime.Now; checkListAccount.SignedDate = DateTime.Now; checkListAccountResponse.CheckListAccountList = CABusinessProjectTrackingAPIClient.GetHttpResponse <List <CheckListAccount> >(checkListAccount, CABPTMethodConstants.GETCHECKLISTACOUNTLIST); checkListAccountResponse.StateList = CABusinessProjectTrackingAPIClient.GetHttpResponse <List <State> >(queryString, CABPTMethodConstants.GETStateList); if (checkListAccountResponse.CheckListAccountList != null && checkListAccountResponse.CheckListAccountList.Count > 0) { checkListAccountResponse.CheckListAccountList = checkListAccountResponse.CheckListAccountList.ToList().Where(x => x.ProjectID == checkListAccount.ProjectID && x.DeliverableID == checkListAccount.DeliverableID && x.DeliverableDetailID == checkListAccount.DeliverableDetailID).ToList(); } string result = JsonConvert.SerializeObject(checkListAccountResponse); return(Json(result, JsonRequestBehavior.AllowGet)); }