コード例 #1
0
ファイル: Rents.cs プロジェクト: FatemaOthman/Data-Base
        public Rents(Controller contobj1, MainPage M1)
        {
            InitializeComponent();
            contobj = contobj1;
            M       = M1;

            string[] Status = new string[3] {
                "ALL", "Paid", "Not-Paid"
            };
            RS.DataSource = Status;
            RS.Refresh();


            DataTable dt1 = contobj.GetAllCollecters();

            RC.DataSource    = dt1;
            RC.DisplayMember = "Employee_FirstName";

            RC.ValueMember = "Employee_Id";
            RC.Refresh();

            DataTable dt2 = contobj.GetAllCollecters();

            Collecter.DataSource    = dt2;
            Collecter.DisplayMember = "Employee_FirstName";
            Collecter.ValueMember   = "Employee_Id";
            Collecter.Refresh();

            DataTable dt3 = contobj.GetAllUnits();

            Units.DataSource  = dt3;
            Units.ValueMember = "Unit_Id";
            Units.Refresh();

            DataTable dt4 = contobj.GetAllTenants();

            tenants.DataSource    = dt4;
            tenants.DisplayMember = "Tenant_FirstName";
            tenants.ValueMember   = "Tenant_Id";
            tenants.Refresh();
            DataTable dt5 = contobj.GetAllBuildings();

            BCC.DataSource    = dt5;
            BCC.DisplayMember = "Building_Name";
            BCC.ValueMember   = "Building_Id";
            BCC.Refresh();

            DataTable dt6 = contobj.GetAllOwners();

            Owners.DataSource    = dt6;
            Owners.DisplayMember = "Owner_Name";
            Owners.ValueMember   = "Owner_Id";
            Owners.Refresh();
        }