private void DiaChiInfoPrepare(DiaChiModel model) { var states = _stateProvinceService.GetStateProvincesByCountryId(NhaXesController.CountryID); if (states.Count > 0) { foreach (var s in states) { model.AvailableStates.Add(new SelectListItem { Text = s.Name, Value = s.Id.ToString(), Selected = (s.Id == model.ProvinceID) }); } int ProvinceID = Convert.ToInt32(model.AvailableStates[0].Value); if (model.Id > 0 && model.ProvinceID > 0) { ProvinceID = model.ProvinceID.GetValueOrDefault(0); } var quanhuyens = _diachiService.GetQuanHuyenByProvinceId(ProvinceID); model.AvailableQuanHuyens.Add(new SelectListItem { Text = GetLabel("ChonQuanHuyen"), Value = "0", Selected = (model.QuanHuyenID == 0) }); foreach (var s in quanhuyens) { model.AvailableQuanHuyens.Add(new SelectListItem { Text = s.Ten, Value = s.Id.ToString(), Selected = (s.Id == model.QuanHuyenID) }); } } }
public DiaChiModel themdiachi(DiaChiModel dc) { DiaChiModel dcmoi = new DiaChiModel(); dcmoi = item.ThemDiaChi(dc); return(dcmoi); }
public DiaChiModel themdiachi(DiaChiModel dc) { string msgError = ""; try { var dt = _dbHelper.ExecuteSProcedureReturnDataTable(out msgError, "themdiachi", "@makh", dc.MaKhachHang, "@xa", dc.Xa, "@huyen", dc.Huyen, "@tinh", dc.Tinh, "@chitiet", dc.ChiTiet, "@sdt", dc.SoDienThoai); if (!string.IsNullOrEmpty(msgError)) { throw new Exception(msgError); } return(dt.ConvertTo <DiaChiModel>().FirstOrDefault()); } catch (Exception ex) { throw ex; } }
public DiaChiModel ThemDiaChi(DiaChiModel dc) { return(_res.themdiachi(dc)); }
public static DiaChi ToEntity(this DiaChiModel model, DiaChi destination) { return(model.MapTo(destination)); }
public static DiaChi ToEntity(this DiaChiModel model) { return(model.MapTo <DiaChiModel, DiaChi>()); }
public BenXeModel() { ThongTinDiaChi = new DiaChiModel(); HienThi = true; }