Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id         = Request["ID"];
        var khId       = Request["KH_ID"];
        var list       = new List <PhieuXuatNhapSanPhamChiTiet>();
        var listThuChi = new List <ThuChi>();

        using (var con = DAL.con())
        {
            if (string.IsNullOrEmpty(id))
            {
                Item    = ChoThueVayDal.SelectDraff(con);
                Item.Ma = Item.Ma == 0 ? 1 : Item.Ma + 1;
                Item.ID = Guid.NewGuid();
                if (!string.IsNullOrEmpty(khId))
                {
                    var kh = KhachHangDal.SelectById(new Guid(khId), con);
                    Item.KH_ID  = kh.ID;
                    Item.KH_Ten = kh.Ten;
                }
            }
            else
            {
                Item       = ChoThueVayDal.SelectById(con, new Guid(id));
                list       = PhieuXuatNhapSanPhamChiTietDal.SelectByPxnSpId(con, id);
                listThuChi = ThuChiDal.SelectByCtvId(con, Item.ID);
            }
            Add.ListThuChi = listThuChi;
            Add.List       = list;
            Add.Item       = Item;;
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var id         = Request["ID"];
        var listThuChi = new List <ThuChi>();

        using (var con = DAL.con())
        {
            if (string.IsNullOrEmpty(id))
            {
                Item    = PhieuBaoHongDal.SelectDraff(con);
                Item.Ma = Item.Ma == 0 ? 1 : Item.Ma + 1;
                Item.ID = Guid.NewGuid();
            }
            else
            {
                Item       = PhieuBaoHongDal.SelectById(con, new Guid(id));
                listThuChi = ThuChiDal.SelectByCtvId(con, Item.ID);
            }
            Add.Item       = Item;;
            Add.ListThuChi = listThuChi;
        }
    }