public ActionResult Detail(int Id = 0) { ViewBag.Height = (int)(Request.Browser.ScreenPixelsHeight * 0.85); TB_SERVICES d = Services_Service.GetById(Id); List <TB_TYPE_DETAILS> types = Types_Service.GetAllDetails(d.ServiceTypeCode); ViewBag.Types = types; List <TB_SERVICE_DETAILS> details = Services_Service.GetAllDetails(Id); ViewBag.Details = details; List <TB_FILES> file = Files_Service.GetByRefecense("" + Id).Where(x => x.FileType == "SERVICE").ToList(); List <TB_TYPES> listType = Types_Service.GetAll(); ViewBag.Files = file; ViewBag.ListType = listType; List <TB_MENUS> listMenu = new List <TB_MENUS>(); listMenu = Menu_Service.GetByServiceId(Id); ViewBag.Menus = listMenu; return(View(d)); }
public ActionResult Index(int Id = 0) { TB_SERVICES d = Services_Service.GetById(Id); List <TB_SERVICES> list = Services_Service.GetAll().Where(x => x.ServiceStatus == "A").ToList(); ViewBag.Selected = Id; return(View(list)); }
public JsonResult GetPrice(int serviceId, int serviceNum, string code = "", int menuId = 0, int num = 0) { AjaxResultModel Result = new AjaxResultModel(); Result.Result = 0; try { TB_SERVICES s = Services_Service.GetById(serviceId); decimal p = s.ServicePrice * serviceNum; if (!string.IsNullOrEmpty(code)) { TB_VOUCHERS v = Voucher_Service.GetByCode(code); if (v != null && v.VoucherDateExpired.Date >= DateTime.Now.Date && v.VoucherState == "A") { if (v.VoucherType == "M")//Giảm tiền { p = p - v.VoucherNum; } else if (v.VoucherType == "P")//Giảm phần trăm { p = p * (100 - v.VoucherNum) / 100; } } } if (num > 0 && menuId > 0) { TB_MENUS m = Menu_Service.GetById(menuId); if (m != null) { p += m.MenuPrice * num; } } Result.Code = 000; Result.Result = string.Format("{0:N0}", p); } catch (Exception Ex) { Result.Code = 2000; Result.Result = 0; CORE.Helpers.IOHelper.WriteLog(StartUpPath, IpAddress, "UpdatePassword :", Ex.Message, Ex.ToString()); } return(Json(Result)); }
public string InsertOrUpdate(TB_SERVICES service, List <TB_SERVICE_DETAILS> details) { string ecode = ""; string edesc = ""; string serviceXml = service.ToStringXml(); string xmlService = "<row>" + serviceXml + "</row>"; string infoXml = ""; foreach (var item in details) { infoXml += "<row>" + item.ToStringXml() + "</row>"; } string xmlInfo = "<row>" + infoXml + "</row>"; TB_SERVICESSql sql = new TB_SERVICESSql(); sql.SelectFromStore(out ecode, out edesc, AppSettingKeys.SP_INSERT_OR_UPDATE_TYPES, xmlService, xmlInfo); return(ecode); }
public PartialViewResult _ServiceDetail(string typeCode = "", int serviceId = 0) { TB_SERVICES s = Services_Service.GetById(serviceId); if (s == null) { s = new TB_SERVICES(); } List <TB_TYPE_DETAILS> details = Types_Service.GetAllDetails(typeCode); ViewBag.Details = details; List <TB_SERVICE_DETAILS> sDetails = Service_Details_Service.GetAllByServiceId(s.ServiceId); ViewBag.SDetails = sDetails; return(PartialView()); }
public ActionResult MenuDetail(int serviceId = 0) { int height = (int)(Request.Browser.ScreenPixelsHeight * 0.85); TB_SERVICES s = Services_Service.GetById(serviceId); ViewBag.Service = s; List <TB_TYPES> list = Types_Service.GetAll(); ViewBag.TypeList = list; try { ViewBag.Images = Files_Service.GetByRefecense("" + s.ServiceId).Where(x => x.FileType == "SERVICE").ToList(); } catch (Exception ex) { CORE.Helpers.IOHelper.WriteLog(StartUpPath, IpAddress, "Blogs/_List :", ex.Message, ex.ToString()); } return(PartialView(height)); }
public JsonResult GetUnitPrice(int serviceId) { AjaxResultModel Result = new AjaxResultModel(); Result.Result = "0 VND"; try { TB_SERVICES s = Services_Service.GetById(serviceId); TB_TYPES t = Types_Service.GetById(s.ServiceTypeCode); Result.Code = 000; Result.Result = new { type = t.TypeType, price = string.Format("{0:N0}", s.ServicePrice) + " " + s.ServiceUnit }; } catch (Exception Ex) { Result.Code = 2000; Result.Result = 0; CORE.Helpers.IOHelper.WriteLog(StartUpPath, IpAddress, "UpdatePassword :", Ex.Message, Ex.ToString()); } return(Json(Result)); }
public bool Update(TB_SERVICES blog) { return(new TB_SERVICESSql().Update(blog)); }
public bool Insert(TB_SERVICES blog) { return(new TB_SERVICESSql().Insert(blog)); }
public string Insert(TB_SERVICES blog) { return(new TB_SERVICESSql().InsertReturnId(blog)); }