Ejemplo n.º 1
0
        void search()
        {
            gridControl1.ItemsSource = null;
            gridControl1.ShowLoadingPanel = true;
            QLThuebaoDomainContext db = new QLThuebaoDomainContext();
            //if ((txtsodt.Text.Trim() != "" || txtsodt.Text.Trim() != "0") && txtsodt.Text.Trim().Length < 7)
            //{
            //    MessageBox.Show("Nhập chưa đúng số điện thoại !");
            //    return;
            //}
            if (txtsodt.Text.Trim() != "" && txtsodt.Text.Trim() !="0")
            {
                EntityQuery<DSCD> Query = db.Getds1080Query(txtsodt.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }
            if (txttentb.Text.Trim() != "" && txtdcld.Text.Trim() == "" && txtttin108.Text.Trim() == "")
            {
                EntityQuery<DSCD> Query = db.Getds10801Query(txttentb.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }

            if (txttentb.Text.Trim() != "" && txtdcld.Text.Trim() != "" && txtttin108.Text.Trim() == "")
            {
                EntityQuery<DSCD> Query = db.Getds10802Query(txttentb.Text.Trim(), txtdcld.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }

            if (txttentb.Text.Trim() != "" && txtdcld.Text.Trim() != "" && txtttin108.Text.Trim() != "")
            {
                EntityQuery<DSCD> Query = db.Getds10803Query(txttentb.Text.Trim(), txtdcld.Text.Trim(), txtttin108.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }

            if (txttentb.Text.Trim() == "" && txtdcld.Text.Trim() == "" && txtttin108.Text.Trim() != "")
            {
                EntityQuery<DSCD> Query = db.Getds10804Query(txtttin108.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }
            if (txttentb.Text.Trim() == "" && txtdcld.Text.Trim() != "" && txtttin108.Text.Trim() == "")
            {
                EntityQuery<DSCD> Query = db.Getds10805Query(txtdcld.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }
        }