public ActionResult UpdateWeekEndWeekDayBidding(etblPropertyWeekendBiddingMapForOverview eObj) { object result = null; try { if (ModelState.IsValid) { if (eObj.Self.dtEffectiveDate.Date < DateTime.Now.AddDays(-7).Date) { result = new { st = 0, msg = "Please provide weekend/weekday discounts for this date in Bidding => Bulk Update screen first as this screen can only update discounts." }; } else if (eObj.Self.dtEffectiveDate.Date >= DateTime.Now.AddDays(-7).Date&& eObj.Self.dtEffectiveDate.Date < DateTime.Now.Date) { result = new { st = 0, msg = "Data for past dates cannot be provided." }; } else if (eObj.Self.bWeekend == null) { result = new { st = 0, msg = "Please provide weekend/weekday discounts for this date in Bidding => Bulk Update screen first as this screen can only update discounts." }; } else { eObj.Self.iPropId = Convert.ToInt32(Session["PropId"]); eObj.Self.iActionBy = ((OneFineRateBLL.BL_Login.UserDetails)Session["UserDetails"]).iUserId; eObj.Self.dtActionDate = DateTime.Now; int j = BL_tblPropertyWeekendBiddingMap.UpdateRecord(eObj); if (j == 1) { result = new { st = 1, msg = "Updated successfully." }; } else { result = new { st = 0, msg = "Kindly try after some time." }; } } } else { string errormsg = ""; foreach (ModelState modelState in ViewData.ModelState.Values) { foreach (ModelError error in modelState.Errors) { errormsg += error.ErrorMessage; errormsg += "</br>"; } } result = new { st = 0, msg = errormsg }; } } catch (Exception) { result = new { st = 0, msg = "Kindly try after some time." }; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public ActionResult Week(string date, string type, string pctype) { etblPropertyWeekendBiddingMapForOverview obj = new etblPropertyWeekendBiddingMapForOverview(); obj = BL_tblPropertyWeekendBiddingMap.GetSingleRecordById(clsUtils.ConvertyyyymmddtoDateTime(date), Convert.ToInt32(Session["PropId"]), Convert.ToInt32(type), pctype); if (obj.Self.bWeekend != null) { obj.Self.EffectiveDate = String.Format("{0:dd/MM/yyyy}", obj.Self.dtEffectiveDate); } else { obj.Self.dtEffectiveDate = clsUtils.ConvertyyyymmddtoDateTime(date); obj.Self.EffectiveDate = String.Format("{0:dd/MM/yyyy}", obj.Self.dtEffectiveDate); } return(PartialView("_PropertyWeekendBiddingMap", obj)); }