/// <summary> /// 设置速查 /// </summary> /// <param name="sqlString"></param> void tc_GetDataSourced(TextChooser tc, string sqlString) { DataTable dvt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dvt); if (dvt != null) { tc.Search(); } }
/// <summary> 绑定供应商名称到选择器 /// </summary> /// <param name="tc"></param> /// <param name="sqlString"></param> private static void Sup_NameBindData(TextChooser tc, string sqlString) { DataTable dt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dt); if (dt != null) { tc.Search(); } }
void txtcSupplier_GetDataSourced(TextChooser tc, string sqlString) { try { string fileds = "sup_code,sup_full_name"; sqlString = sqlString.Replace("*", fileds); DataTable dvt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dvt); if (dvt != null) { tc.Search(); } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
/// <summary> /// 设置速查 /// </summary> /// <param name="sqlString"></param> void tc_GetDataSourced(TextChooser tc, string sqlString) { try { DataTable dvt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dvt); if (dvt != null) { tc.Search(); } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
/// <summary> /// 设置速查 /// </summary> /// <param name="sqlString"></param> void tc_GetDataSourced(TextChooser tc, string sqlString) { if (sqlString.Contains("v_vehicle")) { string fileds = string.Format(" license_plate,vin,engine_num,v_model,v_brand,v_color,turner,cust_code,cust_id,cust_name,cont_name,{0} phone ", EncryptByDB.GetDesFieldValue("cont_phone")); sqlString = sqlString.Replace("*", fileds); } DataTable dvt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dvt); if (dvt != null) { tc.Search(); } }
/// <summary> 绑定配件类型名称到选择器 /// </summary> /// <param name="tc"></param> /// <param name="sqlString"></param> private static void PartsType_NameBindData(TextChooser tc, string sqlString) { // sqlString = string.Format(@"select dic_name from sys_dictionaries where dic_id not in // (select parent_id from sys_dictionaries) and dic_name like '%{0}%'", tc.Text); // DataTable dt = CommonFuncCall.GetDataSource(sqlString); // tc.SetDataSource(dt); // if (dt != null) // { // tc.Search(); // } string dic_ids = string.Empty; List<string> list_dic_id=new List<string>(); CreateTreeViewChildNode(list_dic_id, "sys_parts_category"); if(list_dic_id.Count>0) { foreach (string dic_id in list_dic_id) { dic_ids += "'" + dic_id + "',"; } } dic_ids = dic_ids.Trim(','); sqlString = string.Format(@"select dic_name from sys_dictionaries where dic_id in ({0}) and dic_name like '%{1}%'", dic_ids, tc.Text); DataTable dt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dt); if (dt != null) { tc.Search(); } }
/// <summary> 绑定配件类型名称到选择器 /// </summary> /// <param name="tc"></param> /// <param name="sqlString"></param> private static void PartsType_NameBindData(TextChooser tc, string sqlString) { sqlString = string.Format(@"select dic_name from sys_dictionaries where dic_id not in (select parent_id from sys_dictionaries) and dic_name like '%{0}%'", tc.Text); DataTable dt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dt); if (dt != null) { tc.Search(); } }
void txtcCustName_GetDataSourced(TextChooser tc, string sqlString) { try { if (sqlString.Contains("tb_customer")) { string fileds = "cust_name,cust_code"; sqlString = sqlString.Replace("*", fileds); } else if (sqlString.Contains("tb_supplier")) { string fileds = "sup_code,sup_full_name"; sqlString = sqlString.Replace("*", fileds); } DataTable dvt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dvt); if (dvt != null) { tc.Search(); } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }
void txtcCustName_GetDataSourced(TextChooser tc, string sqlString) { try { if (sqlString.Contains("tb_customer")) { string tables = "tb_customer a left join sys_dictionaries b on a.open_bank=b.dic_id "; string fileds = "cust_id,cust_name,cust_code,bank_account,dic_name"; sqlString = sqlString.Replace("*", fileds); sqlString = sqlString.Replace("tb_customer", tables); } else if (sqlString.Contains("tb_supplier")) { string fileds = "sup_id,sup_code,sup_full_name"; sqlString = sqlString.Replace("*", fileds); } DataTable dvt = CommonFuncCall.GetDataSource(sqlString); tc.SetDataSource(dvt); if (dvt != null) { tc.Search(); } } catch (Exception ex) { HXCPcClient.GlobalStaticObj.GlobalLogService.WriteLog(ex); } }