Exemplo n.º 1
0
        private void DevButtonAdd_Click(object sender, EventArgs e)
        {
            List <recoder1> list = new List <recoder1>();

            list = gridControl1.DataSource == null ? list : gridControl1.DataSource as List <recoder1>;
            recoder1 rec = new recoder1();

            rec.Noofinpat   = CurrentNoofinpat.NoOfFirstPage.ToString();
            rec.UterineRaws = Guid.NewGuid().ToString();
            rec.CheckTime   = DateTime.Now.ToString();
            list.Add(rec);
            gridControl1.DataSource = list;
            gridView1.RefreshData();
        }
Exemplo n.º 2
0
        private void Init()
        {
            timeEditCheckTime.Time = DateTime.Now;
            SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@Noofinpat", CurrentNoofinpat.NoOfFirstPage.ToString()) };
            //sqlParams[0].Value = "100000";//CurrentNoofinpat.NoOfFirstPage.ToString();
            //sqlParams[1].Direction = ParameterDirection.Output;
            DataSet   ds = m_app.SqlHelper.ExecuteDataSet("BIRTHPROCESS.usp_GetBIRTHPROCESS_UTERINE", sqlParams, CommandType.StoredProcedure);
            DataTable dt = ds.Tables[0];

            List <recoder1> list = new List <recoder1>();

            foreach (DataRow row in dt.Rows)
            {
                recoder1       rec          = new recoder1();
                Type           t            = rec.GetType();
                PropertyInfo[] PropertyList = t.GetProperties();
                foreach (PropertyInfo info in PropertyList)
                {
                    info.SetValue(rec, row[info.Name].ToString(), null);
                }
                list.Add(rec);
            }
            gridControl1.DataSource = list;
        }