Beispiel #1
0
        public HttpResponseMessage ThemMoiChiTieu(ChiTieuKhachHang chiTieuKhachHang)
        {
            Ma_Chi_Tieu_CT = Ma_Chi_Tieu_CT + 1;

            ChiTieuKhachHang chiTieuKhach = new ChiTieuKhachHang();

            chiTieuKhach.Nam          = chiTieuKhachHang.Nam;
            chiTieuKhach.Status       = chiTieuKhachHang.Status;
            chiTieuKhach.Ten_Chi_Tieu = chiTieuKhachHang.Ten_Chi_Tieu;
            chiTieuKhach.Ma_Chi_Tieu  = Convert.ToString(Ma_Chi_Tieu_CT);
            listCTKH.Add(chiTieuKhach);
            return(Request.CreateResponse(HttpStatusCode.OK, JsonConvert.SerializeObject(Tuple.Create(listCTKH))));
        }
Beispiel #2
0
 public HttpResponseMessage UpdateChiTieu(ChiTieuKhachHang chiTieuKhachHang)
 {
     for (int i = 0; i < listCTKH.Count; i++)
     {
         if (chiTieuKhachHang.Ma_Chi_Tieu.Equals(listCTKH[i].Ma_Chi_Tieu))
         {
             listCTKH[i].Nam          = chiTieuKhachHang.Nam;
             listCTKH[i].Status       = chiTieuKhachHang.Status;
             listCTKH[i].Ten_Chi_Tieu = chiTieuKhachHang.Ten_Chi_Tieu;
             break;
         }
     }
     return(Request.CreateResponse(HttpStatusCode.OK, true));
 }