示例#1
0
 private void Form2_Load(object sender, EventArgs e)
 {
     // MessageBox.Show("");
     try
     {
         context = new DBDataContext();
         var result = from l in context.TBL_LICENSE_GENERATEs select l;
         dataGridView1.DataSource = result;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
示例#2
0
        public DataTable ShowAllCurrencyToComboBox()
        {
            _context = new DBDataContext();
            var result = from s in _context.TLKP_CURRENCies
                         select s;
            DataTable dt = new DataTable();

            dt.Columns.Add("CURRENCY_ID");
            dt.Columns.Add("CURRENCY_NAME");
            DataRow row1 = dt.NewRow();

            row1["CURRENCY_ID"]   = 0;
            row1["CURRENCY_NAME"] = Properties.Resources.ALL_CURRENCY;
            dt.Rows.Add(row1);
            foreach (var q in result)
            {
                DataRow row = dt.NewRow();
                row["CURRENCY_ID"]   = q.CURRENCY_ID;
                row["CURRENCY_NAME"] = q.CURRENCY_NAME;
                dt.Rows.Add(row);
            }
            return(dt);
        }
        public DataTable ShowAllConnectionTypeToComboBox()
        {
            _context = new DBDataContext();
            var result = from s in _context.TLKP_CUSTOMER_CONNECTION_TYPEs
                         select s;
            DataTable dt = new DataTable();

            dt.Columns.Add("CUSTOMER_CONNECTION_TYPE_ID");
            dt.Columns.Add("CUSTOMER_CONNECTION_TYPE_NAME");
            DataRow row1 = dt.NewRow();

            row1["CUSTOMER_CONNECTION_TYPE_ID"]   = 0;
            row1["CUSTOMER_CONNECTION_TYPE_NAME"] = Properties.Resources.ALL_CUSTOMER_CON_TYPE;
            dt.Rows.Add(row1);
            foreach (var q in result)
            {
                DataRow row = dt.NewRow();
                row["CUSTOMER_CONNECTION_TYPE_ID"]   = q.CUSTOMER_CONNECTION_TYPE_ID;
                row["CUSTOMER_CONNECTION_TYPE_NAME"] = q.CUSTOMER_CONNECTION_TYPE_NAME;
                dt.Rows.Add(row);
            }
            return(dt);
        }