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/BlotterTBO/GetBlotterTBO?id=" + id.ToString()); response.EnsureSuccessStatusCode(); Models.SBP_BlotterTBO BlotterTBO = response.Content.ReadAsAsync <Models.SBP_BlotterTBO>().Result; var isDateChangable = Convert.ToBoolean(Session["CurrentPagesAccess"].ToString().Split('~')[2]); ViewData["isDateChangable"] = isDateChangable; ViewBag.TBOTransactionTitles = GetAllTBOTransactionTitles(); UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterTBO), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); return(PartialView("_Edit", BlotterTBO)); }
public JsonResult <Models.SBP_BlotterTBO> GetBlotterTBO(int id) { EntitiyMapperBlotterTBO <DataAccessLayer.SBP_BlotterTBO, Models.SBP_BlotterTBO> mapObj = new EntitiyMapperBlotterTBO <DataAccessLayer.SBP_BlotterTBO, Models.SBP_BlotterTBO>(); DataAccessLayer.SBP_BlotterTBO dalBlotterTBO = DAL.GetTBOItem(id); Models.SBP_BlotterTBO products = new Models.SBP_BlotterTBO(); products = mapObj.Translate(dalBlotterTBO); return(Json <Models.SBP_BlotterTBO>(products)); }
public bool UpdateTBO(Models.SBP_BlotterTBO blotterTBO) { bool status = false; if (ModelState.IsValid) { EntitiyMapperBlotterTBO <Models.SBP_BlotterTBO, DataAccessLayer.SBP_BlotterTBO> mapObj = new EntitiyMapperBlotterTBO <Models.SBP_BlotterTBO, DataAccessLayer.SBP_BlotterTBO>(); DataAccessLayer.SBP_BlotterTBO TBOObj = new DataAccessLayer.SBP_BlotterTBO(); TBOObj = mapObj.Translate(blotterTBO); status = DAL.UpdateTBO(TBOObj); } return(status); }
public ActionResult Update(Models.SBP_BlotterTBO BlotterTBO) { BlotterTBO.TBO_OutFLow = UC.CheckNegativeValue(BlotterTBO.TBO_OutFLow); if (BlotterTBO.TBO_Date == null) { BlotterTBO.TBO_Date = DateTime.Now; } BlotterTBO.UpdateDate = DateTime.Now; BlotterTBO.CurID = Convert.ToInt16(Session["SelectedCurrency"].ToString()); UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterTBO), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.PutResponse("api/BlotterTBO/UpdateTBO", BlotterTBO); response.EnsureSuccessStatusCode(); return(RedirectToAction("BlotterTBO")); }