private OutStockClass SetPara() { #region OutStockClass OSClass = new OutStockClass(); try { OSClass.Fno1 = txtFNo.Text.Trim(); //OSClass.DId2 = equipmentLogic.SearchDID2(txtFNo.Text.Trim()); OSClass.CspbId = int.Parse(txtDrawNo.Text.Trim()); OSClass.StoreKeeper = cbxStoreKeeper.Text.Trim(); OSClass.OutStockDate = dtpTDate.Value; OSClass.InputDate1 = DateTime.Now; OSClass.InputMan1 = this.UserName; OSClass.TDate = dtpTDate.Value; OSClass.TID = int.Parse(cbxOutNo.SelectedValue.ToString().Trim()); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { } return(OSClass); #endregion }
private void SaveAll() { try { List <OutStockBillDetailClass> list = GetTPDetail(); OutStockClass OSClass = SetPara(); id = Convert.ToInt32(equipmentLogic.SaveTOutStockBill(OSClass, list, int.Parse(cbxOutNo.SelectedValue.ToString().Trim()))); if (id != 0) { txtTId.Text = id.ToString(); equipmentLogic.SumOutStockAllDetail(id); // this.DialogResult = DialogResult.OK; MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //this.Close(); } else { MessageBox.Show("保存失败,请重新操作!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { } }
/* * 方法名称:SaveOutStockBill * 方法功能描述:同时将出库单主表和明细表保存到数据库中的方法 插入到两个表中 * * 创建人:夏阳明 * 创建时间:20090325 * * 修改人: * 修改时间: * 修改内容: * */ public int SaveOutStockBill(OutStockClass OSClass, List <OutStockBillDetailClass> list, int id) { int id1; ArrayList sqllist = new ArrayList(); sqllist.Add(equipmentDb.GetOSInsertSqlps(OSClass, id)); foreach (OutStockBillDetailClass OSBDClass in list) { sqllist.Add(equipmentDb.GetOSBDInsertSqlpsd(OSBDClass)); } ds = sqlHelperObj.QueryForDateSet(sqllist); id1 = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); return(id1); }