/// <summary> /// マスタ登録データ設定処理 /// </summary> /// <param name="clsSqlServer"></param> /// <param name="bindingData"></param> /// <returns></returns> private Com02.struct_m_kaisya Set_EntryData(SqlServer clsSqlServer, BindingData bindingData) { // キーを条件に最新データを取得 Com02.struct_m_kaisya m_kaisya = new Com02.struct_m_kaisya(); m_kaisya.kigyo_code = Com01.clsSystemInfo.ComLineArgs.kigyo_code; m_kaisya.kaisya_code = bindingData.KaisyaCode.text; m_kaisya.invalid_flg = 1; // 削除も含めて検索 DataTable dTable = Com02.Get_m_kaisya(clsSqlServer, m_kaisya, 1); // システム日時を取得 Com01.Set_DateTime(clsSqlServer); // 更新日時をセット m_kaisya.koshin_datetime = Com01.clsSystemInfo.dtNow.ToString(); m_kaisya.koshin_user_id = Com01.clsSystemInfo.ComLineArgs.user_id; m_kaisya.koshin_program = Com01.clsSystemInfo.strExeName; // 検索結果 if (dTable == null || dTable.Rows.Count == 0) { // 新規登録日時 m_kaisya.toroku_datetime = m_kaisya.koshin_datetime; m_kaisya.toroku_user_id = m_kaisya.koshin_user_id; m_kaisya.toroku_program = m_kaisya.koshin_program; // 空の場合は規定値を m_kaisya.invalid_flg = 0; } else { DataRow dRow = dTable.Rows[0]; // 取得内容を構造体へ m_kaisya.toroku_datetime = dRow[Com02.struct_m_kaisya.idx_toroku_datetime].ToString(); m_kaisya.toroku_user_id = dRow[Com02.struct_m_kaisya.idx_toroku_user_id].ToString(); m_kaisya.toroku_program = dRow[Com02.struct_m_kaisya.idx_toroku_program].ToString(); m_kaisya.invalid_flg = int.Parse(dRow[Com02.struct_m_kaisya.idx_invalid_flg].ToString()); m_kaisya.kaisya_code = dRow[Com02.struct_m_kaisya.idx_kaisya_code].ToString(); m_kaisya.kaisya_name = dRow[Com02.struct_m_kaisya.idx_kaisya_name].ToString(); m_kaisya.kaisya_name_kana = dRow[Com02.struct_m_kaisya.idx_kaisya_name_kana].ToString(); m_kaisya.kaisya_name_ryaku = dRow[Com02.struct_m_kaisya.idx_kaisya_name_ryaku].ToString(); m_kaisya.address = dRow[Com02.struct_m_kaisya.idx_address].ToString(); m_kaisya.postal_code = dRow[Com02.struct_m_kaisya.idx_postal_code].ToString(); m_kaisya.tel_no = dRow[Com02.struct_m_kaisya.idx_tel_no].ToString(); m_kaisya.fax_no = dRow[Com02.struct_m_kaisya.idx_fax_no].ToString(); m_kaisya.mail_address = dRow[Com02.struct_m_kaisya.idx_mail_address].ToString(); } // これに対して画面内容を上書く if (bindingData.InvalidFlg.check == true) { m_kaisya.invalid_flg = 1; } else { m_kaisya.invalid_flg = 0; } m_kaisya.kaisya_code = bindingData.KaisyaCode.text; m_kaisya.kaisya_name = bindingData.KaisyaName.text; m_kaisya.kaisya_name_kana = bindingData.KaisyaName_Kana.text; m_kaisya.kaisya_name_ryaku = bindingData.KaisyaName_Ryaku.text; m_kaisya.address = bindingData.Address.text; m_kaisya.postal_code = bindingData.PostalCode_1.text + "-" + bindingData.PostalCode_2.text; m_kaisya.tel_no = bindingData.TelNo.text; m_kaisya.fax_no = bindingData.FaxNo.text; m_kaisya.mail_address = bindingData.MailAddress.text; return(m_kaisya); }
/// <summary> /// マテリアルマスタ登録データ設定処理 /// </summary> /// <param name="clsSqlServer"></param> /// <param name="bindingData"></param> /// <returns></returns> private Com02.struct_m_material Set_EntryData(SqlServer clsSqlServer, BindingData bindingData) { // キーを条件に最新データを取得 Com02.struct_m_material m_material = new Com02.struct_m_material(); m_material.kigyo_code = Com01.clsSystemInfo.ComLineArgs.kigyo_code; m_material.material_code = bindingData.MaterialCode; m_material.invalid_flg = 1; // 削除も含めて検索 DataTable dTable = Com02.Get_m_material(clsSqlServer, m_material, 1); // システム日時を取得 Com01.Set_DateTime(clsSqlServer); // 更新日時をセット m_material.koshin_datetime = Com01.clsSystemInfo.dtNow.ToString(); m_material.koshin_user_id = Com01.clsSystemInfo.ComLineArgs.user_id; m_material.koshin_program = Com01.clsSystemInfo.strExeName; // 検索結果 if (dTable == null || dTable.Rows.Count == 0) { // 新規登録日時 m_material.toroku_datetime = m_material.koshin_datetime; m_material.toroku_user_id = m_material.koshin_user_id; m_material.toroku_program = m_material.koshin_program; // 空の場合は規定値を m_material.invalid_flg = 0; } else { DataRow dRow = dTable.Rows[0]; // 取得内容を構造体へ m_material.toroku_datetime = dRow[Com02.struct_m_material.idx_toroku_datetime].ToString(); m_material.toroku_user_id = dRow[Com02.struct_m_material.idx_toroku_user_id].ToString(); m_material.toroku_program = dRow[Com02.struct_m_material.idx_toroku_program].ToString(); m_material.kigyo_code = dRow[Com02.struct_m_material.idx_kigyo_code].ToString(); m_material.material_code = dRow[Com02.struct_m_material.idx_material_code].ToString(); m_material.material_name = dRow[Com02.struct_m_material.idx_material_name].ToString(); m_material.unit_kbn = dRow[Com02.struct_m_material.idx_unit_kbn].ToString(); m_material.type_name = dRow[Com02.struct_m_material.idx_type_name].ToString(); m_material.kikaku_shiyo = dRow[Com02.struct_m_material.idx_kikaku_shiyo].ToString(); m_material.biko = dRow[Com02.struct_m_material.idx_biko].ToString(); m_material.yobi1 = dRow[Com02.struct_m_material.idx_yobi1].ToString(); m_material.yobi2 = dRow[Com02.struct_m_material.idx_yobi2].ToString(); m_material.yobi3 = dRow[Com02.struct_m_material.idx_yobi3].ToString(); m_material.yobi4 = dRow[Com02.struct_m_material.idx_yobi4].ToString(); m_material.yobi5 = dRow[Com02.struct_m_material.idx_yobi5].ToString(); m_material.invalid_flg = int.Parse(dRow[Com02.struct_m_material.idx_invalid_flg].ToString()); } // これに対して画面内容を上書く if (bindingData.InvalidFlg == true) { m_material.invalid_flg = 1; } else { m_material.invalid_flg = 0; } m_material.material_name = bindingData.MaterialName; m_material.unit_kbn = bindingData.UnitKbn; m_material.type_name = bindingData.TypeName; m_material.kikaku_shiyo = bindingData.KikakuShiyo; m_material.biko = bindingData.Biko; return(m_material); }