public string layMotKhachHang(string soTKLK) { QLyKHDTO khachHang = QLKHDAO.layMotKhachHang(soTKLK); string jsonData = JsonConvert.SerializeObject(khachHang); return(jsonData); }
public int KTThongTinThemKH(string soTKLK, DateTime ngayMoTK, string hoTen, DateTime ngaySinh, string noiCap, string soCMND, string diaChi, string hanMucVay, string SDT) { DateTime ngayDu18Tuoi = ngaySinh.AddYears(18); Check check = new Check(); if (soTKLK == "") { return(1); } if (hoTen == "") { return(2); } if (noiCap == "") { return(3); } if (soCMND == "") { return(4); } if (diaChi == "") { return(5); } if (hanMucVay == "") { return(6); } if (SDT == "") { return(7); } if (ngayMoTK < ngayDu18Tuoi) { return(8); } if (check.ChiChuaChuCai(hoTen) == false) { return(9); } if (check.ChiChuaChuSo(hanMucVay) == false) { return(10); } if (!check.ChiChuaChuSo(soCMND)) { return(11); } if (!check.ChiChuaChuSo(SDT)) { return(12); } if (QLKHDAO.layMotKhachHang(soTKLK) != null) { return(13); } if (soTKLK.Length != 10 || !check.ChiChuaChuSo(soTKLK.Substring(4, 6)) || soTKLK.Substring(0, 4) != "001C") { return(14); } if (QLKHDAO.GetKhachHang(soCMND) != null) { return(15); } return(0); }