public virtual List <SP_Party_SelectOneResult> GetPartyDetailById(clsParty obj) { ISingleResult <SP_Party_SelectOneResult> objResult; List <SP_Party_SelectOneResult> objResultList; // SP_groups_SelectAllResult objResult = new SP_groups_SelectAllResult(); try { objResult = db.SP_Party_SelectOne(obj.PartyID); objResultList = new List <SP_Party_SelectOneResult>(objResult); } //SP_Party_SelectOneResult objResult = new SP_Party_SelectOneResult(); //try //{ // objResult = (SP_Party_SelectOneResult)db.SP_Party_SelectOne(obj.PartyID); //} catch (Exception ex) { LoggerFactory.LoggerInstance.LogException(ex); throw ex; } return(objResultList); }
public ActionResult InsertParty(string PartyMasterModel) { clsParty mparty = new clsParty(); var jsonGroupMasterModel = JObject.Parse(Convert.ToString(PartyMasterModel)); mparty = new JavaScriptSerializer().Deserialize <clsParty>(PartyMasterModel); mparty.InstanceID = 1; mparty.UserID = 1; mparty.CreatedDate = DateTime.Now; HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://*****:*****@2610"); client.DefaultRequestHeaders.Add("X-Version", "1.1"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var responseMessage = client.PostAsJsonAsync("InsertParty", mparty).Result; if (responseMessage.IsSuccessStatusCode) { var responseData = responseMessage.Content.ReadAsStringAsync().Result; var jsonresult = JsonConvert.DeserializeObject(responseData); return(Json(jsonresult, JsonRequestBehavior.AllowGet)); } return(Json("")); }
public HttpResponseMessage InsertParty([FromBody] clsParty request) { LoggerFactory.LoggerInstance.LogDebug("Request Started for : " + request.PartyID + " Party name :" + request.PartyName); HttpResponseMessage response = new HttpResponseMessage(); try { PartyService objComService = new PartyService(); var objResponse = objComService.InsertParty(request); if (objResponse != null && objResponse.ToString() != "") { response = Request.CreateResponse(HttpStatusCode.OK, objResponse); LoggerFactory.LoggerInstance.LogDebug("Request End for : " + request.PartyID + " Party name :" + request.PartyName); } else { response = Request.CreateErrorResponse(HttpStatusCode.NotFound, "No detail found for Party name : " + request.PartyName + "."); } } catch (Exception ex) { LoggerFactory.LoggerInstance.LogException(ex); response = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Error occured while getting Party name " + request.PartyName + "."); } return(response); }
public virtual int UpdateParty(clsParty obj) { int result = 0; try { result = (int)db.SP_Party_Update(obj.PartyID, obj.InstanceID, obj.UserID, obj.PartyName, obj.CivilNumber, obj.Email, obj.Address, obj.Contact, obj.Status, obj.CreatedDate); } catch (Exception ex) { LoggerFactory.LoggerInstance.LogException(ex); throw ex; } return(result); }
public virtual int DeleteParty(clsParty obj) { int result = 0; try { result = (int)db.SP_Party_Delete(obj.PartyID); } catch (Exception ex) { LoggerFactory.LoggerInstance.LogException(ex); throw ex; } return(result); }
public virtual long InsertParty(clsParty obj) { long result = 0; long?resultID = 0; try { result = (long)db.SP_Party_Insert(ref resultID, obj.InstanceID, obj.UserID, obj.PartyName, obj.CivilNumber, obj.Email, obj.Address, obj.Contact, obj.Status, obj.CreatedDate); } catch (Exception ex) { LoggerFactory.LoggerInstance.LogException(ex); throw ex; } return(result); }
public ActionResult UpdateParty(string PartyMasterModel) { clsParty obj = new clsParty(); var jsonPartyMasterModel = JObject.Parse(Convert.ToString(PartyMasterModel)); obj = new JavaScriptSerializer().Deserialize <clsParty>(PartyMasterModel); obj.InstanceID = 1; obj.UserID = 1; obj.CreatedDate = DateTime.Now; HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://*****:*****@2610"); client.DefaultRequestHeaders.Add("X-Version", "1.1"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var responseMessage = client.PostAsJsonAsync("UpdateParty", obj).Result; return(Json("")); }
public ActionResult BindParty() { clsParty obj = new clsParty(); HttpClient client = new HttpClient(); client.BaseAddress = new Uri("http://*****:*****@2610"); client.DefaultRequestHeaders.Add("X-Version", "1.1"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var responseMessage = client.PostAsJsonAsync("GetPartyDetail", obj).Result; if (responseMessage.IsSuccessStatusCode) { var responseData = responseMessage.Content.ReadAsStringAsync().Result; var jsonresult = JsonConvert.DeserializeObject(responseData); return(Json(jsonresult, JsonRequestBehavior.AllowGet)); } return(Json("")); }