public tb_SpGoodsInfo Find(string _goodsname) { tb_SpGoodsInfo goods = new tb_SpGoodsInfo(); string sql = "select GoodId,GoodName,ItemNO,ModelNO,GoodMaterial,FImagePath,FColor,FMaterialQty from tb_SpGoodsInfo where GoodName ='" + _goodsname + "'"; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { goods.strGoodsId = ds.Tables[0].Rows[i][0].ToString(); goods.strGoodsName = ds.Tables[0].Rows[i][1].ToString(); goods.strItemNO = ds.Tables[0].Rows[i][2].ToString(); goods.strModelNO = ds.Tables[0].Rows[i][3].ToString(); goods.strGoodMaterial = ds.Tables[0].Rows[i][4].ToString(); goods.strFImagePath = ds.Tables[0].Rows[i][5].ToString(); goods.strFColor = ds.Tables[0].Rows[i][6].ToString(); } } } } return(goods); }
public tb_ModelInfo Find(string _Modelsname) { tb_ModelInfo goods = new tb_ModelInfo(); string sql = "select ModelNo,ModelName,FTypeSteps1,FTypeSteps2,FTypeSteps3,FImagePath,FMaterialQty from tb_ModelInfo where ModelName ='" + _Modelsname + "' and FIsStop = 0"; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { goods.strModelNo = ds.Tables[0].Rows[i][0].ToString(); goods.strModelName = ds.Tables[0].Rows[i][1].ToString(); goods.strFTypeSteps1 = ds.Tables[0].Rows[i][2].ToString(); goods.strFTypeSteps2 = ds.Tables[0].Rows[i][3].ToString(); goods.strFTypeSteps3 = ds.Tables[0].Rows[i][4].ToString(); goods.strFImagePath = ds.Tables[0].Rows[i][5].ToString(); goods.strFMaterialQty = ds.Tables[0].Rows[i][6].ToString(); //goods.strFImagePath = ds.Tables[0].Rows[i][5].ToString(); } } } } return(goods); }
public void Reflesh() //实时更新 { DataSet dsUsers; string strSql = "select u_Name 用户名称,u_Pass 用户密码,u_Type 用户类型,u_Stopuser 是否停用 FROM Users"; dsUsers = su.GetDataset(strSql); dgvUserselect.DataSource = dsUsers; dgvUserselect.DataMember = dsUsers.Tables[0].ToString(); }
private void tsbOk_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = dbl.GetDataset("select * from SystemSet"); int SetTeacherBroNumber = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); //获得教师可以借阅读书的数量 int SetStudnetBroNumber = Convert.ToInt32(ds.Tables[0].Rows[0][1].ToString()); //获得学生等可以借阅图书的数量 if (rdbBorrow.Checked == true) { if (labReaderTypeID.Text.Trim() == "教师") { Borrow(SetTeacherBroNumber); } else { Borrow(SetStudnetBroNumber); } } if (rdbReback.Checked == true) { Reback(); } if (rdbContuine.Checked == true) { //判断是否有借阅要续借的图书 if (Convert.ToInt32(dbc.ExecuteSelect("select * from Borrow where CardID='" + labCardId.Text.Trim() + "' and BookID='" + labBookID.Text.Trim() + "'")) > 0) { Renew(); } else { MessageBox.Show("该读者没有借阅过此图书或已经归还!", "提示"); } } if (rdbForBorrow.Checked == true) { if (labReaderTypeID.Text.Trim() == "教师") { ReserBorrow(SetTeacherBroNumber); } else { ReserBorrow(SetStudnetBroNumber); } } string a = labCardId.Text; }
private void FreshModels() { string sql = @"SELECT ColorNo , ColorName , FColorSteps , FIsStop FROM tb_ColorInfo order by FCreateDate desc,ColorNo asc"; ds = dbl.GetDataset(sql, "tb_ColorInfo"); if (ds != null) { dataSource = ds.Tables[0]; context = dataSource; //dataMember = ((DataTable)dataSource).DefaultView; superGridControl1.PrimaryGrid.DataSource = ds; superGridControl1.PrimaryGrid.DataMember = "tb_ColorInfo"; Bm = (dataSource != null) ? superGridControl1.BindingContext[context] : null; if (Bm.Count >= 0) { toolbar1.btnEditEnabled = true; toolbar1.btndelete.Enabled = true; } } else { superGridControl1.PrimaryGrid.DataSource = null; } }
private void FreshModels() { string sql = @"SELECT ModelNo ,ModelName ,FImagePath ,FTypeSteps1 ,FTypeSteps2 ,FTypeSteps3 ,FIsStop ,FMaterialQty FROM tb_ModelInfo ORDER BY ModelName asc"; ds = dbl.GetDataset(sql, "tb_ModelInfo"); if (ds != null) { dataSource = ds.Tables[0]; context = dataSource; //dataMember = ((DataTable)dataSource).DefaultView; superGridControl1.PrimaryGrid.DataSource = ds; superGridControl1.PrimaryGrid.DataMember = "tb_ModelInfo"; Bm = (dataSource != null) ? superGridControl1.BindingContext[context] : null; if (Bm.Count >= 0) { toolbar1.btnEditEnabled = true; toolbar1.btndelete.Enabled = true; } } else { superGridControl1.PrimaryGrid.DataSource = null; } }
private void FreshGoods() { string sql = "select GoodId,GoodName,ModelNO,GoodMaterial,FImagePath,FColor,FTypeSteps1,FTypeSteps2,FTypeSteps3,FColorSteps,FIsStop,FMaterialQty from tb_SpGoodsInfo where FIsStop = 0 order by FCreateDate desc,GoodName asc"; ds = dbl.GetDataset(sql, "tb_SpGoodsInfo"); if (ds != null) { dataSource = ds.Tables[0]; context = dataSource; //dataMember = ((DataTable)dataSource).DefaultView; superGridControl1.PrimaryGrid.DataSource = ds; superGridControl1.PrimaryGrid.DataMember = "tb_SpGoodsInfo"; Bm = (dataSource != null) ? superGridControl1.BindingContext[context] : null; if (Bm.Count >= 0) { toolbar1.btnEditEnabled = true; toolbar1.btndelete.Enabled = true; } } else { superGridControl1.PrimaryGrid.DataSource = null; } }
private void FreshGroups() { string sql = @"SELECT GroupId , Name , IsStop , Admin , Memo FROM BaseGroup order by GroupId"; ds = dbl.GetDataset(sql, "BaseGroup"); if (ds != null) { dataSource = ds.Tables[0]; context = dataSource; superGridControl1.PrimaryGrid.DataSource = ds; superGridControl1.PrimaryGrid.DataMember = "BaseGroup"; Bm = (dataSource != null) ? superGridControl1.BindingContext[context] : null; if (Bm.Count >= 0) { toolbar1.btnEditEnabled = true; toolbar1.btndelete.Enabled = true; } } else { superGridControl1.PrimaryGrid.DataSource = null; } }
public tb_JCH tb_JCHFind(string _sql, string _fieldsname) { tb_JCH jch = new tb_JCH(); Dblink dbl1 = new Dblink(); string[] s = _fieldsname.Split(','); try { DataSet ds = dbl1.GetDataset(_sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < s.Length; i++) { } } } } return(jch); } catch (Exception ee) { MessageBox.Show(ee.Message.ToString()); return(null); } }
public BaseGroup Find(int groupid) { BaseGroup groups = new BaseGroup(); string sql = "select groupid,Name,IsStop,Admin,Memo from BaseGroup where groupid =" + groupid + " and FIsStop = 0 "; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { groups.GroupId = Convert.ToInt16(ds.Tables[0].Rows[i]["groupid"]); groups.Name = ds.Tables[0].Rows[i]["Name"].ToString(); groups.IsStop = Convert.ToInt16(ds.Tables[0].Rows[i]["Name"]); groups.Admin = Convert.ToInt16(ds.Tables[0].Rows[i]["Admin"]); groups.Memo = ds.Tables[0].Rows[i]["Memo"].ToString(); } } } } return(groups); }
private void frmPubChange_Load(object sender, EventArgs e) { this.MaximizeBox = false; this.MinimizeBox = false; txtNumber.ReadOnly = true; if (this.Text == "出版社信息(修改)") { //利用获得的编号去搜索符合条件的信息 ds = dbl.GetDataset("select * from Publishing where PulNumber =" + txtNumber.Text.Trim() + ""); txtName.Text = Convert.ToString(ds.Tables[0].Rows[0][1]); txtAdress.Text = Convert.ToString(ds.Tables[0].Rows[0][2]); txtShuoming.Text = Convert.ToString(ds.Tables[0].Rows[0][3]); } }
public static string userid(string username) { string userid = ""; string selnum = "select empid from tb_empinfo where empname='" + username + "'"; //getSqlConnection getConnection = new getSqlConnection(); Dblink dbl = new Dblink(); DataSet ds = dbl.GetDataset(selnum); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { userid = ds.Tables[0].Rows[0]["empid"].ToString(); } } } return(userid); }
private void timer1_Tick(object sender, EventArgs e) { tssl3.Text = "现在时间:" + System.DateTime.Now.ToLongTimeString(); string time = dbl.Remindtime(); if (Convert.ToInt32(db.ExecuteSelect("select * from Remind where RemindTime='" + time + "'and IsRemind='是' and Statue='尚未提示'")) > 0) { DataSet ds = new DataSet(); ds = dbl.GetDataset("select * from Remind where RemindTime='" + time + "'"); string Reminid = Convert.ToString(ds.Tables[0].Rows[0][3]); //获得备忘表中的备忘记录 string type = Convert.ToString(ds.Tables[0].Rows[0][5]); if (type == "一次提醒") { db.ExeInfochange("update Remind set Statue='已经提示' where RemindTime='" + time + "'"); //更改提示的状态 } if (MessageBox.Show("\n 您有新的备忘: \n \n" + " " + Reminid + " ", "备忘提示", MessageBoxButtons.OK, MessageBoxIcon.Question) == DialogResult.Yes) { fmr.Refresh(); } } }
public int getThisworknumSumQty(string usercode) { int qty = 0; string selnum = "select isnull(sum(PlQty),0) as PlQty from SelPorceLain where PlApplyDate='" + System.DateTime.Today + "' and PLOperatorID = '" + usercode + "'"; //getSqlConnection getConnection = new getSqlConnection(); DataSet ds = dblink.GetDataset(selnum); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { qty = Convert.ToInt32(Convert.ToInt32(ds.Tables[0].Rows[0]["PlQty"].ToString())); } } } return(qty); }
public tb_ColorInfo Find(string _colorNO) { tb_ColorInfo goods = new tb_ColorInfo(); string sql = "select ColorNo,ColorName,FColorSteps from tb_ColorInfo where ColorNo ='" + _colorNO + "' and FIsStop = 0 "; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { goods.strColorNo = ds.Tables[0].Rows[i][0].ToString(); goods.strColorName = ds.Tables[0].Rows[i][1].ToString(); goods.strFColorSteps = ds.Tables[0].Rows[i][2].ToString(); } } } } return(goods); }
public tb_WareHouse Find(string _id) { tb_WareHouse goods = new tb_WareHouse(); string sql = "select WareID,WareName,Remark from tb_WareHouse where WareID ='" + _id + "'"; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { goods.strWareID = ds.Tables[0].Rows[i][0].ToString(); goods.strWareName = ds.Tables[0].Rows[i][1].ToString(); goods.strRemark = ds.Tables[0].Rows[i][2].ToString(); } } } } return(goods); }
public tb_Base Find(string _baseid) { tb_Base goods = new tb_Base(); string sql = "select FClass,FBaseID,FBaseName,FRemark from tb_Base where FBaseID ='" + _baseid + "'"; DataSet ds = dbl.GetDataset(sql); if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { goods.strFClass = ds.Tables[0].Rows[i][0].ToString(); goods.strFBaseID = ds.Tables[0].Rows[i][1].ToString(); goods.strFBaseName = ds.Tables[0].Rows[i][2].ToString(); goods.strFRemark = ds.Tables[0].Rows[i][3].ToString(); } } } } return(goods); }