public HttpResponseMessage Check([FromBody] acc value) { DB db = new DB(); var acc = (from temp in db.MKV9999 where temp.manhansu == value.ID || temp.cmtnd_so == value.ID select temp).Select(p => new { p.MKV9999_ID, p.manhansu, p.matkhau, p.id, p.hodem, p.ten, p.type, p.ngaysinh, p.gioitinh, p.noisinh, p.quequan, p.diachithuongtru, p.diachitamtru, p.cmtnd_so, p.cmtnd_ngayhethan, p.cmtnd_noicap, p.hochieu_so, p.hochieu_ngaycap, p.hochieu_ngayhethan, p.ngayvaocongty, p.phong_id, p.ban_id, p.congdoan_id, p.chucvu_id, p.nganhang_stk, p.nganhang_id, p.sosobaohiem, p.honnhantinhtrang, p.datnuoc_id, p.phuongxa, p.suckhoetinhtrang, p.dienthoai_nharieng, p.dienthoai_didong, p.email, p.tinhtrangnhansu, p.thutu, p.chucvu, p.capbac, thetu_id = db.MKV9998.Where(o => p.phong_id == o.phong_id).Select(o => o.bophan_ten).FirstOrDefault(), KTX0001 = db.KTX0001.Where(l => l.KTX0001_ID == db.KTX0020.Where(j => j.MKV9999_ID == p.MKV9999_ID && j.trangthai2 != true).Select(j => j.MKV9999_ID).FirstOrDefault()).Select(o => new { o.capbac, o.ghichu, o.idcha, o.khu, o.KTX0001_ID, o.makhoa, o.slot, o.ten, o.thutu, o.trangthai, o.type }) }).FirstOrDefault(); return(REST.GetHttpResponseMessFromObject(acc)); }
Insert(acc, x.value, x.start, x.count)));
=> Enumerable.Range(1, arr.Length - 1).Select(id => (id, arr[id])).Aggregate(func(seed, 0, arr[0]), (acc, pair) => func(acc, pair.Item1, pair.Item2));
var(acc, other) = a;
public JsonResult themtaikhoan(string a, string b, string c, string d, string e, string g) { string avg = ""; if (KyTu.kiemtra(a) == true || KyTu.kiemtra(b) == true || KyTu.kiemtra(c) == true || KyTu.kiemtra(d) == true || KyTu.kiemtra(e) == true) { avg = "Không được nhập Ký tự đặc biệt chỉ có thể nhập a-z 0-9"; } else { //tim so dien thoai try { if (db.infoes.Where(n => n.number_phone == a).Count() != 0) { avg = "Số điện thoại đã được sử dụng"; } else { if (db.accs.Where(n => n.taikhoan == a).Count() != 0) { avg = "sdt đã có tài khoản đăng ký"; } else { try { acc ac = new acc(); ac.taikhoan = a; ac.matkhau = MD5.ToMD5(b.Trim()); ac.daxoa = false; ac.email = g; ac.chucvu = 3; ac.taikhoanquanly = "ADminVip"; info inf = new info(); inf.nameFull = d; inf.age = Convert.ToInt32(e.Trim()); inf.adress = c; inf.number_phone = a; inf.taikhoan = a; db.accs.Add(ac); db.infoes.Add(inf); db.SaveChanges(); avg = "Cảm Ơn Bạn Đã sử dụng dịch vụ của chúng tôi"; } catch (Exception) { avg = "đã có lỗi sảy ra "; } } } } catch { avg = "404"; } } return(Json(avg)); }
//add product in database //changPass public JsonResult RegistrationJson(string AccRegistration, string PassRegistration, string NameRegistration, string numberPhoneRegistration, string AdressRegistration, string EmailRegistration) { /* * 1 trong co ky tu dac biet * 2 kiem tra nay tai khoan da co chuwa * 3 kiem tra xem da co gmail nay chua * 4 co loi he thong * 5 thanh cong */ string Trave = ""; try { if (AccRegistration == null || AccRegistration == "" || PassRegistration == null || PassRegistration == "" || NameRegistration == null || NameRegistration == "" || numberPhoneRegistration == null || numberPhoneRegistration == "" || AdressRegistration == null || AdressRegistration == "" || EmailRegistration == null || EmailRegistration == "") { Trave = "6"; } else { if (KyTu.kiemtra(AccRegistration) == true || KyTu.kiemtra(PassRegistration) == true || KyTu.kiemtra(NameRegistration) == true || KyTu.kiemtra(numberPhoneRegistration) == true || KyTu.kiemtra(AdressRegistration) == true || KyTu.kiemtra(EmailRegistration) == true) { Trave = "1"; } else { if (db.accs.Where(n => n.taikhoan == AccRegistration).Count() == 0) { if (db.accs.Where(n => n.email == EmailRegistration).Count() == 0) { acc ac = new acc(); ac.taikhoan = AccRegistration; ac.matkhau = MD5.ToMD5(PassRegistration.Trim()); ac.daxoa = false; ac.email = EmailRegistration; ac.chucvu = 3; ac.taikhoanquanly = "ADminVip"; info inf = new info(); inf.nameFull = NameRegistration; inf.age = Convert.ToInt32(18); inf.adress = AdressRegistration; inf.number_phone = numberPhoneRegistration; inf.taikhoan = AccRegistration; db.accs.Add(ac); db.infoes.Add(inf); db.SaveChanges(); Trave = "5"; } else { Trave = "3"; } } else { Trave = "2"; } } } } catch (Exception) { Trave = "4"; } return(Json(Trave)); }
return(values.Aggregate(0, (acc, x) => Insert(acc, x.value, x.start, x.count)));
public static int Compose(params (int value, int start, int count)[] values) => values.Aggregate(0, (acc, x) => Insert(acc, x.value, x.start, x.count));
? ParseResult.Success(folder(acc, v)) : default,