示例#1
0
        public static void VetIDList(VetID ids)
        {
            string hQuery = string.Format(@"SELECT ID,(FIRST_NAME || ' ' || LAST_NAME || ', ID: ' || ID) AS NAME from VET");

            cmdString = new OracleCommand(hQuery, cntString);

            try
            {
                cntString.Open();
                OracleDataAdapter da = new OracleDataAdapter(cmdString);
                DataTable         dt = new DataTable();

                DataSet ds = new DataSet();
                da.Fill(dt);
                ds.Tables.Add(dt);

                //DataView dv = new DataView(dt);
                ids.VetIDs = ds.Tables[0];
            }

            finally
            {
                cntString.Close();
            }
        }
示例#2
0
        }                              // 쓸수 있을까??



        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                VetID   Vids = new VetID(vids);
                OwnerID Oids = new OwnerID(oids);

                try
                {
                    // Display dropdownlist with Vet ID
                    ConnectionClass.VetIDList(Vids);
                    vetIDList.DataSource     = Vids.VetIDs;
                    vetIDList.DataTextField  = Vids.VetIDs.Columns["NAME"].ToString();
                    vetIDList.DataValueField = Vids.VetIDs.Columns["ID"].ToString();
                    vetIDList.DataBind();


                    // Display dropdownlist with Customer(Pet Owner) ID
                    ConnectionClass.OnwerIDList(Oids);
                    cusIDList.DataSource     = Oids.OwnerIDs;
                    cusIDList.DataTextField  = Oids.OwnerIDs.Columns["NAME"].ToString();
                    cusIDList.DataValueField = Oids.OwnerIDs.Columns["ID"].ToString();
                    cusIDList.DataBind();
                }

                finally
                {
                }
                // Display Calendar with month, year and date
                for (int i = 1; i <= 12; i++)
                {
                    System.Globalization.DateTimeFormatInfo monthnum = new System.Globalization.DateTimeFormatInfo();
                    month.Items.Add(new ListItem(monthnum.GetAbbreviatedMonthName(i).ToString(), i.ToString()));
                }

                for (int i = 2015; i <= System.DateTime.Now.Year + 1; i++)
                {
                    year.Items.Add(new ListItem(i.ToString(), i.ToString()));
                }
            }
        }