private void Window_SizeChanged(object sender, SizeChangedEventArgs e) { SysParms.SizeChangeFunction(MainGrid, 1024, 768); }
/// <summary> /// 查取系统参数 /// </summary> /// <returns></returns> public static SysParms SelectParams() { IDbCommand command = OCRDbContext.Runner.CreateDbCommand(Config.ConnectionString, "OCR.pkg_ocr.p_select_params", CommandType.StoredProcedure); using (DataSet ds = OCRDbContext.Runner.ExecuteDataSet(Config.ConnectionString, command)) { if (ds.Tables[0].Rows.Count > 0) { SysParms parms = new SysParms(); foreach (DataRow dr in ds.Tables[0].Rows) { switch (dr["paramname"].ToString()) { case "CONFIDENCELEVEL": parms.CONFIDENCELEVEL = dr["paramvalue"].ToString(); break; case "CONTAINERINFOKEEPTIME": parms.CONTAINERINFOKEEPTIME = dr["paramvalue"].ToString(); break; case "CTOSIP": parms.CTOSIP = dr["paramvalue"].ToString(); break; case "DEVICEIP": parms.DEVICEIP = dr["paramvalue"].ToString(); break; case "DEVICEPORT": parms.DEVICEPORT = dr["paramvalue"].ToString(); break; case "DISPORT": parms.DISPORT = dr["paramvalue"].ToString(); break; case "LOADPORT": parms.LOADPORT = dr["paramvalue"].ToString(); break; case "ONBORADSWITCH": parms.ONBORADSWITCH = dr["paramvalue"].ToString(); break; case "PASSWORD": parms.PASSWORD = dr["paramvalue"].ToString(); break; case "TICKETID": parms.TICKETID = dr["paramvalue"].ToString(); break; case "USERNAME": parms.USERNAME = dr["paramvalue"].ToString(); break; } } return(parms); } } return(null); }