public ActionResult Edit(int id, FormCollection form) { #region Added by shakir (Currency parameter) var selectCurrency = (dynamic)null; if (form["selectCurrency"] != null) { selectCurrency = Convert.ToInt32(form["selectCurrency"].ToString()); } else { selectCurrency = Convert.ToInt32(Session["SelectedCurrency"].ToString()); } UtilityClass.GetSelectedCurrecy(selectCurrency); #endregion ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.GetResponse("/api/BlotterCRD/GetBlotterCRD?id=" + id.ToString()); response.EnsureSuccessStatusCode(); Models.SBP_BlotterCRD BlotterCRD = response.Content.ReadAsAsync <Models.SBP_BlotterCRD>().Result; UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterCRD), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); ViewBag.Nostro_Accountid = BlotterCRD.Nostro_Account; ViewBag.CRDNostroBanks = GetAllNostroBanks(); return(PartialView("_Edit", BlotterCRD)); }
public JsonResult <Models.SBP_BlotterCRD> GetblotterCRD(int id) { EntitiyMapperBlotterCRD <DataAccessLayer.SBP_BlotterCRD, Models.SBP_BlotterCRD> mapObj = new EntitiyMapperBlotterCRD <DataAccessLayer.SBP_BlotterCRD, Models.SBP_BlotterCRD>(); DataAccessLayer.SBP_BlotterCRD dalblotterCRD = DAL.GetCRDItem(id); Models.SBP_BlotterCRD products = new Models.SBP_BlotterCRD(); products = mapObj.Translate(dalblotterCRD); return(Json <Models.SBP_BlotterCRD>(products)); }
public bool UpdateCRD(Models.SBP_BlotterCRD blotterCRD) { bool status = false; if (ModelState.IsValid) { EntitiyMapperBlotterCRD <Models.SBP_BlotterCRD, DataAccessLayer.SBP_BlotterCRD> mapObj = new EntitiyMapperBlotterCRD <Models.SBP_BlotterCRD, DataAccessLayer.SBP_BlotterCRD>(); DataAccessLayer.SBP_BlotterCRD CRDObj = new DataAccessLayer.SBP_BlotterCRD(); CRDObj = mapObj.Translate(blotterCRD); status = DAL.UpdateCRD(CRDObj); } return(status); }
public ActionResult Update(Models.SBP_BlotterCRD BlotterCRD, FormCollection form) { BlotterCRD.UserID = Convert.ToInt16(Session["UserID"].ToString()); BlotterCRD.BID = Convert.ToInt16(Session["BranchID"].ToString()); BlotterCRD.BR = Convert.ToInt16(Session["BR"].ToString()); BlotterCRD.CurID = Convert.ToInt16(Session["SelectedCurrency"].ToString()); BlotterCRD.UpdateDate = DateTime.Now; BlotterCRD.Nostro_Account = Convert.ToInt32(form["Nostro_AccountId"].ToString()); ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.PutResponse("api/BlotterCRD/UpdateCRD", BlotterCRD); response.EnsureSuccessStatusCode(); UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterCRD), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); return(RedirectToAction("BlotterCRD")); }