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/BlotterBai_Muajjal/GetBlotterBai_Muajjal?id=" + id.ToString()); response.EnsureSuccessStatusCode(); Models.SBP_BlotterBai_Muajjal BlotterBai_Muajjal = response.Content.ReadAsAsync <Models.SBP_BlotterBai_Muajjal>().Result; UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterBai_Muajjal), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); var isDateChangable = Convert.ToBoolean(Session["CurrentPagesAccess"].ToString().Split('~')[2]); ViewData["isDateChangable"] = isDateChangable; return(PartialView("_Edit", BlotterBai_Muajjal)); }
public JsonResult <Models.SBP_BlotterBai_Muajjal> GetBlotterBai_Muajjal(int id) { EntityMapperBlotterBai_Muajjal <DataAccessLayer.SBP_BlotterBai_Muajjal, Models.SBP_BlotterBai_Muajjal> mapObj = new EntityMapperBlotterBai_Muajjal <DataAccessLayer.SBP_BlotterBai_Muajjal, Models.SBP_BlotterBai_Muajjal>(); DataAccessLayer.SBP_BlotterBai_Muajjal dalBlotterBai_Muajjal = DAL.GetBai_MuajjalItem(id); Models.SBP_BlotterBai_Muajjal products = new Models.SBP_BlotterBai_Muajjal(); products = mapObj.Translate(dalBlotterBai_Muajjal); return(Json <Models.SBP_BlotterBai_Muajjal>(products)); }
public bool UpdateBai_Muajjal(Models.SBP_BlotterBai_Muajjal blotterBai_Muajjal) { bool status = false; if (ModelState.IsValid) { EntityMapperBlotterBai_Muajjal <Models.SBP_BlotterBai_Muajjal, DataAccessLayer.SBP_BlotterBai_Muajjal> mapObj = new EntityMapperBlotterBai_Muajjal <Models.SBP_BlotterBai_Muajjal, DataAccessLayer.SBP_BlotterBai_Muajjal>(); DataAccessLayer.SBP_BlotterBai_Muajjal Bai_MuajjalObj = new DataAccessLayer.SBP_BlotterBai_Muajjal(); Bai_MuajjalObj = mapObj.Translate(blotterBai_Muajjal); status = DAL.UpdateBai_Muajjal(Bai_MuajjalObj); } return(status); }
public ActionResult Update(Models.SBP_BlotterBai_Muajjal BlotterBai_Muajjal) { BlotterBai_Muajjal.BM_OutFLow = UC.CheckNegativeValue(BlotterBai_Muajjal.BM_OutFLow); BlotterBai_Muajjal.UpdateDate = DateTime.Now; if (BlotterBai_Muajjal.ValueDate == null) { BlotterBai_Muajjal.ValueDate = DateTime.Now; } BlotterBai_Muajjal.CurID = Convert.ToInt16(Session["SelectedCurrency"].ToString()); ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.PutResponse("api/BlotterBai_Muajjal/UpdateBai_Muajjal", BlotterBai_Muajjal); response.EnsureSuccessStatusCode(); UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterBai_Muajjal), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); return(RedirectToAction("BlotterBai_Muajjal")); }