////存储到货位置 //private void insertArrivalLocation(OleDbCommand comm,string ArrivalID) //{ // comm.Parameters.Clear(); // DataTable DT = (DataTable)ViewState["LocationTB"]; // comm.CommandType = CommandType.StoredProcedure; // comm.CommandText = "gen_package_arrival_api.insert_package_arrival_l_"; // for (int i = 0; i < DT.Rows.Count; i++) // { // comm.Parameters.Clear(); // comm.Parameters.Add("v_arrived_id", OleDbType.VarChar, 20).Value = ArrivalID; // comm.Parameters.Add("v_location_id", OleDbType.VarChar, 20).Value = DT.Rows[i]["location_id"].ToString(); // comm.Parameters.Add("v_reg_qty", OleDbType.Numeric).Value = decimal.Parse(DT.Rows[i]["location_amount"].ToString()); // try // { // comm.ExecuteNonQuery(); // } // catch (Exception ex) // { // throw ex; // } // } //} //private void insert_ArrivalData() //{ // OleDbConnection conn = new OleDbConnection(DBHelper.OleConnectionString); // OleDbCommand comm = new OleDbCommand(); // comm.Connection = conn; // if (conn.State == ConnectionState.Closed) conn.Open(); // OleDbTransaction otran = conn.BeginTransaction(); // comm.Transaction = otran; // string partNo = TxtXJbh.Value; // if (partNo=="")//判断为输入小件信息,添加小件信息到数据库 // { // partNo = InputXJInfo(comm); // } // comm.Parameters.Clear(); // comm.CommandType = CommandType.StoredProcedure; // comm.CommandText = "gen_package_arrival_api.insert_package_arrival_"; // comm.Parameters.Add("v_arrived_id", OleDbType.VarChar, 20).Direction = ParameterDirection.Output; // comm.Parameters.Add("v_package_no", OleDbType.VarChar, 20).Value = TxtDBbh.Value; // comm.Parameters.Add("v_part_no", OleDbType.VarChar, 20).Value = partNo; // comm.Parameters.Add("v_req_qty", OleDbType.Numeric).Value = Convert.ToDecimal(LblTotal.Text); // comm.Parameters.Add("v_arrived_date", OleDbType.Date).Value = Convert.ToDateTime(TxtDHrq.Text); // comm.Parameters.Add("v_rowversion", OleDbType.VarChar, 20).Value = DateTime.Now.ToString("yyyyMMddHHmmss"); // try // { // comm.ExecuteNonQuery(); // string arrivedId = comm.Parameters["v_arrived_id"].Value.ToString(); // insertArrivalLocation(comm,arrivedId); // otran.Commit(); // Misc.Message(this.GetType(),ClientScript,"数据提交成功!"); // } // catch (Exception ex) // { // otran.Rollback(); // throw new Exception(ex.Message); // } // finally // { // conn.Close(); // conn.Dispose(); // comm.Dispose(); // } //} ////当小心信息为输入时,先数据库中添加小件信息 //private string InputXJInfo(OleDbCommand comm) //{ // comm.CommandType = CommandType.StoredProcedure; // comm.CommandText = "gen_part_package_item_api.insert__"; // comm.Parameters.Add("v_Package_no", OleDbType.VarChar, 20).Value = TxtDBbh.Value; // comm.Parameters.Add("v_Part_name", OleDbType.VarChar, 500).Value = TxtXJmccn.Text; // comm.Parameters.Add("v_Part_name_e", OleDbType.VarChar, 500).Value = TxtXJmcen.Text; // comm.Parameters.Add("v_Part_spec", OleDbType.VarChar, 100).Value = TxtXJgg.Text; // comm.Parameters.Add("v_unit", OleDbType.VarChar, 20).Value = DdlPartUnit.SelectedValue; // comm.Parameters.Add("v_Dec_no", OleDbType.VarChar, 100).Value = TxtXJgdh.Text; // comm.Parameters.Add("v_Contract_no", OleDbType.VarChar, 100).Value = TxtXJhth.Text; // comm.Parameters.Add("v_part_no", OleDbType.VarChar, 100); // comm.Parameters["v_part_no"].Direction = ParameterDirection.Output; // try // { // comm.ExecuteNonQuery(); // return comm.Parameters["v_part_no"].Value.ToString(); // } // catch (Exception ex) // { // throw ex ; // } //} //protected void BtnSubmit_Click(object sender, EventArgs e) //{ // insert_ArrivalData(); // DataTable DT = (DataTable)ViewState["LocationTB"]; // DT.Rows.Clear(); // OKGrid.DataSource = DT; // OKGrid.DataBind(); // ViewState["dhsl"] = 0; // //TxtDHsl.Text = ""; // TxtDBbh.Value = ""; // TxtXJbh.Value = ""; // //TxtArea.Value = ""; // //TxtLocation.Value = ""; // TxtAmount.Text = ""; // TxtXJmccn.Text = ""; // TxtXJmcen.Text = ""; // TxtXJgg.Text = ""; // DdlPartUnit.SelectedValue="0"; //} private void GVSubmitDataDataBind() { ArrayList arr_ = (ArrayList)Session[SS_ARRID]; if (arr_.Count > 0) { StringBuilder sql = new StringBuilder("select * from gen_pkg_arr_v where check_mark='init' and arrived_id in ( "); for (int i = 0; i < arr_.Count; i++) { if (i == arr_.Count - 1) { sql.Append("'" + arr_[i].ToString() + "')"); } else { sql.Append("'" + arr_[i].ToString() + "',"); } } GVSubmitData.DataSource = DBHelper.createGridView(sql.ToString()); GVSubmitData.DataKeyNames = new string[] { "arrived_id" }; GVSubmitData.DataBind(); } else { GVSubmitData.DataSource = null; GVSubmitData.DataBind(); } }
private void GVSubmitQueryDataDataBind() { StringBuilder sql = new StringBuilder("select * from gen_pkg_arr_v where check_mark='init'"); if (TxtDBbh.Value != string.Empty) { sql.Append(string.Format(" and package_no='{0}'", TxtDBbh.Value)); } if (TxtXJbh.Value != string.Empty) { sql.Append(string.Format(" and part_no='{0}'", TxtXJbh.Value)); } if (TxtXJmcen.Text != string.Empty) { sql.Append(string.Format(" and part_name_e like '{0}'", TxtXJmcen.Text)); } if (TxtXJmccn.Text != string.Empty) { sql.Append(string.Format(" and part_name like '{0}'", TxtXJmccn.Text)); } if (TxtXJgg.Text != string.Empty) { sql.Append(string.Format(" and part_spec like '{0}'", TxtXJgg.Text)); } if (TxtXJgdh.Text != string.Empty) { sql.Append(string.Format(" and dec_no like '{0}'", TxtXJgdh.Text)); } if (TxtPO.Text != string.Empty) { sql.Append(string.Format(" and po_no = '{0}'", TxtPO.Text)); } if (TxtDHrq.Text != string.Empty) { sql.Append(string.Format(" and arrived_date = to_date('{0}','yyyy-mm-dd')", TxtDHrq.Text)); } GVSubmitData.DataSource = DBHelper.createGridView(sql.ToString()); GVSubmitData.DataKeyNames = new string[] { "arrived_id" }; GVSubmitData.DataBind(); ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, this.GetType(), "myscript", "SetGVBoxHeight('gvbox','GVSubmitData');EnterAgain();", true); }
private void GVSubmitEmptyDataBind() { GVSubmitData.DataSource = null; GVSubmitData.DataBind(); }