/*private void change_Click(object sender, EventArgs e) * { * //Form2 f2 = new Form2();//子窗体 * //f2.MdiParent = this; * //f2.Show(); * outtextbox_ImageNumber.ReadOnly = false; * outtextbox_PartsName.ReadOnly = false; * outtextbox_CompanyName.ReadOnly = false; * outtextbox_CompanyNumber.ReadOnly = false; * outtextbox_ProductName.ReadOnly = false; * outtextbox_ProductType.ReadOnly = false; * } * private void ok_Click(object sender, EventArgs e) * { * Images img = new Images(); * img.ImageNumber = outtextbox_ImageNumber.Text; * img.PartsName = outtextbox_PartsName.Text; * string strCompanyName = outtextbox_CompanyName.Text; * string strCompanyNumber = outtextbox_CompanyNumber.Text; * string strProductName = outtextbox_ProductName.Text; * string strProductType = outtextbox_ProductType.Text; * * //... ... * }*/ private void ok_Click(object sender, EventArgs e) { Images image = new Images(); Connect1 c1 = new Connect1(); Connect2 c2 = new Connect2(); Connect3 c3 = new Connect3(); ImageManager iManager = new ImageManager(); Connect1Manager c1Manager = new Connect1Manager(); Connect2Manager c2Manager = new Connect2Manager(); Connect3Manager c3Manager = new Connect3Manager(); image.ImageNumber = outtextbox_ImageNumber.Text.Trim(); image.PartsName = outtextbox_PartsName.Text; c1.ImageNumber = image.ImageNumber; c1.ProductType = outtextbox_ProductType.Text; c2.ImageNumber = image.ImageNumber; c2.CompanyNumber = outtextbox_CompanyNumber.Text; c3.ImageNumber = image.ImageNumber; iManager.DeleteImage(image); c1Manager.DeleteConnect1(c1); c2Manager.DeleteConnect2(c2); c3Manager.DeleteConnect3(c3); }
public string RemoveConnect11(Connect1 connect1) //删除表中某行 { try { SqlConnection conn = new SqlConnection(DbUtil.ConnString); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = DbUtil.connect1DataBasesql6; cmd.CommandType = CommandType.Text; cmd.Parameters.Add(new SqlParameter("@productType", connect1.ProductType)); conn.Open(); //打开数据链接 SqlDataReader reader = cmd.ExecuteReader(); conn.Close(); } catch (Exception ee) { exception = ee.ToString(); //Console.WriteLine(ee.ToString()); } //Console.WriteLine(image.ToString()); return(exception); }
public List <Connect1> SearchConnect(Connect1 c1) { List <Connect1> tempList = null; if (c1 != null) { tempList = c1DAO.SelectConnect1(c1); } return(tempList); }
public List <Connect1> GetConnect1(Images img, List <Product> tempList) //部门选择判断 { List <Connect1> c1List = new List <Connect1>(); for (int i = 0; i < tempList.Count; i++) { Connect1 c1 = new Connect1(); c1.ProductType = tempList[i].ProductType; c1.ImageNumber = img.ImageNumber; c1List.Add(c1); } return(c1List); }
public List <Connect1> SearchConnect1(Connect1 c1, string judge) { List <Connect1> tempList = null; if (judge == "imageNumber") { tempList = c1DAO.SelectConnect111(c1.ImageNumber); } else { tempList = c1DAO.SelectConnect11(c1.ProductType); } return(tempList); }
public bool AlterConnect1(Connect1 c1) { bool flag = false; if (c1DAO.SelectConnect1(c1) != null) { c1DAO.UpdateConnect1(c1); flag = true; } else { flag = false; } return(flag); }
public bool DeleteConnect1(Connect1 c1) { bool flag = false; if (iDAO.SelectImage(c1.ImageNumber) != null) { c1DAO.RemoveConnect1(c1); flag = true; } /*else if (pDAO.SelectProduct(c1.ProductType) == null) * { * c1DAO.RemoveConnect11(c1); * flag = true; * }*/ else { flag = false; } return(flag); }
public List <Connect1> SelectConnect111(string imageNumber) //查 { Connect1 temp = null; List <Connect1> connect1List = null; try { SqlConnection conn = new SqlConnection(DbUtil.ConnString); SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = DbUtil.connect1DataBasesql7; cmd.CommandType = CommandType.Text; cmd.Parameters.Add(new SqlParameter("@imageNumber", imageNumber)); conn.Open(); //打开数据链接 SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) //开始读取数据 { temp.ProductType = reader.GetString(reader.GetOrdinal("productType")); temp.ImageNumber = reader.GetString(reader.GetOrdinal("imageNumber")); connect1List.Add(temp); } conn.Close(); } catch (Exception ee) { exception = ee.ToString(); //Console.WriteLine(ee.ToString()); } //Console.WriteLine(image.ToString()); return(connect1List); }