public MidRing(enumProductType type, Action <Form, enumProductType, bool> afterSave) { this.typeName = type; this.handlerAfterSave = afterSave; InitializeComponent(); }
/// <summary> /// 获取当前所有接口 /// </summary> /// <returns></returns> public DataTable GetDropDownListInfo(enumProductType type) { DataTable dt = new DataTable(); DataColumn dc = new DataColumn("Idx"); dt.Columns.Add(dc); dc = new DataColumn("Name"); dt.Columns.Add(dc); List <ValueType> list = this.GetAllDevices(type); foreach (ValueType item in list) { iGetIDName tmpIDName = (iGetIDName)item; if (!tmpIDName.IsShowInList) { continue; } DataRow dr = dt.NewRow(); dr["Idx"] = tmpIDName.Idx; dr["Name"] = tmpIDName.Name; dt.Rows.Add(dr); } return(dt); }
// SDK初期処理 // アプリケーション起動中のSDK初期化処理は一度だけに制御する必要があります。 private bool SDK_Initialize(enumProductType ProductType) { if (this.bInitialized == false) { this.bInitialized = YayoiHanbaiSdk.Initialize(Convert.ToInt32(ProductType)); } return(bInitialized); }
// コンボボックスの値とSDK初期化に使用する値の変換 private enumProductType GetProductType() { enumProductType Type = default(enumProductType); switch (this.ProductType.SelectedIndex) { case 0: Type = enumProductType.HANBAI_AUTO; break; case 1: Type = enumProductType.HANBAI_06; break; case 2: Type = enumProductType.HANBAI_07; break; case 3: Type = enumProductType.HANBAI_08; break; case 4: Type = enumProductType.HANBAI_09; break; case 5: Type = enumProductType.HANBAI_10; break; case 6: Type = enumProductType.HANBAI_11; break; case 7: Type = enumProductType.HANBAI_12; break; case 8: Type = enumProductType.HANBAI_13; break; case 9: Type = enumProductType.HANBAI_14; break; case 10: Type = enumProductType.HANBAI_15; break; case 11: Type = enumProductType.HANBAI_16; break; } return(Type); }
// 作成するアプリケーションに合わせて変更してください。 private bool InitSDK(enumProductType ProductType) { if (SDK_Initialize(ProductType) == true) { this.ProductType.Enabled = false; return(true); } MessageBox.Show("SDKの初期化失敗しました。"); return(false); }
private void HanderAfterAddItem(Form window, enumProductType type, bool isSuccess) { if (isSuccess) { MessageBox.Show(this.GetConstantsString(ADD_SUCCESS)); window.Close(); } else { MessageBox.Show(this.GetConstantsString(ADD_FAIL)); } if (type == enumProductType.Interface) { this.InitialCamInter(); } }
// データベースを開く private bool OpenDataBase(enumProductType ProductType, string DatabaseName, string LoginUserName, string LoginPassword, int VenderId, object CallBack) { // データベースを使用する前にSDKを初期化します if (InitSDK(ProductType) == true) { // データベースを既に開いている状態の時に、さらに別のデータベースを開くことはできません if (this.bOpened == false) { // SQLサーバー名の設定 YayoiHanbaiSdk.SetServerName(this.ServerName.Text); // SQLサーバーへのログインユーザー設定 YayoiHanbaiSdk.SetSysUserName(this.SysUserName.Text); // SQLサーバーへのログインユーザーパスワード設定 YayoiHanbaiSdk.SetSysPassword(this.SysPassword.Text); // データベース名の設定 YayoiHanbaiSdk.SetDataName(DatabaseName); // データログインユーザー名の設定 YayoiHanbaiSdk.SetLoginUserName(LoginUserName); // データログインユーザーパスワードの設定 YayoiHanbaiSdk.SetLoginUserPwd(LoginPassword); // VenderIDの設定 YayoiHanbaiSdk.SetVenderId(VenderId); // 弥生販売SDKからの結果を受け取るCallBackクラスの設定 YayoiHanbaiSdk.SetSdkCallBack((SdkCallback)CallBack); // データベースを開く this.bOpened = YayoiHanbaiSdk.Open(); if (this.bOpened == false) { MessageBox.Show("データベースのオープンに失敗しました。"); } return(this.bOpened); } } return(false); }
private itable GetTableHandlerByType(enumProductType itemType) { itable result = null; switch (itemType) { case enumProductType.Adapter: case enumProductType.Extend: case enumProductType.Focus: result = dbRingMedium; break; case enumProductType.Interface: result = dbConnector; break; case enumProductType.CamLens: result = dbCamlens; break; default: break; } return(result); }
public static string GetNameByType(enumProductType type) { string strTypeName = string.Empty; switch (type) { case enumProductType.Focus: strTypeName = FOCUS; break; case enumProductType.Adapter: strTypeName = ADAPTER; break; case enumProductType.Extend: strTypeName = EXTEND; break; case enumProductType.Interface: strTypeName = INTERFACE; break; case enumProductType.CamLens: strTypeName = CAM_LENS; break; default: break; } return(strTypeName); }
public List <ValueType> GetAllDevices(enumProductType type) { itable handler = this.GetTableHandlerByType(type); return(handler.GetAllData()); }
private string GetRingName(enumProductType type) { return(SetLanguage.GetStringByFormKey(typeof(MidRing), type.ToString())); }