private void newform() { ghabz gh = new ghabz(); txtid.Text = gh.Selectmaxid(); DataTable lastmablagh = gh.Search("select top 1(mablagh) from ghabz order by id desc"); if (lastmablagh.Rows.Count > 0) { txtmablagh.Text = lastmablagh.Rows[0][0].ToString(); } else { txtmablagh.Text = "0"; } txtdate.Text = cur_date; txtlastdate.Text = Date.returnLastDateOfaDate(txtdate.Text); txtsharh.Text = ""; groupBox1.Focus(); txtname.Focus(); }
private void fillInfo() { ghabz gh = new ghabz(); txtid.Text = gh.Selectmaxid(); DataTable lastmablagh = gh.Search("select top 1(mablagh) from ghabz order by id desc"); if (lastmablagh.Rows.Count > 0) { txtmablagh.Text = lastmablagh.Rows[0][0].ToString(); } else { txtmablagh.Text = "0"; } txtdate.Text = cur_date; txtsharh.Text = ""; std st = new std(); DataTable dtstdname = new DataTable(); dtstdname = st.Search("SELECT stdno,name FROM std where stdno=" + stdno); txtname.Text = dtstdname.Rows[0]["name"].ToString(); txtstdno.Text = dtstdname.Rows[0]["stdno"].ToString(); txtlastdate.Text = Date.returnLastDateOfaDate(txtdate.Text); groupBox1.Focus(); txtname.Focus(); }