/// <summary> /// 构造函数 /// </summary> public FormOSM_Offers_Add(string uuid = "") { InitializeComponent(); buyer = new Buyer(); seller = new Seller(); offer_sheet = new OfferSheet(); //hw = new HW(); dataGridView_HW.AutoGenerateColumns = false; string whereString = "where PID = 10"; SJZDController.setZD_ComboBox(whereString, comboBox_OFFERSHEET_REGION); whereString = "where PID = 33"; SJZDController.setZD_ComboBox(whereString, comboBox_OFFERSHEET_TYPE); string offsht_code = "U" + uuid + "OSC" + DateTime.Now.ToString("yyyyMMddHHmmss"); textBox_OFFERSHEET_CODE.Text = offsht_code; fillSellerComboBox(comboBox_SELLER); fillBuyerComboBox(comboBox_BUYER); //queryByHW(dataGridView_HW); }
/// <summary> /// 构造函数 /// </summary> public FormOSM_Seller_Add() { InitializeComponent(); seller = new Seller(); }
/// <summary> /// 实现数据库插入报价方数据 /// </summary> /// <param name="seller"></param> /// <returns></returns> private bool addSeller(Seller seller) { string sql = "insert into OSM_BJF(COM_NAME,ADDR,CONTACT,PHONE,ZIP_CODE,FAX,EMAIL,COMMENT) "; sql += " values('" + seller.getCOM_NAME() + "','" + seller.getADDR() + "','"; sql += seller.getCONTACT() + "','" + seller.getPHONE() + "','" + seller.getZIP_CODE(); sql += "','" + seller.getFAX() + "','" + seller.getEMAIL() + "','" + seller.getCOMMENT() + "')"; AccessDB adb = new AccessDB(); bool isExecuteSucc = adb.SQLExecute(sql); if (isExecuteSucc) { MessageBox.Show("添加成功!", "消息"); } else { MessageBox.Show("添加失败!", "消息"); } return isExecuteSucc; }
/// <summary> /// 输入窗口内容构造报价方对象 /// </summary> /// <param name="seller"></param> private void createSeller(Seller seller) { seller.setCOM_NAME(textBox_COM_NAME_SELLER.Text); seller.setADDR(textBox_ADDR_SELLER.Text); seller.setCONTACT(textBox_CONTACT_SELLER.Text); seller.setPHONE(textBox_PHONE_SELLER.Text); seller.setZIP_CODE(textBox_ZIPCODE_SELLER.Text); seller.setFAX(textBox_FAX_SELLER.Text); seller.setEMAIL(textBox_EMAIL_SELLER.Text); seller.setCOMMENT(textBox_COMMENT_SELLER.Text); }