protected void ButtonDelete_Click(object sender, EventArgs e) { string pline = comboPlineCode.SelectedItem.Value.ToString(); if (ASPxGridView1.Selection.Count == 0) { //ASPxCallbackPanel5.JSProperties.Add("cpCallbackName", "Fail"); //ASPxCallbackPanel5.JSProperties.Add("cpCallbackRet", "请选择计划!"); //return; } string detectCode;; for (int count = 0; count < ASPxGridView1.Selection.Count; count++) { detectCode = ASPxGridView1.GetSelectedFieldValues("DETECT_CODE")[count].ToString(); string delSql = "delete from REL_STATION_DETECT_TEMP where detect_code='" + detectCode + "'"; dc.ExeSql(delSql); } setCondition(); string sql1 = "SELECT A.RMES_ID,A.DETECT_CODE,A.DETECT_NAME FROM CODE_DETECT A WHERE A.PLINE_CODE='" + pline + "' AND A.DETECT_CODE NOT IN (SELECT DETECT_CODE FROM REL_STATION_DETECT_TEMP C WHERE C.PLINE_CODE='" + pline + "' )" + " AND A.DETECT_CODE NOT IN(SELECT C.DETECT_CODE FROM REL_STATION_DETECT C WHERE C.DETECT_CODE='" + pline + "' ) " + " ORDER BY A.DETECT_CODE"; DataTable dt = dc.GetTable(sql1); ASPxListBox1.DataSource = dt; ASPxListBox1.DataBind(); }
protected void ASPxListBoxUnused_Callback(object sender, CallbackEventArgsBase e) { string sql = "select oldghtm||'--'||newghtm sn from atpu_ghtm_oldnew where ifth='N'"; DataTable dt = dc.GetTable(sql); ASPxListBox1.DataSource = dt; ASPxListBox1.DataBind(); }
private void SetCondition() { string sql = "select oldghtm||'--'||newghtm sn from atpu_ghtm_oldnew where ifth='N'"; DataTable dt = dc.GetTable(sql); ASPxListBox1.DataSource = dt; ASPxListBox1.DataBind(); }
protected void ButtonAdd_Click(object sender, EventArgs e) { int count = 0; string pline, station, pSeries, detectCode; pline = comboPlineCode.SelectedItem.Value.ToString(); station = comboStationCode.SelectedItem.Value.ToString(); pSeries = comboPSeries.SelectedItem.Text.ToString(); for (count = 0; count < ASPxListBox1.SelectedItems.Count; count++) { detectCode = ASPxListBox1.SelectedItems[count].ToString(); string[] sArray = detectCode.Split(';'); string detectName = ""; string detectType = ""; string detectStandard = ""; string detectMax = ""; string detectMin = ""; string detectUnit = ""; string chSql = "select detect_name,detect_type,detect_standard,detect_max,detect_min,detect_unit from code_detect where pline_code='" + pline + "' and detect_code='" + sArray[0] + "'"; dataConn chDc = new dataConn(chSql); DataTable chDt = chDc.GetTable(); if (chDt.Rows.Count > 0) { detectName = chDt.Rows[0]["detect_name"].ToString(); detectType = chDt.Rows[0]["detect_type"].ToString(); detectStandard = chDt.Rows[0]["detect_standard"].ToString(); detectMax = chDt.Rows[0]["detect_max"].ToString(); detectMin = chDt.Rows[0]["detect_min"].ToString(); detectUnit = chDt.Rows[0]["detect_unit"].ToString(); } string sql = "insert into REL_STATION_DETECT_TEMP(rmes_id,company_code,pline_code,station_code,product_series,detect_code,detect_name,detect_type,detect_standard," + "detect_max,detect_min,detect_unit)" + "values(SEQ_RMES_ID.NEXTVAL,'" + theCompanyCode + "','" + pline + "','" + station + "','" + pSeries + "','" + sArray[0] + "','" + detectName + "'," + "'" + detectType + "','" + detectStandard + "','" + detectMax + "','" + detectMin + "','" + detectUnit + "')"; dc.ExeSql(sql); } setCondition(); string sql1 = "SELECT A.RMES_ID,A.DETECT_CODE,A.DETECT_NAME FROM CODE_DETECT A WHERE A.PLINE_CODE='" + pline + "' AND A.DETECT_CODE NOT IN (SELECT DETECT_CODE FROM REL_STATION_DETECT_TEMP C WHERE C.PLINE_CODE='" + pline + "' )" + " AND A.DETECT_CODE NOT IN(SELECT C.DETECT_CODE FROM REL_STATION_DETECT C WHERE C.DETECT_CODE='" + pline + "' ) " + " ORDER BY A.DETECT_CODE"; DataTable dt = dc.GetTable(sql1); ASPxListBox1.DataSource = dt; ASPxListBox1.DataBind(); //Response.Write("<script type='text/javascript'>alert('选择成功!');window.opener.location.reload();location.href='qms2301.aspx';</script>"); //comboPlineCode.Text = ""; //comboStationCode.Text = ""; //comboPSeries.Text = ""; //ASPxListBox1.Items.Clear(); }
protected void initDetect(string plineCode) { string sql = "SELECT A.RMES_ID,A.DETECT_CODE,A.DETECT_NAME FROM CODE_DETECT A WHERE A.PLINE_CODE='" + plineCode + "' AND A.DETECT_CODE NOT IN(SELECT C.DETECT_CODE FROM REL_STATION_DETECT C WHERE C.DETECT_CODE='" + plineCode + "' ) ORDER BY A.DETECT_CODE";// DataTable dt = dc.GetTable(sql); ASPxListBox1.DataSource = dt; ASPxListBox1.DataBind(); }
//绑定专业 private void bind() { string zyID = Request.QueryString["zyID"].Trim(); string oracletext = "select * from CS_BASEINFOSET where INFOID= " + zyID; ASPxComboBox1.DataSource = OracleHelper.Query(oracletext); ASPxComboBox1.DataBind(); ASPxComboBox1.Value = zyID; ASPxComboBox1.Enabled = false; oracletext = "select * FROM WORKTASKS_TEMP where STATUS='保存' and PROFESSIONALID = " + ASPxComboBox1.SelectedItem.Value.ToString().Trim() + " "; ASPxListBox1.DataSource = OracleHelper.Query(oracletext); ASPxListBox1.DataBind(); ASPxGridView2.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); string hostIPAddress = Page.Request.UserHostAddress; //IPHostEntry hostInfo = System.Net.Dns.GetHostByAddress(hostIPAddress); GV_MachineName = hostIPAddress; //GV_MachineName = System.Net.Dns.GetHostName(); theProgramCode = "epd3400"; theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); string sql = "select a.pline_code,b.rmes_id,b.pline_name from VW_USER_ROLE_PROGRAM a " + "left join code_product_line b on a.pline_code=b.pline_code " + "where a.COMPANY_CODE = '" + theCompanyCode + "' and a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' order by b.PLINE_NAME"; comboPlineCode.DataSource = dc.GetTable(sql); comboPlineCode.DataBind(); SetCondition(); if (!IsPostBack) { comboPlineCode.SelectedIndex = 0; string sql23 = "select RMES_ID,STATION_NAME from CODE_STATION where PLINE_CODE='" + comboPlineCode.Value.ToString() + "' order by STATION_NAME"; DataTable dt = dc.GetTable(sql23); comboStationCode.DataSource = dt; comboStationCode.ValueField = "RMES_ID"; comboStationCode.TextField = "STATION_NAME"; comboStationCode.DataBind(); sql = "select A.RMES_ID, A.LOCATION_CODE, A.LOCATION_CODE LOCATION_NAME from code_location a where pline_code = '" + comboPlineCode.Value.ToString() + "' and not exists(select * from vw_rel_station_location b where b.pline_id = '" + comboPlineCode.Value.ToString() + "' " + " and b.location_flag = 'A' and a.location_code=b.location_code and a.pline_code=b.pline_id ) ORDER BY A.LOCATION_CODE "; DataTable dt1 = dc.GetTable(sql); ASPxListBox1.DataSource = dt1; ASPxListBox1.DataBind(); string sqlD = "DELETE from REL_STATION_LOCATION_TEMP"; dc.ExeSql(sqlD); } }
protected void Page_Load(object sender, EventArgs e) { userManager theUserManager = (userManager)Session["theUserManager"]; theCompanyCode = theUserManager.getCompanyCode(); theProgramCode = "epd3400"; theUserId = theUserManager.getUserId(); theUserCode = theUserManager.getUserCode(); string sql = "select a.pline_code,b.rmes_id,b.pline_name from VW_USER_ROLE_PROGRAM a " + "left join code_product_line b on a.pline_code=b.pline_code " + "where a.COMPANY_CODE = '" + theCompanyCode + "' and a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' order by b.PLINE_NAME"; comboPlineCode.DataSource = dc.GetTable(sql); comboPlineCode.DataBind(); //string sql1 = "select INTERNAL_CODE,INTERNAL_NAME from CODE_INTERNAL where COMPANY_CODE='" + theCompanyCode + "' AND INTERNAL_TYPE_CODE='001' order by INTERNAL_CODE desc"; //locationPro.DataSource = dc.GetTable(sql1); //locationPro.DataBind(); if (!IsPostBack) { comboPlineCode.SelectedIndex = 0; string sql23 = "select RMES_ID,STATION_NAME from CODE_STATION where PLINE_CODE='" + comboPlineCode.Value.ToString() + "' order by STATION_NAME"; DataTable dt = dc.GetTable(sql23); comboStationCode.DataSource = dt; comboStationCode.ValueField = "RMES_ID"; comboStationCode.TextField = "STATION_NAME"; comboStationCode.DataBind(); string sql2 = "SELECT A.RMES_ID,A.LOCATION_CODE,A.LOCATION_CODE LOCATION_NAME FROM CODE_LOCATION A WHERE location_code not in (select location_code from vw_rel_station_location ) ORDER BY A.LOCATION_CODE"; DataTable dt2 = dc.GetTable(sql2); ASPxListBox1.DataSource = dt2; ASPxListBox1.ValueField = "RMES_ID"; ASPxListBox1.TextField = "LOCATION_NAME"; ASPxListBox1.DataBind(); //sql = "SELECT A.RMES_ID,A.LOCATION_CODE,A.LOCATION_CODE LOCATION_NAME FROM CODE_LOCATION A WHERE location_code not in (select location_code from vw_rel_station_location where pline_id='" + comboPlineCode.Value.ToString() + "' and location_flag='A' ) and pline_code='" + comboPlineCode.Value.ToString() + "' ORDER BY A.LOCATION_CODE"; sql = "select A.RMES_ID, A.LOCATION_CODE, A.LOCATION_CODE LOCATION_NAME from code_location a where pline_code = '" + comboPlineCode.Value.ToString() + "' and not exists(select * from vw_rel_station_location b where b.pline_id = '" + comboPlineCode.Value.ToString() + "' " + " and b.location_flag = 'A' and a.location_code=b.location_code and a.pline_code=b.pline_id ) ORDER BY A.LOCATION_CODE"; dt = dc.GetTable(sql); ASPxListBox1.DataSource = dt; ASPxListBox1.DataBind(); } }
protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string oracletext = ""; if (e.Parameter.Trim() == "i") { string msg = ""; if (ASPxTextBox1.Text.Trim() == "") { ASPxLabel2.Text = "请填写工作任务内容!"; return; } oracletext = "select * FROM WORKTASKS_TEMP where STATUS='保存' and WORKTASK='" + ASPxTextBox1.Text.Trim() + "' and PROFESSIONALID = " + ASPxComboBox1.SelectedItem.Value.ToString().Trim() + " "; if (OracleHelper.Query(oracletext).Tables[0].Rows.Count > 0) { msg = "已经添加的工作任务"; } else { oracletext = "select * FROM WORKTASKS where WORKTASK='" + ASPxTextBox1.Text.Trim() + "' and PROFESSIONALID = " + ASPxComboBox1.SelectedItem.Value.ToString().Trim() + " "; if (OracleHelper.Query(oracletext).Tables[0].Rows.Count > 0) { msg = "标准库已经存在的工作任务"; } else { GhtnTech.SEP.OraclDAL.DALWORKTASKS_TEMP wt = new GhtnTech.SEP.OraclDAL.DALWORKTASKS_TEMP(); try { wt.InsertDALWORKTASKS_TEMP(ASPxTextBox1.Text.Trim(), int.Parse(ASPxComboBox1.SelectedItem.Value.ToString().Trim()), deptnumber, usernumber); msg = "保存成功!"; } catch { msg = "保存失败,请稍候重试!"; } } } ASPxLabel2.Text = msg; } oracletext = "select * FROM WORKTASKS_TEMP where STATUS='保存' and PROFESSIONALID = " + ASPxComboBox1.SelectedItem.Value.ToString().Trim() + " "; ASPxListBox1.DataSource = OracleHelper.Query(oracletext); ASPxListBox1.DataBind(); ASPxGridView2.Visible = true; }
protected void ASPxButton1_Click(object sender, EventArgs e) { int numPlayers = 20; int nbrOfTeams = 20 / 2; int rounds = 3; List <Player> players = new List <Player>(); for (int i = 1; i <= numPlayers; i++) { Player player = new Player { Name = "Person " + i.ToString() }; players.Add(player); } Tournament tournament = new Tournament(rounds); ExtensionMethods.Shuffle(players); for (int i = 0; i < rounds; i++) { TournamentRound round = new TournamentRound("Round : " + (i + 1).ToString()); List <Team> teams = TeamGenerator.GenerateTeams(players, nbrOfTeams); round.Teams = teams; round.Matches = MatchGenerator.GenerateMatches(teams, teams.Count / 2); tournament.Rounds.Add(round); } ASPxListBox1.DataSource = tournament.Rounds[0].Matches; ASPxListBox1.TextField = "Name"; ASPxListBox1.DataBind(); ASPxListBox2.DataSource = tournament.Rounds[1].Matches; ASPxListBox2.TextField = "Name"; ASPxListBox2.DataBind(); ASPxListBox3.DataSource = tournament.Rounds[2].Matches; ASPxListBox3.TextField = "Name"; ASPxListBox3.DataBind(); }
protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string key = e.Parameter.Trim(); Session["zyID"] = key; TreeListNode node = treeList.FindNodeByKeyValue(key); if (node.ChildNodes.Count > 0) { return; } //if (node.HasChildren) //{ // return; //} int gzrwID = int.Parse(key); string oracletext = "select * FROM WORKTASKS where PROFESSIONALID = " + key + " "; ASPxListBox1.DataSource = OracleHelper.Query(oracletext); ASPxListBox1.DataBind(); ASPxGridView2.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { //Random json string, No fix number of columns or rows and no fix column name. //string myDynamicJSON = "[{'Member ID':'00012','First Name':'Vicki','Last Name':'Jordan','Registered Email':'vicki.j @tacinc.com.au','Mobile':'03 6332 3800','MailSuburb':'','MailState':'','MailPostcode':'','Engagement':'attended an APNA event in the past and ventured onto our online education portal APNA Online Learning','Group':'Non-member'},{'Member ID':'15072','First Name':'Vicki','Last Name':'Jordan','Registered Email':'vicki.j @tacinc.com.au','Mobile':'03 6332 3800','MailSuburb':'','MailState':'','MailPostcode':'','Engagement':'attended an APNA event in the past and ventured onto our online education portal APNA Online Learning','Group':'Non-member'}]"; //string myJSON = "[{ 'action': 'Pick', 'Cart': '5', 'Part': 'sku1', 'Location': '01A1', 'batchpos':'batchpos'}]"; //string myJSON = { "action": "Pick", "Cart": "5", "Part": "sku1", "Location": "01A1", "batchpos":[{"tuff": "ONE", "taco":"TWO", "bandana":"THREE"}]}; ////Using dynamic keyword with JsonConvert.DeserializeObject, here you need to import Newtonsoft.Json //dynamic myObject = JsonConvert.DeserializeObject(myJSON); ////Binding gridview from dynamic object //GridView1.DataSource = myObject; //GridView1.DataBind(); ////Using DataTable with JsonConvert.DeserializeObject, here you need to import using System.Data; //DataTable myObjectDT = JsonConvert.DeserializeObject<DataTable>(myJSON); ////Binding gridview from dynamic object //GridView1.DataSource = myObjectDT; //GridView1.DataBind(); Batch batch = new Batch { // below is hand entered data to populate object batch Action = "Pick", Cart = "5", Part = "sku1", Location = "01A1", BatchPos = new List <BatchPositions> { new BatchPositions { Pos = "1", Order = "ord1", ActualQty = 1, RequestQty = 1, TC = true, Color = 1, BlinkSpeed = 0 }, new BatchPositions { Pos = "2", Order = "ord2", ActualQty = 1, RequestQty = 2, TC = true, Color = 1, BlinkSpeed = 0 }, new BatchPositions { Pos = "3", Order = "ord3", ActualQty = 1, RequestQty = 3, TC = true, Color = 1, BlinkSpeed = 0 }, new BatchPositions { Pos = "4", Order = "ord4", ActualQty = 1, RequestQty = 4, TC = true, Color = 1, BlinkSpeed = 0 }, new BatchPositions { Pos = "5", Order = "ord5", ActualQty = 1, RequestQty = 5, TC = false, Color = 1, BlinkSpeed = 0 } } }; string json = JsonConvert.SerializeObject(batch, Formatting.Indented); // convert batch object into a string Console.WriteLine(json); // display the string Batch b1 = JsonConvert.DeserializeObject <Batch>(json); // take the just created string and populate object b1 //Using dynamic keyword with JsonConvert.DeserializeObject, here you need to import Newtonsoft.Json dynamic myObject = JsonConvert.DeserializeObject(json); //Binding gridview from dynamic object toteListView.DataSource = myObject; toteListView.DataBind(); //Using DataTable with JsonConvert.DeserializeObject, here you need to import using System.Data; // DataTable myObjectDT = JsonConvert.DeserializeObject<DataTable>(json); //Binding gridview from dynamic object ASPxListBox1.DataSource = myObject; ASPxListBox1.DataBind(); // display the various fields of the object Console.WriteLine("action : " + b1.Action); Console.Write(" Cart : " + b1.Cart); Console.Write(" Part : " + b1.Part); Console.WriteLine(" Locn : " + b1.Location); foreach (BatchPositions bp1 in b1.BatchPos) { // loop through the array batchpos Console.Write("pos : " + bp1.Pos); Console.Write(" order : " + bp1.Order); Console.Write(" request qty : " + bp1.RequestQty); Console.Write(" actual qty : " + bp1.ActualQty); Console.Write(" TC : " + bp1.TC); Console.Write(" Color : " + bp1.Color); Console.WriteLine(" BlinkSpeed : " + bp1.BlinkSpeed); } }
protected void ASPxCallbackPanel5_Callback(object sender, CallbackEventArgsBase e) { string[] s = e.Parameter.Split(','); string flag = s[0]; string value = s[1]; switch (flag) { case "ADD": if (string.IsNullOrEmpty(value)) { return; } string value3 = s[2]; if (value3.EndsWith("|")) { value3 = value3.Substring(0, value3.Length - 1); } string[] _ids = value3.Split('|'); DataTable dt1 = new DataTable(); DataColumn dc1 = new DataColumn("ID1"); dt1.Columns.Add(dc1); for (int i = 0; i < _ids.Length; i++) { if (_ids[i] != "") { dt1.Rows.Add(_ids[i]); } } string sql12 = "select count(1) from data_plan where plan_code ='" + value + "' and (plan_type='C' or plan_type='D') "; dc.setTheSql(sql12); if (dc.GetValue() == "0") { //提示重复 ASPxListBox1.DataSource = dt1; ASPxListBox1.DataBind(); ASPxCallbackPanel5.JSProperties.Add("cpCallbackName", "Fail"); ASPxCallbackPanel5.JSProperties.Add("cpCallbackRet", "计划号非法!"); break; } string sql = "select plan_code,plan_so,plan_qty,pline_code,item_flag from data_plan where plan_code='" + value.ToUpper() + "' and (plan_type='C' or plan_type='D') "; dc.setTheSql(sql); DataTable dt = dc.GetTable(); string plancode1 = dt.Rows[0][0].ToString(); string planso1 = dt.Rows[0][1].ToString(); string planqty1 = dt.Rows[0][2].ToString(); string plinecode1 = dt.Rows[0][3].ToString(); string itemflag1 = dt.Rows[0][4].ToString(); if (itemflag1 != "N") { ASPxListBox1.DataSource = dt1; ASPxListBox1.DataBind(); ASPxCallbackPanel5.JSProperties.Add("cpCallbackName", "Fail"); ASPxCallbackPanel5.JSProperties.Add("cpCallbackRet", "计划已库房接收或确认!"); break; } string txt1 = plancode1 + "; " + planso1 + "; " + planqty1 + "; " + plinecode1; for (int i = 0; i < _ids.Length; i++) { if (txt1 == _ids[i]) { ASPxListBox1.DataSource = dt1; ASPxListBox1.DataBind(); return; } } //dt1.Columns.Add("ID1",typeof(string)); //DataRow dd = dt1.NewRow(); //dd["ID1"] = txt1; dt1.Rows.Add(txt1); ASPxListBox1.DataSource = dt1; ASPxListBox1.DataBind(); //ASPxListBox1.Items.Add(txt1,dd); break; default: ASPxCallbackPanel5.JSProperties.Clear(); break; } }
void BindListBox() { ASPxListBox1.DataSource = DashboardConfigurator.Default.DashboardStorage.GetAvailableDashboardsInfo(); ASPxListBox1.DataBind(); }