public string GetmaCK(string maCK) { QLCKDTO chungkhoan = QLCKDAO.laymotCK(maCK); string jsonData = JsonConvert.SerializeObject(chungkhoan); return(jsonData); }
public int KTThongTinThemCK(string maCK, string tenCK, string giaTran, string giaSan) { Check check = new Check(); if (maCK == "") { return(1); } if (tenCK == "") { return(2); } if (giaTran == "") { return(3); } if (giaSan == "") { return(4); } if (check.LaMotSoNguyenDuong(giaTran) == false || long.Parse(giaTran) % 1000 != 0) { return(5); } if (check.LaMotSoNguyenDuong(giaSan) == false || long.Parse(giaSan) % 1000 != 0) { return(6); } if (check.ChiChuaChuCai(maCK) == false || maCK.Length != 3) { return(7); } if (check.ChiChuaChuCai(tenCK) == false || tenCK.Length > 50) { return(8); } if (long.Parse(giaTran) < long.Parse(giaSan)) { return(9); } if (QLCKDAO.laymotCK(maCK) != null) { return(10); } return(0); }