Ejemplo n.º 1
0
        private void DataGridDataBind()
        {
            string connStr = WebConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;
            string sqlText = "select ID,Title,Style,Type,IssueDate from tbNews where IssueDate='" + Request["dateValue"] + "'";
            //string sqlText = "select ID,Title,Style,Type,IssueDate from tbNews where IssueDate='" + "2006-03-28" + "'";
            SqlConnection  conn    = new SqlConnection();
            SqlDataAdapter adapter = new SqlDataAdapter(sqlText, connStr);
            DataTable      tbl     = new DataTable();

            adapter.Fill(tbl);
            try
            {
                if (tbl.Rows.Count == 0)
                {
                    Response.Write("您指定的日期没有发布任何新闻");
                } // end if
                else
                {
                    MyDataView.DataSource = tbl;
                    MyDataView.DataBind();
                } // end else
            }     // end try
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            } // end catch
        }     // end method DataGridDataBind
Ejemplo n.º 2
0
        private void myEditTreeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            String    id     = myEditTreeView1.FieldValue.ToString();                                                                                     //单品ID
            String    sql    = "select *,(SELECT F_NAME FROM CK_COMPANY WHERE F_ID=F_COMPANYID)as F_COMPANYNAME from [CK_PRODUCT] where F_PROTYPE=" + id; //用于查询这个商品的全部信息
            IAdapter  iad    = (IAdapter)iapplication.GetService(typeof(IAdapter));
            DataTable ntable = (DataTable)iad.RunCmdnoCheck("AFunction2", new object[] { sql });

            if (ntable.Rows.Count > 0)
            {
                MyDataView mdv = new MyDataView();
                mdv.SetKey("f_id");
                foreach (DataRow dr in ntable.Rows)
                {
                    mdv.SelectedRows.Add(dr["f_id"].ToString(), dr);
                }
                mdv.iapplication = iapplication;
                FormProductInfo fpdi = new FormProductInfo(iapplication, mdv, listView1, ntable, MyRealAmount, MyOrderNumber.FieldValue.ToString());
                fpdi.ShowForm(FormType.Edit);
            }
            else
            {
                MessageBox.Show("商品信息不完整, 请到商品管理进行设置!");
            }
        }
Ejemplo n.º 3
0
 public MyDataCell(EventListingItem myData, string identKey) : base(UITableViewCellStyle.Default, identKey)
 {
     _myDataView = new MyDataView(myData);
     ContentView.Add(_myDataView);
 }