public void Luu(ref string thongDiep)
        {
            EpKim epKim = new EpKim();

            epKim.ID                = View.ID;
            epKim.Ten               = View.Ten;
            epKim.BHR               = View.BHR;
            epKim.DonViTinh         = View.DonViTinh;
            epKim.GiaKhuonCm2       = View.GiaKhuonCM2;
            epKim.LaNhuViTinh       = View.LaNhuViTinh;
            epKim.TocDoConGio       = View.TocDo;
            epKim.PhiNVLChuanBi     = View.PhiNguyenVatLieuChuanBi;
            epKim.ThoiGianChuanBi   = View.ThoiGianChuanBi;
            epKim.DaySoLuong        = View.DaySoLuongCoBan;
            epKim.DayLoiNhuan       = View.DayLoiNhuanCoBan;
            epKim.DaySoLuongNiemYet = View.DaySoLuongNiemYet;
            epKim.ThuTu             = View.ThuTu;

            switch (View.TinhTrangForm)
            {
            case FormStateS.Edit:
                thongDiep = EpKim.Sua(epKim);
                break;

            case FormStateS.New:
                thongDiep = EpKim.Them(epKim);
                break;
            }
        }
Exemple #2
0
        public string LuuDaySoLuong()
        {
            var mg          = "";
            var iDThanhPham = MonThanhPham.DocDVThanhPhamTheoId(View.IdMonThanhPham).ID_DV;
            var LoaiTP      = MonThanhPham.DocDVThanhPhamTheoId(View.IdMonThanhPham).LoaiThPham;

            switch (LoaiTP)
            {
            case LoaiThanhPhamS.CanPhu:
                var canPhu = CanPhu.DocTheoId(iDThanhPham);
                canPhu.DaySoLuongNiemYet = View.DaySoluong;
                mg = CanPhu.Sua(canPhu);
                break;

            case LoaiThanhPhamS.CanGap:
                var canGap = CanGap.DocTheoId(iDThanhPham);
                canGap.DaySoLuongNiemYet = View.DaySoluong;
                mg = CanGap.Sua(canGap);
                break;

            case LoaiThanhPhamS.DongCuon:
                var dongCuon = DongCuon.DocTheoId(iDThanhPham);
                dongCuon.DaySoLuongNiemYet = View.DaySoluong;
                mg = DongCuon.Sua(dongCuon);
                break;

            case LoaiThanhPhamS.EpKim:
                var epKim = EpKim.DocTheoId(iDThanhPham);
                epKim.DaySoLuongNiemYet = View.DaySoluong;
                mg = EpKim.Sua(epKim);
                break;
            }
            return(mg);
        }