リビジョン 167
資材管理修正
完了ボタンの廃止
資材返却 破棄の項目を追加
返却数が0でも登録可能
資材選択時 クリック・ダブルクリックでチェックボックスにチェックが入るように修正
グリッドの行ヘッダを非表示に変更
| branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReserveEntry/FrmMaterialReserveEntry.cs | ||
|---|---|---|
| 166 | 166 |
InitializeComponent(); |
| 167 | 167 |
} |
| 168 | 168 |
#endregion |
| 169 |
|
|
| 169 | 170 |
#region デストラクタ |
| 170 | 171 |
~FrmMaterialReserveEntry() |
| 171 | 172 |
{
|
| ... | ... | |
| 180 | 181 |
} |
| 181 | 182 |
#endregion |
| 182 | 183 |
|
| 183 |
|
|
| 184 | 184 |
#region プロパティ |
| 185 | 185 |
/// <summary> |
| 186 | 186 |
/// ダイアログ使用時フラグ |
| ... | ... | |
| 268 | 268 |
#endregion |
| 269 | 269 |
|
| 270 | 270 |
#region イベントメソッド |
| 271 |
|
|
| 272 |
#region ×ボタン押下処理 |
|
| 271 | 273 |
/// <summary> |
| 272 | 274 |
/// ×ボタン押下処理 |
| 273 | 275 |
/// </summary> |
| ... | ... | |
| 303 | 305 |
|
| 304 | 306 |
} |
| 305 | 307 |
} |
| 308 |
#endregion |
|
| 306 | 309 |
|
| 310 |
#region 終了ボタン押下 |
|
| 307 | 311 |
/// <summary> |
| 308 | 312 |
/// 終了ボタン押下 |
| 309 | 313 |
/// </summary> |
| ... | ... | |
| 313 | 317 |
{
|
| 314 | 318 |
this.Close(); |
| 315 | 319 |
} |
| 320 |
#endregion |
|
| 316 | 321 |
|
| 322 |
#region フォームロード |
|
| 317 | 323 |
/// <summary> |
| 318 | 324 |
/// フォームロード |
| 319 | 325 |
/// </summary> |
| ... | ... | |
| 333 | 339 |
{
|
| 334 | 340 |
m_IoMi = new IOMaterialInfo(); |
| 335 | 341 |
m_IoMi.connect(); |
| 336 |
//m_IoMi.SetLockWaitime(1); // 排他制御削除 |
|
| 337 | 342 |
m_IoMi.beginTran(); |
| 338 | 343 |
|
| 339 | 344 |
} |
| ... | ... | |
| 357 | 362 |
// フォームサイズ固定 |
| 358 | 363 |
this.MaximizedBounds = new Rectangle(this.Left, this.Top, this.Width, this.Height); |
| 359 | 364 |
|
| 365 |
// ヘッダーの高さを固定 |
|
| 366 |
dgvMaster.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; |
|
| 367 |
|
|
| 360 | 368 |
// ボタン表示の制御 |
| 361 | 369 |
ButtonVisble(this); |
| 362 | 370 |
|
| ... | ... | |
| 364 | 372 |
CreateProcessContextMenu(m_SubForm); |
| 365 | 373 |
// *-----* 処理移動ボタン設定 *-----* |
| 366 | 374 |
} |
| 375 |
#endregion |
|
| 367 | 376 |
|
| 377 |
#region 行データクリア |
|
| 368 | 378 |
/// <summary> |
| 369 | 379 |
/// 行データクリア |
| 370 | 380 |
/// </summary> |
| ... | ... | |
| 373 | 383 |
{
|
| 374 | 384 |
// クリアデータセット |
| 375 | 385 |
} |
| 386 |
#endregion |
|
| 376 | 387 |
|
| 388 |
#region グリッド採番処理 |
|
| 377 | 389 |
/// <summary> |
| 378 | 390 |
/// グリッド採番処理 |
| 379 | 391 |
/// </summary> |
| ... | ... | |
| 389 | 401 |
r.Cells[(int)DispColumn.DisplayOrder].Value = "0"; |
| 390 | 402 |
} |
| 391 | 403 |
} |
| 404 |
#endregion |
|
| 392 | 405 |
|
| 406 |
#region 行追加ボタン押下 |
|
| 393 | 407 |
/// <summary> |
| 394 | 408 |
/// 行追加ボタン押下 |
| 395 | 409 |
/// </summary> |
| ... | ... | |
| 468 | 482 |
//dgvMaster.FirstDisplayedScrollingRowIndex = iIndex; |
| 469 | 483 |
//dgvMaster.CurrentCell = dgvMaster[0, iIndex]; |
| 470 | 484 |
} |
| 485 |
#endregion |
|
| 471 | 486 |
|
| 487 |
#region フィールド値変更フラグ |
|
| 472 | 488 |
/// <summary> |
| 473 | 489 |
/// フィールド値変更フラグ |
| 474 | 490 |
/// </summary> |
| ... | ... | |
| 478 | 494 |
{
|
| 479 | 495 |
m_bChengeAns = true; |
| 480 | 496 |
} |
| 497 |
#endregion |
|
| 481 | 498 |
|
| 499 |
#region セル値変化 |
|
| 482 | 500 |
/// <summary> |
| 483 | 501 |
/// セル値変化 |
| 484 | 502 |
/// </summary> |
| ... | ... | |
| 535 | 553 |
// 変更フラグON |
| 536 | 554 |
m_bChengeAns = true; |
| 537 | 555 |
} |
| 556 |
#endregion |
|
| 538 | 557 |
|
| 558 |
#region 行削除ボタン押下 |
|
| 539 | 559 |
/// <summary> |
| 540 | 560 |
/// 行削除ボタン押下 |
| 541 | 561 |
/// </summary> |
| ... | ... | |
| 587 | 607 |
uDB = null; |
| 588 | 608 |
} |
| 589 | 609 |
} |
| 610 |
#endregion |
|
| 590 | 611 |
|
| 612 |
#region 登録ボタン押下 |
|
| 591 | 613 |
/// <summary> |
| 592 | 614 |
/// 登録ボタン押下 |
| 593 | 615 |
/// </summary> |
| ... | ... | |
| 595 | 617 |
/// <param name="e"></param> |
| 596 | 618 |
private void btnDataEntry_Click(object sender, EventArgs e) |
| 597 | 619 |
{
|
| 598 |
try |
|
| 620 |
try
|
|
| 599 | 621 |
{
|
| 600 | 622 |
//データチェック |
| 601 | 623 |
if (!DispFeildCheck()) return; |
| 602 | 624 |
|
| 603 |
if (MessageBox.Show("表示中のデータを登録します。", "登録確認"
|
|
| 625 |
if (MessageBox.Show("表示中のデータを登録します。\r\n貸出可能数がゼロ、貸出数が未入力の資材は反映しませんがよろしいですか。", "登録確認"
|
|
| 604 | 626 |
, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return; |
| 605 | 627 |
|
| 606 | 628 |
// 表示行退避 |
| ... | ... | |
| 626 | 648 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
| 627 | 649 |
} |
| 628 | 650 |
} |
| 651 |
#endregion |
|
| 629 | 652 |
|
| 653 |
#region IMEのコントロール |
|
| 630 | 654 |
/// <summary> |
| 631 | 655 |
/// IMEのコントロール |
| 632 | 656 |
/// </summary> |
| ... | ... | |
| 655 | 679 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
| 656 | 680 |
} |
| 657 | 681 |
} |
| 682 |
#endregion |
|
| 658 | 683 |
|
| 659 |
|
|
| 684 |
#region セルダブルクリック |
|
| 660 | 685 |
/// <summary> |
| 661 | 686 |
/// セルダブルクリック |
| 662 | 687 |
/// </summary> |
| ... | ... | |
| 671 | 696 |
|
| 672 | 697 |
btnEnd_Click(sender, (EventArgs)e); |
| 673 | 698 |
} |
| 699 |
#endregion |
|
| 674 | 700 |
|
| 701 |
#region Formキーダウン処理 |
|
| 675 | 702 |
/// <summary> |
| 676 | 703 |
/// Formキーダウン処理 |
| 677 | 704 |
/// </summary> |
| ... | ... | |
| 685 | 712 |
return; |
| 686 | 713 |
} |
| 687 | 714 |
} |
| 715 |
#endregion |
|
| 688 | 716 |
|
| 689 | 717 |
#endregion |
| 690 | 718 |
|
| 691 | 719 |
#region プライベートメソッド |
| 720 |
|
|
| 721 |
#region コンボボックスのロード |
|
| 692 | 722 |
/// <summary> |
| 693 | 723 |
/// コンボボックスのロード |
| 694 | 724 |
/// </summary> |
| ... | ... | |
| 739 | 769 |
IoMri = null; |
| 740 | 770 |
} |
| 741 | 771 |
} |
| 772 |
#endregion |
|
| 742 | 773 |
|
| 774 |
#region 初期表示処理 |
|
| 743 | 775 |
/// <summary> |
| 744 | 776 |
/// 初期表示処理 |
| 745 | 777 |
/// </summary> |
| ... | ... | |
| 778 | 810 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
| 779 | 811 |
} |
| 780 | 812 |
} |
| 813 |
#endregion |
|
| 781 | 814 |
|
| 815 |
#region 画面項目のチェック |
|
| 782 | 816 |
/// <summary> |
| 783 | 817 |
/// 画面項目のチェック |
| 784 | 818 |
/// </summary> |
| ... | ... | |
| 802 | 836 |
foreach (DataGridViewRow r in dgvMaster.Rows) |
| 803 | 837 |
{
|
| 804 | 838 |
// |
| 805 |
bAns = true;
|
|
| 806 |
if (CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value) == 0)
|
|
| 839 |
if (r.Cells[(int)DispColumn.MaterialCount].Value == null
|
|
| 840 |
|| CommonMotions.cnvInt(r.Cells[(int)DispColumn.RentCount].Value) == 0)
|
|
| 807 | 841 |
{
|
| 808 |
bAns = false; |
|
| 809 |
sErrmsg = "貸出数が入力されていません。"; |
|
| 810 |
errorCol = (int)DispColumn.MaterialCount; |
|
| 842 |
continue; |
|
| 811 | 843 |
} |
| 844 |
else{
|
|
| 845 |
bAns = true; |
|
| 846 |
if (CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value) == 0) |
|
| 847 |
{
|
|
| 848 |
bAns = false; |
|
| 849 |
sErrmsg = "貸出数が入力されていません。"; |
|
| 850 |
errorCol = (int)DispColumn.MaterialCount; |
|
| 851 |
} |
|
| 812 | 852 |
|
| 813 |
Regex regex = new Regex(@"^[0-9]+$"); |
|
| 814 |
Match match = regex.Match(r.Cells[(int)DispColumn.MaterialCount].Value.ToString()); |
|
| 815 |
if (!match.Success) |
|
| 816 |
{
|
|
| 817 |
bAns = false; |
|
| 818 |
sErrmsg = "1以上の整数を入力してください。"; |
|
| 819 |
errorCol = (int)DispColumn.MaterialCount; |
|
| 820 |
} |
|
| 853 |
Regex regex = new Regex(@"^[0-9]+$");
|
|
| 854 |
Match match = regex.Match(r.Cells[(int)DispColumn.MaterialCount].Value.ToString());
|
|
| 855 |
if (!match.Success)
|
|
| 856 |
{
|
|
| 857 |
bAns = false;
|
|
| 858 |
sErrmsg = "1以上の整数を入力してください。";
|
|
| 859 |
errorCol = (int)DispColumn.MaterialCount;
|
|
| 860 |
}
|
|
| 821 | 861 |
|
| 822 |
// 背景色変更 |
|
| 823 |
CommonMotions.chgBackColor(r.Cells[errorCol], bAns); |
|
| 862 |
// 背景色変更
|
|
| 863 |
CommonMotions.chgBackColor(r.Cells[errorCol], bAns);
|
|
| 824 | 864 |
|
| 825 |
DateTime dt; |
|
| 826 |
if (CommonMotions.cnvString(r.Cells[(int)DispColumn.RepayPlanDate].Value).Length == 0) |
|
| 827 |
{
|
|
| 828 |
bAns = false; |
|
| 829 |
sErrmsg = "データが入力されていません、確認してください。"; |
|
| 830 |
errorCol = (int)DispColumn.RepayPlanDate; |
|
| 831 |
} |
|
| 832 |
regex = new Regex(@"^(\d{4})/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])$");
|
|
| 833 |
match = regex.Match(CommonMotions.cnvString(r.Cells[(int)DispColumn.RepayPlanDate].Value)); |
|
| 834 |
if(!match.Success)
|
|
| 835 |
{
|
|
| 836 |
bAns = false; |
|
| 837 |
sErrmsg = "日付のフォーマットが不正です。(YYYY/MM/DD形式で入力してください)"; |
|
| 838 |
errorCol = (int)DispColumn.RepayPlanDate; |
|
| 839 |
} |
|
| 840 |
else if (!DateTime.TryParse(CommonMotions.cnvString(r.Cells[(int)DispColumn.RepayPlanDate].Value), out dt)) |
|
| 841 |
{
|
|
| 842 |
bAns = false; |
|
| 843 |
sErrmsg = "日付のフォーマットが不正です。"; |
|
| 844 |
errorCol = (int)DispColumn.RepayPlanDate; |
|
| 845 |
} |
|
| 846 |
else if (dt.Date <= DateTime.Now.Date) |
|
| 847 |
{
|
|
| 848 |
bAns = false; |
|
| 849 |
sErrmsg = "返却予定日には、当日以前は設定できません。"; |
|
| 850 |
errorCol = (int)DispColumn.RepayPlanDate; |
|
| 851 |
} |
|
| 865 |
DateTime dt;
|
|
| 866 |
if (CommonMotions.cnvString(r.Cells[(int)DispColumn.RepayPlanDate].Value).Length == 0)
|
|
| 867 |
{
|
|
| 868 |
bAns = false;
|
|
| 869 |
sErrmsg = "データが入力されていません、確認してください。";
|
|
| 870 |
errorCol = (int)DispColumn.RepayPlanDate;
|
|
| 871 |
}
|
|
| 872 |
regex = new Regex(@"^(\d{4})/(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])$");
|
|
| 873 |
match = regex.Match(CommonMotions.cnvString(r.Cells[(int)DispColumn.RepayPlanDate].Value));
|
|
| 874 |
if (!match.Success)
|
|
| 875 |
{
|
|
| 876 |
bAns = false;
|
|
| 877 |
sErrmsg = "日付のフォーマットが不正です。(YYYY/MM/DD形式で入力してください)";
|
|
| 878 |
errorCol = (int)DispColumn.RepayPlanDate;
|
|
| 879 |
}
|
|
| 880 |
else if (!DateTime.TryParse(CommonMotions.cnvString(r.Cells[(int)DispColumn.RepayPlanDate].Value), out dt))
|
|
| 881 |
{
|
|
| 882 |
bAns = false;
|
|
| 883 |
sErrmsg = "日付のフォーマットが不正です。";
|
|
| 884 |
errorCol = (int)DispColumn.RepayPlanDate;
|
|
| 885 |
}
|
|
| 886 |
else if (dt.Date <= DateTime.Now.Date)
|
|
| 887 |
{
|
|
| 888 |
bAns = false;
|
|
| 889 |
sErrmsg = "返却予定日には、当日以前は設定できません。";
|
|
| 890 |
errorCol = (int)DispColumn.RepayPlanDate;
|
|
| 891 |
}
|
|
| 852 | 892 |
|
| 853 |
// 背景色変更 |
|
| 854 |
CommonMotions.chgBackColor(r.Cells[errorCol], bAns); |
|
| 893 |
// 背景色変更
|
|
| 894 |
CommonMotions.chgBackColor(r.Cells[errorCol], bAns);
|
|
| 855 | 895 |
|
| 856 |
if (CommonMotions.cnvString(r.Cells[(int)DispColumn.CommentText].Value) != "") |
|
| 857 |
{
|
|
| 858 |
// レングスチェック |
|
| 859 |
int len = Encoding.GetEncoding("Shift_JIS").GetByteCount(CommonMotions.cnvString(r.Cells[(int)DispColumn.CommentText].Value));
|
|
| 860 |
if (len > 80) |
|
| 896 |
if (CommonMotions.cnvString(r.Cells[(int)DispColumn.CommentText].Value) != "") |
|
| 861 | 897 |
{
|
| 862 |
bAns = false; |
|
| 863 |
sErrmsg = "入力エラーがあります、確認してください。"; |
|
| 864 |
errorCol = (int)DispColumn.CommentText; |
|
| 898 |
// レングスチェック |
|
| 899 |
int len = Encoding.GetEncoding("Shift_JIS").GetByteCount(CommonMotions.cnvString(r.Cells[(int)DispColumn.CommentText].Value));
|
|
| 900 |
if (len > 80) |
|
| 901 |
{
|
|
| 902 |
bAns = false; |
|
| 903 |
sErrmsg = "入力エラーがあります、確認してください。"; |
|
| 904 |
errorCol = (int)DispColumn.CommentText; |
|
| 905 |
} |
|
| 865 | 906 |
} |
| 907 |
|
|
| 908 |
// 背景色変更 |
|
| 909 |
CommonMotions.chgBackColor(r.Cells[errorCol], bAns); |
|
| 910 |
bRet &= bAns; |
|
| 866 | 911 |
} |
| 867 |
|
|
| 868 |
// 背景色変更 |
|
| 869 |
CommonMotions.chgBackColor(r.Cells[errorCol], bAns); |
|
| 870 |
bRet &= bAns; |
|
| 871 |
|
|
| 912 |
|
|
| 872 | 913 |
} |
| 873 |
|
|
| 874 | 914 |
if (!bRet) |
| 875 | 915 |
{
|
| 876 | 916 |
MessageBox.Show(sErrmsg, "データ確認" |
| ... | ... | |
| 886 | 926 |
return false; |
| 887 | 927 |
} |
| 888 | 928 |
} |
| 929 |
#endregion |
|
| 889 | 930 |
|
| 931 |
#region データ登録 |
|
| 890 | 932 |
/// <summary> |
| 891 | 933 |
/// データ登録 |
| 892 | 934 |
/// </summary> |
| ... | ... | |
| 925 | 967 |
|
| 926 | 968 |
foreach (DataGridViewRow r in dgvMaster.Rows) |
| 927 | 969 |
{
|
| 928 |
bool bProcessNoToday = false; |
|
| 929 |
|
|
| 930 |
MiMaster = new MaterialItemMaster(); |
|
| 931 |
MiWork = new MaterialInfo(); |
|
| 932 |
CmiWork = new ConstructionMaterialInfo(); |
|
| 933 |
MriWork = new MaterialRecordInfo(); |
|
| 934 |
|
|
| 935 |
CmiList = new List<ConstructionMaterialInfo>(); |
|
| 936 |
MriList = new List<MaterialRecordInfo>(); |
|
| 937 |
|
|
| 938 |
int intMaterialItemCode = CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialItemCode].Value); |
|
| 939 |
int intRentCount= CommonMotions.cnvInt(r.Cells[(int)DispColumn.RentCount].Value); |
|
| 940 |
int intMaterialCount = CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value); |
|
| 941 |
int intMaterialCountBefore = CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCountBefore].Value); |
|
| 942 |
|
|
| 943 |
ArrayList arData = new ArrayList(); |
|
| 944 |
// 当日以外のデータが存在するか調査 |
|
| 945 |
string sql = string.Format("select ProcessDate from MaterialRecordInfo where ProcessDate <> DATE_FORMAT('{0}','%Y/%m/%d') and ConstructionCode = {1} and MaterialItemCode = {2} and RECKIND = 0 group by ProcessDate", strProcessdate, m_ConstructionCode, intMaterialItemCode);
|
|
| 946 |
IoMri.ExecuteReader(sql, ref arData,false); |
|
| 947 |
if (arData.Count != 0) bProcessNoToday = true; |
|
| 948 |
|
|
| 949 |
// 資材品目マスタバージョンNo取得 |
|
| 950 |
string strMimSQL = IoMim.CreatePrimarykeyString(intMaterialItemCode); |
|
| 951 |
List<MaterialItemMaster> MimList = new List<MaterialItemMaster>(); |
|
| 952 |
if (!IoMim.SelectAction(strMimSQL, ref MimList, false)) |
|
| 970 |
if (r.Cells[(int)DispColumn.MaterialCount].Value == null |
|
| 971 |
|| CommonMotions.cnvInt(r.Cells[(int)DispColumn.RentCount].Value) == 0) |
|
| 953 | 972 |
{
|
| 954 |
MessageBox.Show("資材品目マスタの取得に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 955 |
return false; |
|
| 973 |
continue; |
|
| 956 | 974 |
} |
| 957 |
MiMaster = MimList[0]; |
|
| 958 |
|
|
| 959 |
// 資材情報 |
|
| 960 |
string strSQL = m_IoMi.CreatePrimarykeyString(intMaterialItemCode); |
|
| 961 |
List<MaterialInfo> MiList = new List<MaterialInfo>(); |
|
| 962 |
if (!m_IoMi.SelectAction(strSQL, ref MiList, false)) |
|
| 975 |
else |
|
| 963 | 976 |
{
|
| 964 |
MessageBox.Show("登録確認に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 965 |
return false; |
|
| 966 |
} |
|
| 977 |
bool bProcessNoToday = false; |
|
| 967 | 978 |
|
| 968 |
// 更新ロック |
|
| 969 |
//m_IoMi.rollback(); |
|
| 970 |
//if (!m_IoMi.RowLockUpdate(intMaterialItemCode, false)) |
|
| 971 |
//{
|
|
| 972 |
// m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 973 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 974 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 975 |
// return false; |
|
| 976 |
//} |
|
| 977 |
// 登録チェック②-2 |
|
| 978 |
if ((MiList[0].RentCount + CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCountBefore].Value)) < CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value)) |
|
| 979 |
{
|
|
| 980 |
//m_IoMi.rollback(); |
|
| 981 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 982 |
MessageBox.Show("割当可能数を超えて、資材の予約できません。", "登録エラー"
|
|
| 983 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 984 |
return false; |
|
| 985 |
} |
|
| 979 |
MiMaster = new MaterialItemMaster(); |
|
| 980 |
MiWork = new MaterialInfo(); |
|
| 981 |
CmiWork = new ConstructionMaterialInfo(); |
|
| 982 |
MriWork = new MaterialRecordInfo(); |
|
| 986 | 983 |
|
| 987 |
// 解除時は前貸出数を加算 |
|
| 988 |
MiWork.MaterialCount = MiList[0].MaterialCount; |
|
| 989 |
if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Deleted) |
|
| 990 |
{
|
|
| 991 |
MiWork.RentCount = intRentCount + intMaterialCountBefore; |
|
| 992 |
} |
|
| 993 |
else |
|
| 994 |
{
|
|
| 995 |
MiWork.RentCount = (intRentCount + intMaterialCountBefore) - intMaterialCount; |
|
| 996 |
} |
|
| 997 |
MiWork.DeleteFlg = MiList[0].DeleteFlg; |
|
| 984 |
CmiList = new List<ConstructionMaterialInfo>(); |
|
| 985 |
MriList = new List<MaterialRecordInfo>(); |
|
| 998 | 986 |
|
| 999 |
// データ登録 |
|
| 1000 |
if (!m_IoMi.UpdateAction(strSQL, MiWork, false)) |
|
| 1001 |
{
|
|
| 1002 |
//m_IoMi.rollback(); |
|
| 1003 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1004 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1005 |
return false; |
|
| 1006 |
} |
|
| 987 |
int intMaterialItemCode = CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialItemCode].Value); |
|
| 988 |
int intRentCount = CommonMotions.cnvInt(r.Cells[(int)DispColumn.RentCount].Value); |
|
| 989 |
int intMaterialCount = CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value); |
|
| 990 |
int intMaterialCountBefore = CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCountBefore].Value); |
|
| 1007 | 991 |
|
| 1008 |
// データ操作内容設定 |
|
| 1009 |
if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Added) |
|
| 1010 |
{
|
|
| 1011 |
if (bProcessNoToday == false) // 登録時のDB登録について 1 |
|
| 992 |
ArrayList arData = new ArrayList(); |
|
| 993 |
// 当日以外のデータが存在するか調査 |
|
| 994 |
string sql = string.Format("select ProcessDate from MaterialRecordInfo where ProcessDate <> DATE_FORMAT('{0}','%Y/%m/%d') and ConstructionCode = {1} and MaterialItemCode = {2} and RECKIND = 0 group by ProcessDate", strProcessdate, m_ConstructionCode, intMaterialItemCode);
|
|
| 995 |
IoMri.ExecuteReader(sql, ref arData, false); |
|
| 996 |
if (arData.Count != 0) bProcessNoToday = true; |
|
| 997 |
|
|
| 998 |
// 資材品目マスタバージョンNo取得 |
|
| 999 |
string strMimSQL = IoMim.CreatePrimarykeyString(intMaterialItemCode); |
|
| 1000 |
List<MaterialItemMaster> MimList = new List<MaterialItemMaster>(); |
|
| 1001 |
if (!IoMim.SelectAction(strMimSQL, ref MimList, false)) |
|
| 1012 | 1002 |
{
|
| 1013 |
CmiState = DataRowState.Added; |
|
| 1014 |
MriState = DataRowState.Added; |
|
| 1003 |
MessageBox.Show("資材品目マスタの取得に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1004 |
return false; |
|
| 1005 |
} |
|
| 1006 |
MiMaster = MimList[0]; |
|
| 1015 | 1007 |
|
| 1008 |
// 資材情報 |
|
| 1009 |
string strSQL = m_IoMi.CreatePrimarykeyString(intMaterialItemCode); |
|
| 1010 |
List<MaterialInfo> MiList = new List<MaterialInfo>(); |
|
| 1011 |
if (!m_IoMi.SelectAction(strSQL, ref MiList, false)) |
|
| 1012 |
{
|
|
| 1013 |
MessageBox.Show("登録確認に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1014 |
return false; |
|
| 1016 | 1015 |
} |
| 1017 |
else if (bProcessNoToday == true) // 登録時のDB登録について 2 |
|
| 1016 |
|
|
| 1017 |
// 更新ロック |
|
| 1018 |
//m_IoMi.rollback(); |
|
| 1019 |
//if (!m_IoMi.RowLockUpdate(intMaterialItemCode, false)) |
|
| 1020 |
//{
|
|
| 1021 |
// m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1022 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 1023 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 1024 |
// return false; |
|
| 1025 |
//} |
|
| 1026 |
// 登録チェック②-2 |
|
| 1027 |
if ((MiList[0].RentCount + CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCountBefore].Value)) < CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value)) |
|
| 1018 | 1028 |
{
|
| 1019 |
CmiState = DataRowState.Modified; |
|
| 1020 |
MriState = DataRowState.Added; |
|
| 1029 |
//m_IoMi.rollback(); |
|
| 1030 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1031 |
MessageBox.Show("割当可能数を超えて、資材の予約できません。", "登録エラー"
|
|
| 1032 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 1033 |
return false; |
|
| 1021 | 1034 |
} |
| 1022 |
} |
|
| 1023 |
else if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Unchanged) |
|
| 1024 |
{
|
|
| 1025 |
// 登録時のDB登録について 3、4 |
|
| 1026 |
CmiState = DataRowState.Modified; |
|
| 1027 |
MriState = DataRowState.Modified; |
|
| 1028 |
} |
|
| 1029 |
else if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Deleted) |
|
| 1030 |
{
|
|
| 1031 |
if (bProcessNoToday == false) // 登録時のDB登録について 5 |
|
| 1035 |
|
|
| 1036 |
// 解除時は前貸出数を加算 |
|
| 1037 |
MiWork.MaterialCount = MiList[0].MaterialCount; |
|
| 1038 |
if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Deleted) |
|
| 1032 | 1039 |
{
|
| 1033 |
CmiState = DataRowState.Deleted; |
|
| 1034 |
MriState = DataRowState.Deleted; |
|
| 1040 |
MiWork.RentCount = intRentCount + intMaterialCountBefore; |
|
| 1035 | 1041 |
} |
| 1036 |
else if (bProcessNoToday == true) // 登録時のDB登録について 6
|
|
| 1042 |
else |
|
| 1037 | 1043 |
{
|
| 1038 |
CmiState = DataRowState.Modified; |
|
| 1039 |
MriState = DataRowState.Deleted; |
|
| 1044 |
MiWork.RentCount = (intRentCount + intMaterialCountBefore) - intMaterialCount; |
|
| 1040 | 1045 |
} |
| 1041 |
}
|
|
| 1046 |
MiWork.DeleteFlg = MiList[0].DeleteFlg;
|
|
| 1042 | 1047 |
|
| 1043 |
|
|
| 1044 |
// 工事資材情報 |
|
| 1045 |
CmiWork.ConstructionCode = m_ConstructionCode; |
|
| 1046 |
CmiWork.MaterialItemCode = intMaterialItemCode; |
|
| 1047 |
CmiWork.CompleteFlg = 0; |
|
| 1048 |
|
|
| 1049 |
if (CmiState == DataRowState.Added) // 工事資材情報 新規 |
|
| 1050 |
{
|
|
| 1051 |
CmiWork.RentCount = intMaterialCount; |
|
| 1052 |
CmiWork.RepayCount = 0; |
|
| 1053 |
|
|
| 1054 |
CmiList.Clear(); |
|
| 1055 |
CmiList.Add(CmiWork); |
|
| 1056 | 1048 |
// データ登録 |
| 1057 |
if (!IoCmi.InsertAction(CmiList, false))
|
|
| 1049 |
if (!m_IoMi.UpdateAction(strSQL, MiWork, false))
|
|
| 1058 | 1050 |
{
|
| 1059 | 1051 |
//m_IoMi.rollback(); |
| 1060 | 1052 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
| 1061 |
IoCmi.rollback(); |
|
| 1062 | 1053 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| 1063 | 1054 |
return false; |
| 1064 | 1055 |
} |
| 1065 | 1056 |
|
| 1066 |
} |
|
| 1067 |
else if (CmiState == DataRowState.Modified || CmiState == DataRowState.Deleted) // 工事資材情報 更新or削除 |
|
| 1068 |
{
|
|
| 1069 |
// 工事資材情報 |
|
| 1070 |
strSQL = IoCmi.CreatePrimarykeyString(m_ConstructionCode, intMaterialItemCode); |
|
| 1071 |
if (!IoCmi.SelectAction(strSQL, ref CmiList, false)) |
|
| 1057 |
// データ操作内容設定 |
|
| 1058 |
if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Added) |
|
| 1072 | 1059 |
{
|
| 1073 |
//m_IoMi.rollback(); |
|
| 1074 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1075 |
MessageBox.Show("登録確認に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1076 |
return false; |
|
| 1077 |
} |
|
| 1060 |
if (bProcessNoToday == false) // 登録時のDB登録について 1 |
|
| 1061 |
{
|
|
| 1062 |
CmiState = DataRowState.Added; |
|
| 1063 |
MriState = DataRowState.Added; |
|
| 1078 | 1064 |
|
| 1079 |
// 解除時は前貸出数を減算 |
|
| 1080 |
if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Deleted) |
|
| 1081 |
{
|
|
| 1082 |
CmiWork.RentCount = (CmiList[0].RentCount - intMaterialCountBefore); |
|
| 1065 |
} |
|
| 1066 |
else if (bProcessNoToday == true) // 登録時のDB登録について 2 |
|
| 1067 |
{
|
|
| 1068 |
CmiState = DataRowState.Modified; |
|
| 1069 |
MriState = DataRowState.Added; |
|
| 1070 |
} |
|
| 1083 | 1071 |
} |
| 1084 |
else |
|
| 1072 |
else if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Unchanged)
|
|
| 1085 | 1073 |
{
|
| 1086 |
CmiWork.RentCount = (CmiList[0].RentCount - intMaterialCountBefore) + intMaterialCount; |
|
| 1074 |
// 登録時のDB登録について 3、4 |
|
| 1075 |
CmiState = DataRowState.Modified; |
|
| 1076 |
MriState = DataRowState.Modified; |
|
| 1087 | 1077 |
} |
| 1088 |
if (CmiList.Count != 0)
|
|
| 1078 |
else if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Deleted)
|
|
| 1089 | 1079 |
{
|
| 1090 |
CmiWork.RepayCount = CmiList[0].RepayCount; |
|
| 1080 |
if (bProcessNoToday == false) // 登録時のDB登録について 5 |
|
| 1081 |
{
|
|
| 1082 |
CmiState = DataRowState.Deleted; |
|
| 1083 |
MriState = DataRowState.Deleted; |
|
| 1084 |
} |
|
| 1085 |
else if (bProcessNoToday == true) // 登録時のDB登録について 6 |
|
| 1086 |
{
|
|
| 1087 |
CmiState = DataRowState.Modified; |
|
| 1088 |
MriState = DataRowState.Deleted; |
|
| 1089 |
} |
|
| 1091 | 1090 |
} |
| 1092 | 1091 |
|
| 1093 |
// ロック |
|
| 1094 |
//if (!IoCmi.RowLock(m_ConstructionCode, intMaterialItemCode, false)) |
|
| 1095 |
//{
|
|
| 1096 |
// m_IoMi.rollback(); |
|
| 1097 |
// m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1098 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 1099 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 1100 |
// return false; |
|
| 1101 |
//} |
|
| 1102 | 1092 |
|
| 1103 |
if (CmiState == DataRowState.Modified) // 更新 |
|
| 1093 |
// 工事資材情報 |
|
| 1094 |
CmiWork.ConstructionCode = m_ConstructionCode; |
|
| 1095 |
CmiWork.MaterialItemCode = intMaterialItemCode; |
|
| 1096 |
CmiWork.CompleteFlg = 0; |
|
| 1097 |
|
|
| 1098 |
if (CmiState == DataRowState.Added) // 工事資材情報 新規 |
|
| 1104 | 1099 |
{
|
| 1105 |
// データ更新 |
|
| 1106 |
if (!IoCmi.UpdateAction(strSQL, CmiWork, false)) |
|
| 1100 |
CmiWork.RentCount = intMaterialCount; |
|
| 1101 |
CmiWork.RepayCount = 0; |
|
| 1102 |
|
|
| 1103 |
CmiList.Clear(); |
|
| 1104 |
CmiList.Add(CmiWork); |
|
| 1105 |
// データ登録 |
|
| 1106 |
if (!IoCmi.InsertAction(CmiList, false)) |
|
| 1107 | 1107 |
{
|
| 1108 | 1108 |
//m_IoMi.rollback(); |
| 1109 | 1109 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
| ... | ... | |
| 1111 | 1111 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| 1112 | 1112 |
return false; |
| 1113 | 1113 |
} |
| 1114 |
|
|
| 1114 | 1115 |
} |
| 1115 |
else if (CmiState == DataRowState.Deleted) // 削除
|
|
| 1116 |
else if (CmiState == DataRowState.Modified || CmiState == DataRowState.Deleted) // 工事資材情報 更新or削除
|
|
| 1116 | 1117 |
{
|
| 1117 |
// データ更新 |
|
| 1118 |
if (!IoCmi.DeleteAction(strSQL, false)) |
|
| 1118 |
// 工事資材情報 |
|
| 1119 |
strSQL = IoCmi.CreatePrimarykeyString(m_ConstructionCode, intMaterialItemCode); |
|
| 1120 |
if (!IoCmi.SelectAction(strSQL, ref CmiList, false)) |
|
| 1119 | 1121 |
{
|
| 1120 | 1122 |
//m_IoMi.rollback(); |
| 1121 | 1123 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
| 1122 |
IoCmi.rollback(); |
|
| 1123 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1124 |
MessageBox.Show("登録確認に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1124 | 1125 |
return false; |
| 1125 | 1126 |
} |
| 1126 |
} |
|
| 1127 | 1127 |
|
| 1128 |
} |
|
| 1128 |
// 解除時は前貸出数を減算 |
|
| 1129 |
if ((DataRowState)r.Cells[(int)DispColumn.RowState].Value == DataRowState.Deleted) |
|
| 1130 |
{
|
|
| 1131 |
CmiWork.RentCount = (CmiList[0].RentCount - intMaterialCountBefore); |
|
| 1132 |
} |
|
| 1133 |
else |
|
| 1134 |
{
|
|
| 1135 |
CmiWork.RentCount = (CmiList[0].RentCount - intMaterialCountBefore) + intMaterialCount; |
|
| 1136 |
} |
|
| 1137 |
if (CmiList.Count != 0) |
|
| 1138 |
{
|
|
| 1139 |
CmiWork.RepayCount = CmiList[0].RepayCount; |
|
| 1140 |
} |
|
| 1129 | 1141 |
|
| 1130 |
// 資材履歴情報 |
|
| 1131 |
MriWork.MaterialCount = intMaterialCount; |
|
| 1132 |
MriWork.RepayPlanDate = CommonMotions.cnvDate(r.Cells[(int)DispColumn.RepayPlanDate].Value); |
|
| 1133 |
MriWork.CommentText = CommonMotions.cnvString(r.Cells[(int)DispColumn.CommentText].Value); |
|
| 1134 |
MriWork.ConstructionCode = m_ConstructionCode; |
|
| 1135 |
MriWork.PersonCode = CommonMotions.LoginUserData.PersonCode; |
|
| 1136 |
MriWork.RecKind = 0; |
|
| 1142 |
// ロック |
|
| 1143 |
//if (!IoCmi.RowLock(m_ConstructionCode, intMaterialItemCode, false)) |
|
| 1144 |
//{
|
|
| 1145 |
// m_IoMi.rollback(); |
|
| 1146 |
// m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1147 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 1148 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 1149 |
// return false; |
|
| 1150 |
//} |
|
| 1137 | 1151 |
|
| 1138 |
strSQL = IoMri.CreatePrimarykeyString(intMaterialItemCode, CommonMotions.cnvDate(strProcessdate)); |
|
| 1152 |
if (CmiState == DataRowState.Modified) // 更新 |
|
| 1153 |
{
|
|
| 1154 |
// データ更新 |
|
| 1155 |
if (!IoCmi.UpdateAction(strSQL, CmiWork, false)) |
|
| 1156 |
{
|
|
| 1157 |
//m_IoMi.rollback(); |
|
| 1158 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1159 |
IoCmi.rollback(); |
|
| 1160 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1161 |
return false; |
|
| 1162 |
} |
|
| 1163 |
} |
|
| 1164 |
else if (CmiState == DataRowState.Deleted) // 削除 |
|
| 1165 |
{
|
|
| 1166 |
// データ更新 |
|
| 1167 |
if (!IoCmi.DeleteAction(strSQL, false)) |
|
| 1168 |
{
|
|
| 1169 |
//m_IoMi.rollback(); |
|
| 1170 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1171 |
IoCmi.rollback(); |
|
| 1172 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1173 |
return false; |
|
| 1174 |
} |
|
| 1175 |
} |
|
| 1139 | 1176 |
|
| 1140 |
if (MriState == DataRowState.Added) // 資材履歴情報 新規 |
|
| 1141 |
{
|
|
| 1142 |
MriWork.MaterialItemCode = intMaterialItemCode; |
|
| 1143 |
MriWork.ProcessDate = CommonMotions.cnvDate(strProcessdate); |
|
| 1144 |
MriWork.SeqNo = IoMri.SelectMaxMaterialRecordKeyCount(strSQL,false) + 1; |
|
| 1145 |
|
|
| 1146 |
MriList.Clear(); |
|
| 1147 |
MriList.Add(MriWork); |
|
| 1148 |
// データ登録 |
|
| 1149 |
if (!IoMri.InsertAction(MriList, false)) |
|
| 1150 |
{
|
|
| 1151 |
//m_IoMi.rollback(); |
|
| 1152 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1153 |
IoCmi.rollback(); |
|
| 1154 |
IoMri.rollback(); |
|
| 1155 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1156 |
return false; |
|
| 1157 | 1177 |
} |
| 1158 |
} |
|
| 1159 |
else if (MriState == DataRowState.Modified || MriState == DataRowState.Deleted) // 資材履歴情報 更新or削除 |
|
| 1160 |
{
|
|
| 1161 |
// データ確認 |
|
| 1162 |
strSQL += "and RecKind = 0"; |
|
| 1163 |
if (!IoMri.SelectAction(strSQL, ref MriList, false)) |
|
| 1164 |
{
|
|
| 1165 |
//m_IoMi.rollback(); |
|
| 1166 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1167 |
IoCmi.rollback(); |
|
| 1168 |
MessageBox.Show("登録確認に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1169 |
return false; |
|
| 1170 |
} |
|
| 1171 | 1178 |
|
| 1172 |
// ロック |
|
| 1173 |
//if (!IoMri.RowLock(intMaterialItemCode, MriList[0].ProcessDate, MriList[0].SeqNo, false)) |
|
| 1174 |
//{
|
|
| 1175 |
// m_IoMi.rollback(); |
|
| 1176 |
// m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1177 |
// IoCmi.rollback(); |
|
| 1178 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 1179 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 1180 |
// return false; |
|
| 1181 |
//} |
|
| 1179 |
// 資材履歴情報 |
|
| 1180 |
MriWork.MaterialCount = intMaterialCount; |
|
| 1181 |
MriWork.RepayPlanDate = CommonMotions.cnvDate(r.Cells[(int)DispColumn.RepayPlanDate].Value); |
|
| 1182 |
MriWork.CommentText = CommonMotions.cnvString(r.Cells[(int)DispColumn.CommentText].Value); |
|
| 1183 |
MriWork.ConstructionCode = m_ConstructionCode; |
|
| 1184 |
MriWork.PersonCode = CommonMotions.LoginUserData.PersonCode; |
|
| 1185 |
MriWork.RecKind = 0; |
|
| 1182 | 1186 |
|
| 1183 |
if (MriState == DataRowState.Modified) // 更新 |
|
| 1187 |
strSQL = IoMri.CreatePrimarykeyString(intMaterialItemCode, CommonMotions.cnvDate(strProcessdate)); |
|
| 1188 |
|
|
| 1189 |
if (MriState == DataRowState.Added) // 資材履歴情報 新規 |
|
| 1184 | 1190 |
{
|
| 1185 |
// データ更新 |
|
| 1186 |
if (!IoMri.UpdateAction(strSQL, MriWork, false)) |
|
| 1191 |
MriWork.MaterialItemCode = intMaterialItemCode; |
|
| 1192 |
MriWork.ProcessDate = CommonMotions.cnvDate(strProcessdate); |
|
| 1193 |
MriWork.SeqNo = IoMri.SelectMaxMaterialRecordKeyCount(strSQL, false) + 1; |
|
| 1194 |
|
|
| 1195 |
MriList.Clear(); |
|
| 1196 |
MriList.Add(MriWork); |
|
| 1197 |
// データ登録 |
|
| 1198 |
if (!IoMri.InsertAction(MriList, false)) |
|
| 1187 | 1199 |
{
|
| 1188 | 1200 |
//m_IoMi.rollback(); |
| 1189 | 1201 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
| ... | ... | |
| 1193 | 1205 |
return false; |
| 1194 | 1206 |
} |
| 1195 | 1207 |
} |
| 1196 |
else if (MriState == DataRowState.Deleted) // 削除
|
|
| 1208 |
else if (MriState == DataRowState.Modified || MriState == DataRowState.Deleted) // 資材履歴情報 更新or削除
|
|
| 1197 | 1209 |
{
|
| 1198 |
// データ更新 |
|
| 1199 |
if (!IoMri.DeleteAction(strSQL, false)) |
|
| 1210 |
// データ確認 |
|
| 1211 |
|
|
| 1212 |
MriWork.MaterialItemCode = intMaterialItemCode; |
|
| 1213 |
MriWork.ProcessDate = CommonMotions.cnvDate(strProcessdate); |
|
| 1214 |
MriWork.SeqNo = IoMri.SelectMaxMaterialRecordKeyCount(strSQL, false); |
|
| 1215 |
|
|
| 1216 |
strSQL += string.Format("and RecKind = 0 and ConstructionCode = {0}", m_ConstructionCode.ToString());
|
|
| 1217 |
|
|
| 1218 |
MriList.Clear(); |
|
| 1219 |
MriList.Add(MriWork); |
|
| 1220 |
|
|
| 1221 |
if (!IoMri.SelectAction(strSQL, ref MriList, false)) |
|
| 1200 | 1222 |
{
|
| 1201 | 1223 |
//m_IoMi.rollback(); |
| 1202 | 1224 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
| 1203 | 1225 |
IoCmi.rollback(); |
| 1204 |
IoMri.rollback(); |
|
| 1205 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1226 |
MessageBox.Show("登録確認に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1206 | 1227 |
return false; |
| 1207 | 1228 |
} |
| 1229 |
|
|
| 1230 |
// ロック |
|
| 1231 |
//if (!IoMri.RowLock(intMaterialItemCode, MriList[0].ProcessDate, MriList[0].SeqNo, false)) |
|
| 1232 |
//{
|
|
| 1233 |
// m_IoMi.rollback(); |
|
| 1234 |
// m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1235 |
// IoCmi.rollback(); |
|
| 1236 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 1237 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 1238 |
// return false; |
|
| 1239 |
//} |
|
| 1240 |
|
|
| 1241 |
if (MriState == DataRowState.Modified) // 更新 |
|
| 1242 |
{
|
|
| 1243 |
// データ更新 |
|
| 1244 |
if (!IoMri.UpdateAction(strSQL, MriWork, false)) |
|
| 1245 |
{
|
|
| 1246 |
//m_IoMi.rollback(); |
|
| 1247 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1248 |
IoCmi.rollback(); |
|
| 1249 |
IoMri.rollback(); |
|
| 1250 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1251 |
return false; |
|
| 1252 |
} |
|
| 1253 |
} |
|
| 1254 |
else if (MriState == DataRowState.Deleted) // 削除 |
|
| 1255 |
{
|
|
| 1256 |
// データ更新 |
|
| 1257 |
if (!IoMri.DeleteAction(strSQL, false)) |
|
| 1258 |
{
|
|
| 1259 |
//m_IoMi.rollback(); |
|
| 1260 |
//m_IoMi.RowLockShare(intMaterialItemCode, false); |
|
| 1261 |
IoCmi.rollback(); |
|
| 1262 |
IoMri.rollback(); |
|
| 1263 |
MessageBox.Show("更新に失敗しました。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1264 |
return false; |
|
| 1265 |
} |
|
| 1266 |
} |
|
| 1208 | 1267 |
} |
| 1209 |
} |
|
| 1210 | 1268 |
|
| 1211 |
// 資材品目マスタバージョンNo更新 |
|
| 1212 |
strMimSQL += string.Format(" And VersionNo = {0}", MiMaster.VersionNo.ToString());
|
|
| 1213 |
if (!IoMim.UpdateVersionAction(strMimSQL, MiMaster, false)) |
|
| 1214 |
{
|
|
| 1215 |
MessageBox.Show("他のユーザで更新されています。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1216 |
m_IoMi.rollback(); |
|
| 1217 |
IoCmi.rollback(); |
|
| 1218 |
IoMri.rollback(); |
|
| 1219 |
IoMim.rollback(); |
|
| 1220 |
return false; |
|
| 1269 |
// 資材品目マスタバージョンNo更新 |
|
| 1270 |
strMimSQL += string.Format(" And VersionNo = {0}", MiMaster.VersionNo.ToString());
|
|
| 1271 |
if (!IoMim.UpdateVersionAction(strMimSQL, MiMaster, false)) |
|
| 1272 |
{
|
|
| 1273 |
MessageBox.Show("他のユーザで更新されています。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 1274 |
m_IoMi.rollback(); |
|
| 1275 |
IoCmi.rollback(); |
|
| 1276 |
IoMri.rollback(); |
|
| 1277 |
IoMim.rollback(); |
|
| 1278 |
return false; |
|
| 1279 |
} |
|
| 1221 | 1280 |
} |
| 1222 | 1281 |
} |
| 1223 | 1282 |
|
| ... | ... | |
| 1249 | 1308 |
IoMim.close(); |
| 1250 | 1309 |
IoMim = null; |
| 1251 | 1310 |
} |
| 1311 |
|
|
| 1312 |
CommonMotions.EntryEndMessage("資材貸出");
|
|
| 1252 | 1313 |
} |
| 1253 | 1314 |
return true; |
| 1254 | 1315 |
} |
| 1316 |
#endregion |
|
| 1255 | 1317 |
|
| 1318 |
#region グリッド表示 |
|
| 1256 | 1319 |
/// <summary> |
| 1257 | 1320 |
/// グリッド表示 |
| 1258 | 1321 |
/// </summary> |
| ... | ... | |
| 1377 | 1440 |
} |
| 1378 | 1441 |
return true; |
| 1379 | 1442 |
} |
| 1443 |
#endregion |
|
| 1380 | 1444 |
|
| 1445 |
#region ボタンの表示・非表示制御 |
|
| 1381 | 1446 |
/// <summary> |
| 1382 | 1447 |
/// ボタンの表示・非表示制御 |
| 1383 | 1448 |
/// </summary> |
| ... | ... | |
| 1404 | 1469 |
// グリッドの読込のみ制御 |
| 1405 | 1470 |
dgvMaster.ReadOnly = m_DialogFlg; |
| 1406 | 1471 |
} |
| 1472 |
#endregion |
|
| 1407 | 1473 |
|
| 1408 |
|
|
| 1409 |
|
|
| 1474 |
#region 資材選択押下 |
|
| 1410 | 1475 |
/// <summary> |
| 1411 | 1476 |
/// 資材選択押下 |
| 1412 | 1477 |
/// </summary> |
| ... | ... | |
| 1494 | 1559 |
|
| 1495 | 1560 |
} |
| 1496 | 1561 |
} |
| 1562 |
#endregion |
|
| 1497 | 1563 |
|
| 1564 |
#region グリッド最終行での処理 |
|
| 1498 | 1565 |
/// <summary> |
| 1499 | 1566 |
/// グリッド最終行での処理 |
| 1500 | 1567 |
/// </summary> |
| ... | ... | |
| 1516 | 1583 |
|
| 1517 | 1584 |
} |
| 1518 | 1585 |
} |
| 1586 |
#endregion |
|
| 1519 | 1587 |
|
| 1588 |
#region 選択されているインデックスの変更 |
|
| 1589 |
/// <summary> |
|
| 1590 |
/// 選択されているインデックスの変更 |
|
| 1591 |
/// </summary> |
|
| 1520 | 1592 |
private void cmbProcessDate_SelectedIndexChanged(object sender, EventArgs e) |
| 1521 | 1593 |
{
|
| 1522 | 1594 |
if (cmbProcessDate.SelectedValue != null) |
| ... | ... | |
| 1539 | 1611 |
DispGridData(); |
| 1540 | 1612 |
} |
| 1541 | 1613 |
} |
| 1614 |
#endregion |
|
| 1542 | 1615 |
|
| 1616 |
#region 資材履歴押下 |
|
| 1543 | 1617 |
/// <summary> |
| 1544 | 1618 |
/// 資材履歴押下 |
| 1545 | 1619 |
/// </summary> |
| ... | ... | |
| 1575 | 1649 |
} |
| 1576 | 1650 |
|
| 1577 | 1651 |
} |
| 1652 |
#endregion |
|
| 1578 | 1653 |
|
| 1654 |
#region ボタン制御 |
|
| 1579 | 1655 |
/// <summary> |
| 1580 | 1656 |
/// ボタン制御 |
| 1581 | 1657 |
/// </summary> |
| ... | ... | |
| 1601 | 1677 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
| 1602 | 1678 |
} |
| 1603 | 1679 |
} |
| 1680 |
#endregion |
|
| 1604 | 1681 |
|
| 1682 |
#region セルクリック |
|
| 1605 | 1683 |
/// <summary> |
| 1606 | 1684 |
/// セルクリック |
| 1607 | 1685 |
/// </summary> |
| ... | ... | |
| 1611 | 1689 |
{
|
| 1612 | 1690 |
setButtonEnable(); |
| 1613 | 1691 |
} |
| 1692 |
#endregion |
|
| 1614 | 1693 |
|
| 1694 |
#region 資材解除押下 |
|
| 1615 | 1695 |
/// <summary> |
| 1616 | 1696 |
/// 資材解除押下 |
| 1617 | 1697 |
/// </summary> |
| ... | ... | |
| 1684 | 1764 |
cMi = null; |
| 1685 | 1765 |
} |
| 1686 | 1766 |
} |
| 1767 |
#endregion |
|
| 1687 | 1768 |
|
| 1769 |
#region 資材登録押下 |
|
| 1688 | 1770 |
/// <summary> |
| 1689 | 1771 |
/// 資材登録押下 |
| 1690 | 1772 |
/// </summary> |
| ... | ... | |
| 1708 | 1790 |
|
| 1709 | 1791 |
return true; |
| 1710 | 1792 |
} |
| 1711 |
#endregion |
|
| 1793 |
#endregion
|
|
| 1712 | 1794 |
|
| 1795 |
#endregion |
|
| 1713 | 1796 |
} |
| 1714 | 1797 |
} |
| branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReserveEntry/FrmMaterialReserveEntry.designer.cs | ||
|---|---|---|
| 265 | 265 |
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; |
| 266 | 266 |
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; |
| 267 | 267 |
this.dgvMaster.RowHeadersDefaultCellStyle = dataGridViewCellStyle8; |
| 268 |
this.dgvMaster.RowHeadersVisible = false; |
|
| 268 | 269 |
this.dgvMaster.RowHeadersWidth = 24; |
| 269 | 270 |
this.dgvMaster.Size = new System.Drawing.Size(1137, 229); |
| 270 | 271 |
this.dgvMaster.TabIndex = 0; |
| ... | ... | |
| 276 | 277 |
// |
| 277 | 278 |
this.Column13.HeaderText = "RowState"; |
| 278 | 279 |
this.Column13.Name = "Column13"; |
| 280 |
this.Column13.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
| 279 | 281 |
this.Column13.Visible = false; |
| 280 | 282 |
// |
| 281 | 283 |
// Column1 |
| ... | ... | |
| 294 | 296 |
// |
| 295 | 297 |
this.Column11.HeaderText = "種類コード"; |
| 296 | 298 |
this.Column11.Name = "Column11"; |
| 299 |
this.Column11.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
| 297 | 300 |
this.Column11.Visible = false; |
| 298 | 301 |
// |
| 299 | 302 |
// Column2 |
| ... | ... | |
| 306 | 309 |
this.Column2.HeaderText = "種類"; |
| 307 | 310 |
this.Column2.Name = "Column2"; |
| 308 | 311 |
this.Column2.ReadOnly = true; |
| 312 |
this.Column2.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
| 309 | 313 |
this.Column2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; |
| 310 | 314 |
this.Column2.Width = 180; |
| 311 | 315 |
// |
| ... | ... | |
| 313 | 317 |
// |
| 314 | 318 |
this.Column9.HeaderText = "種類表示"; |
| 315 | 319 |
this.Column9.Name = "Column9"; |
| 320 |
this.Column9.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
| 316 | 321 |
this.Column9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; |
| 317 | 322 |
this.Column9.Visible = false; |
| 318 | 323 |
// |
| ... | ... | |
| 320 | 325 |
// |
| 321 | 326 |
this.Column8.HeaderText = "品目コード"; |
| 322 | 327 |
this.Column8.Name = "Column8"; |
| 328 |
this.Column8.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
| 323 | 329 |
this.Column8.Visible = false; |
| 324 | 330 |
// |
| 325 | 331 |
// Column3 |
| ... | ... | |
| 338 | 344 |
// |
| 339 | 345 |
this.Column10.HeaderText = "品目表示"; |
| 340 | 346 |
this.Column10.Name = "Column10"; |
| 347 |
this.Column10.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
| 341 | 348 |
this.Column10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic; |
| 342 | 349 |
this.Column10.Visible = false; |
| 343 | 350 |
// |
| ... | ... | |
| 368 | 375 |
// |
| 369 | 376 |
this.Column12.HeaderText = "変更前貸出数"; |
| 370 | 377 |
this.Column12.Name = "Column12"; |
| 378 |
this.Column12.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
| 371 | 379 |
this.Column12.Visible = false; |
| 372 | 380 |
// |
| 373 | 381 |
// Column6 |
| branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReturnEntry/FrmMaterialReturnEntry.cs | ||
|---|---|---|
| 40 | 40 |
#endregion |
| 41 | 41 |
|
| 42 | 42 |
#region 定数 |
| 43 |
#region 表示カラム |
|
| 43 | 44 |
/// <summary> |
| 44 | 45 |
/// 表示カラム |
| 45 | 46 |
/// </summary> |
| ... | ... | |
| 55 | 56 |
RentCount, |
| 56 | 57 |
RepayCount, |
| 57 | 58 |
MaterialCount, |
| 59 |
MaterialDumpCount, |
|
| 58 | 60 |
MaterialCountBefore, |
| 59 | 61 |
CommentText, |
| 60 | 62 |
} |
| 63 |
#endregion |
|
| 61 | 64 |
|
| 65 |
#region enum |
|
| 62 | 66 |
private enum DataColumn |
| 63 | 67 |
{
|
| 64 | 68 |
MaterialKindCode = 0, |
| ... | ... | |
| 73 | 77 |
CommentText, |
| 74 | 78 |
CompleteFlg, |
| 75 | 79 |
} |
| 80 |
#endregion |
|
| 76 | 81 |
|
| 82 |
#region マスタリストMAXライン |
|
| 77 | 83 |
/// <summary> |
| 78 | 84 |
/// マスタリストMAXライン |
| 79 | 85 |
/// </summary> |
| 80 | 86 |
private const int s_ListMaxLineCount = 53; |
| 81 | 87 |
#endregion |
| 88 |
#endregion |
|
| 82 | 89 |
|
| 83 | 90 |
#region 変数 |
| 91 |
#region フィールド値変化フラグ |
|
| 84 | 92 |
/// <summary> |
| 85 | 93 |
/// フィールド値変化フラグ |
| 86 | 94 |
/// </summary> |
| 87 | 95 |
private bool m_bChengeAns = false; |
| 96 |
#endregion |
|
| 88 | 97 |
|
| 98 |
#region ダイアログ使用フラグ |
|
| 89 | 99 |
/// <summary> |
| 90 | 100 |
/// ダイアログ使用フラグ |
| 91 | 101 |
/// </summary> |
| 92 | 102 |
private bool m_DialogFlg = false; |
| 103 |
#endregion |
|
| 104 |
|
|
| 105 |
#region 工事番号 |
|
| 93 | 106 |
/// <summary> |
| 94 | 107 |
/// 工事番号 |
| 95 | 108 |
/// </summary> |
| 96 | 109 |
private int m_ConstructionCode = 0; |
| 110 |
#endregion |
|
| 111 |
|
|
| 112 |
#region 終了ボタン押下フラグ |
|
| 97 | 113 |
/// <summary> |
| 98 | 114 |
/// 終了ボタン押下フラグ |
| 99 | 115 |
/// </summary> |
| 100 | 116 |
private bool m_EndButton = false; |
| 117 |
#endregion |
|
| 118 |
|
|
| 119 |
#region 参照フラグ |
|
| 101 | 120 |
/// <summary> |
| 102 | 121 |
/// 参照フラグ |
| 103 | 122 |
/// </summary> |
| 104 | 123 |
private bool m_EditLock = false; |
| 124 |
#endregion |
|
| 105 | 125 |
|
| 106 |
// *-----* 共通処理設定 *-----* |
|
| 126 |
#region *-----* 共通処理設定 *-----* |
|
| 127 |
#region サブフォームフラグ |
|
| 107 | 128 |
/// <summary> |
| 108 | 129 |
/// サブフォームフラグ |
| 109 | 130 |
/// </summary> |
| 110 | 131 |
private bool m_SubForm = false; |
| 132 |
#endregion |
|
| 133 |
|
|
| 134 |
#region 呼出元終了フラグ |
|
| 111 | 135 |
/// <summary> |
| 112 | 136 |
/// 呼出元終了フラグ |
| 113 | 137 |
/// </summary> |
| 114 | 138 |
private bool m_ParentEnd = false; |
| 139 |
#endregion |
|
| 140 |
#endregion// *-----* 共通処理設定 *-----* |
|
| 115 | 141 |
|
| 116 |
// *-----* 共通処理設定 *-----* |
|
| 117 |
|
|
| 118 | 142 |
private bool m_CloseingProcessOn = false; |
| 119 | 143 |
|
| 120 | 144 |
#endregion |
| ... | ... | |
| 125 | 149 |
InitializeComponent(); |
| 126 | 150 |
} |
| 127 | 151 |
#endregion |
| 152 |
|
|
| 128 | 153 |
#region デストラクタ |
| 129 | 154 |
~FrmMaterialReturnEntry() |
| 130 | 155 |
{
|
| ... | ... | |
| 139 | 164 |
} |
| 140 | 165 |
#endregion |
| 141 | 166 |
|
| 142 |
|
|
| 143 | 167 |
#region プロパティ |
| 168 |
#region ダイアログ使用時フラグ |
|
| 144 | 169 |
/// <summary> |
| 145 | 170 |
/// ダイアログ使用時フラグ |
| 146 | 171 |
/// </summary> |
| ... | ... | |
| 148 | 173 |
{
|
| 149 | 174 |
set { m_DialogFlg = value; }
|
| 150 | 175 |
} |
| 176 |
#endregion |
|
| 177 |
|
|
| 178 |
#region 工事番号 |
|
| 151 | 179 |
/// <summary> |
| 152 | 180 |
/// 工事番号 |
| 153 | 181 |
/// </summary> |
| ... | ... | |
| 157 | 185 |
set { m_ConstructionCode = value; }
|
| 158 | 186 |
|
| 159 | 187 |
} |
| 188 |
#endregion |
|
| 189 |
|
|
| 190 |
#region 参照フラグ |
|
| 160 | 191 |
/// <summary> |
| 161 | 192 |
/// 参照フラグ |
| 162 | 193 |
/// </summary> |
| ... | ... | |
| 165 | 196 |
get { return m_EditLock; }
|
| 166 | 197 |
set { m_EditLock = value; }
|
| 167 | 198 |
} |
| 199 |
#endregion |
|
| 168 | 200 |
|
| 169 |
// *-----* 共通処理設定 *-----*
|
|
| 201 |
#region *-----* 共通処理設定 *-----*
|
|
| 170 | 202 |
/// <summary> |
| 171 | 203 |
/// サブフォームフラグ |
| 172 | 204 |
/// </summary> |
| ... | ... | |
| 175 | 207 |
get { return m_SubForm; }
|
| 176 | 208 |
set { m_SubForm = value; }
|
| 177 | 209 |
} |
| 210 |
|
|
| 211 |
#region 呼出元終了フラグ |
|
| 178 | 212 |
/// <summary> |
| 179 | 213 |
/// 呼出元終了フラグ |
| 180 | 214 |
/// </summary> |
| ... | ... | |
| 183 | 217 |
get { return m_ParentEnd; }
|
| 184 | 218 |
set { m_ParentEnd = value; }
|
| 185 | 219 |
} |
| 186 |
// *-----* 共通処理設定 *-----* |
|
| 187 |
|
|
| 188 | 220 |
#endregion |
| 221 |
//*-----* 共通処理設定 *-----* |
|
| 222 |
#endregion |
|
| 223 |
#endregion |
|
| 189 | 224 |
|
| 190 |
|
|
| 191 | 225 |
#region イベントメソッド |
| 226 |
#region ×ボタン押下処理 |
|
| 192 | 227 |
/// <summary> |
| 193 | 228 |
/// ×ボタン押下処理 |
| 194 | 229 |
/// </summary> |
| ... | ... | |
| 209 | 244 |
// 前プロセスに戻る |
| 210 | 245 |
ClsExcute.BackProcess(); |
| 211 | 246 |
} |
| 247 |
#endregion |
|
| 212 | 248 |
|
| 249 |
#region 終了ボタン押下 |
|
| 213 | 250 |
/// <summary> |
| 214 | 251 |
/// 終了ボタン押下 |
| 215 | 252 |
/// </summary> |
| ... | ... | |
| 219 | 256 |
{
|
| 220 | 257 |
this.Close(); |
| 221 | 258 |
} |
| 259 |
#endregion |
|
| 222 | 260 |
|
| 261 |
#region フォームロード |
|
| 223 | 262 |
/// <summary> |
| 224 | 263 |
/// フォームロード |
| 225 | 264 |
/// </summary> |
| ... | ... | |
| 248 | 287 |
// フォームサイズ固定 |
| 249 | 288 |
this.MaximizedBounds = new Rectangle(this.Left, this.Top, this.Width, this.Height); |
| 250 | 289 |
|
| 290 |
// ヘッダーの高さを固定 |
|
| 291 |
dgvMaster.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; |
|
| 292 |
|
|
| 293 |
|
|
| 251 | 294 |
// ボタン表示の制御 |
| 252 | 295 |
ButtonVisble(this); |
| 253 | 296 |
|
| ... | ... | |
| 256 | 299 |
// *-----* 処理移動ボタン設定 *-----* |
| 257 | 300 |
|
| 258 | 301 |
} |
| 302 |
#endregion |
|
| 259 | 303 |
|
| 304 |
#region 行データクリア |
|
| 260 | 305 |
/// <summary> |
| 261 | 306 |
/// 行データクリア |
| 262 | 307 |
/// </summary> |
| ... | ... | |
| 265 | 310 |
{
|
| 266 | 311 |
// クリアデータセット |
| 267 | 312 |
} |
| 313 |
#endregion |
|
| 268 | 314 |
|
| 315 |
#region グリッド採番処理 |
|
| 269 | 316 |
/// <summary> |
| 270 | 317 |
/// グリッド採番処理 |
| 271 | 318 |
/// </summary> |
| ... | ... | |
| 281 | 328 |
r.Cells[(int)DispColumn.DisplayOrder].Value = "0"; |
| 282 | 329 |
} |
| 283 | 330 |
} |
| 331 |
#endregion |
|
| 284 | 332 |
|
| 333 |
#region 行追加ボタン押下 |
|
| 285 | 334 |
/// <summary> |
| 286 | 335 |
/// 行追加ボタン押下 |
| 287 | 336 |
/// </summary> |
| ... | ... | |
| 360 | 409 |
//dgvMaster.FirstDisplayedScrollingRowIndex = iIndex; |
| 361 | 410 |
//dgvMaster.CurrentCell = dgvMaster[0, iIndex]; |
| 362 | 411 |
} |
| 412 |
#endregion |
|
| 363 | 413 |
|
| 414 |
#region フィールド値変更フラグ |
|
| 364 | 415 |
/// <summary> |
| 365 | 416 |
/// フィールド値変更フラグ |
| 366 | 417 |
/// </summary> |
| ... | ... | |
| 370 | 421 |
{
|
| 371 | 422 |
m_bChengeAns = true; |
| 372 | 423 |
} |
| 424 |
#endregion |
|
| 373 | 425 |
|
| 426 |
#region セル値変化 |
|
| 374 | 427 |
/// <summary> |
| 375 | 428 |
/// セル値変化 |
| 376 | 429 |
/// </summary> |
| ... | ... | |
| 384 | 437 |
// 変更フラグON |
| 385 | 438 |
m_bChengeAns = true; |
| 386 | 439 |
} |
| 440 |
#endregion |
|
| 387 | 441 |
|
| 442 |
#region 登録ボタン押下 |
|
| 388 | 443 |
/// <summary> |
| 389 | 444 |
/// 登録ボタン押下 |
| 390 | 445 |
/// </summary> |
| ... | ... | |
| 398 | 453 |
if (!DispFeildCheck()) return; |
| 399 | 454 |
|
| 400 | 455 |
// 確認 |
| 401 |
if (tglAllReturn.Checked) |
|
| 402 |
{
|
|
| 403 |
if (MessageBox.Show("返却されていない資材は、資材から削除されます。完了してよろしいですか?", "登録確認"
|
|
| 404 |
, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return; |
|
| 405 |
} |
|
| 406 |
else |
|
| 407 |
{
|
|
| 456 |
//if (tglAllReturn.Checked)
|
|
| 457 |
//{
|
|
| 458 |
// if (MessageBox.Show("返却されていない資材は、資材から削除されます。完了してよろしいですか?", "登録確認"
|
|
| 459 |
// , MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return;
|
|
| 460 |
//}
|
|
| 461 |
//else
|
|
| 462 |
//{
|
|
| 408 | 463 |
if (MessageBox.Show("表示中のデータを登録します。", "登録確認"
|
| 409 |
, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return; |
|
| 410 |
} |
|
| 464 |
, MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) |
|
| 465 |
{
|
|
| 466 |
return; |
|
| 467 |
} |
|
| 468 |
//} |
|
| 411 | 469 |
|
| 412 | 470 |
//// 表示行退避 |
| 413 | 471 |
//int iIndex = dgvMaster.FirstDisplayedScrollingRowIndex; |
| ... | ... | |
| 427 | 485 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
| 428 | 486 |
} |
| 429 | 487 |
} |
| 488 |
#endregion |
|
| 430 | 489 |
|
| 490 |
#region IMEのコントロール |
|
| 431 | 491 |
/// <summary> |
| 432 | 492 |
/// IMEのコントロール |
| 433 | 493 |
/// </summary> |
| ... | ... | |
| 456 | 516 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
| 457 | 517 |
} |
| 458 | 518 |
} |
| 519 |
#endregion |
|
| 459 | 520 |
|
| 521 |
#region セルクリック |
|
| 460 | 522 |
/// <summary> |
| 461 | 523 |
/// セルクリック |
| 462 | 524 |
/// </summary> |
| ... | ... | |
| 466 | 528 |
{
|
| 467 | 529 |
dgvMaster_CellDoubleClick(sender, e); |
| 468 | 530 |
} |
| 531 |
#endregion |
|
| 469 | 532 |
|
| 533 |
#region セルダブルクリック |
|
| 470 | 534 |
/// <summary> |
| 471 | 535 |
/// セルダブルクリック |
| 472 | 536 |
/// </summary> |
| ... | ... | |
| 481 | 545 |
|
| 482 | 546 |
btnEnd_Click(sender, (EventArgs)e); |
| 483 | 547 |
} |
| 548 |
#endregion |
|
| 484 | 549 |
|
| 550 |
#region Formキーダウン処理 |
|
| 485 | 551 |
/// <summary> |
| 486 | 552 |
/// Formキーダウン処理 |
| 487 | 553 |
/// </summary> |
| ... | ... | |
| 495 | 561 |
return; |
| 496 | 562 |
} |
| 497 | 563 |
} |
| 564 |
#endregion |
|
| 498 | 565 |
|
| 499 | 566 |
#endregion |
| 500 | 567 |
|
| 501 | 568 |
#region プライベートメソッド |
| 569 |
#region 初期表示処理 |
|
| 502 | 570 |
/// <summary> |
| 503 | 571 |
/// 初期表示処理 |
| 504 | 572 |
/// </summary> |
| ... | ... | |
| 509 | 577 |
|
| 510 | 578 |
try |
| 511 | 579 |
{
|
| 512 |
// テスト用工事番号 |
|
| 513 |
//ConstructionCode = 2016020201; |
|
| 514 |
|
|
| 515 | 580 |
// 画面表示用データ取得 |
| 516 | 581 |
if (!IoConB.SelectAction(string.Format(" where ConstructionCode = {0} and DETAILNO = 2", ConstructionCode), ref ConB)) return;
|
| 517 | 582 |
|
| ... | ... | |
| 524 | 589 |
lblRepaydate.Text = DateTime.Now.Date.ToString("yyyy/MM/dd");
|
| 525 | 590 |
|
| 526 | 591 |
if (!DispGridData()) return; |
| 527 |
|
|
| 528 |
|
|
| 529 | 592 |
} |
| 530 | 593 |
catch (Exception ex) |
| 531 | 594 |
{
|
| 532 | 595 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
| 533 | 596 |
} |
| 534 | 597 |
} |
| 598 |
#endregion |
|
| 535 | 599 |
|
| 600 |
#region 画面項目のチェック |
|
| 536 | 601 |
/// <summary> |
| 537 | 602 |
/// 画面項目のチェック |
| 538 | 603 |
/// </summary> |
| ... | ... | |
| 548 | 613 |
foreach (DataGridViewRow r in dgvMaster.Rows) |
| 549 | 614 |
{
|
| 550 | 615 |
|
| 551 |
// 割当数<返却済+返却数の場合は、エラー |
|
| 552 |
if (CommonMotions.cnvInt(r.Cells[(int)DispColumn.RentCount].Value) < CommonMotions.cnvInt(r.Cells[(int)DispColumn.RepayCount].Value) + CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value)) |
|
| 616 |
// 割当数<返却済+返却数+破棄数の場合は、エラー |
|
| 617 |
if (CommonMotions.cnvInt(r.Cells[(int)DispColumn.RentCount].Value) < |
|
| 618 |
CommonMotions.cnvInt(r.Cells[(int)DispColumn.RepayCount].Value) |
|
| 619 |
+ CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialCount].Value) |
|
| 620 |
+ CommonMotions.cnvInt(r.Cells[(int)DispColumn.MaterialDumpCount].Value)) |
|
| 553 | 621 |
{
|
| 554 | 622 |
bAns = false; |
| 555 |
sError = "貸出した資材数を超えて資材の返却はできません。"; |
|
| 623 |
sError = "貸出した資材数を超えて資材の返却・破棄はできません。";
|
|
| 556 | 624 |
// 背景色変更 |
| 557 | 625 |
CommonMotions.chgBackColor(r.Cells[(int)DispColumn.MaterialCount], bAns); |
| 558 | 626 |
} |
| 559 | 627 |
|
| 560 | 628 |
Regex regex = new Regex(@"^[0-9]+$"); |
| 561 |
Match match = regex.Match(r.Cells[(int)DispColumn.MaterialCount].Value.ToString()); |
|
| 562 |
if (!match.Success) |
|
| 629 |
Match matchC = regex.Match(r.Cells[(int)DispColumn.MaterialCount].Value.ToString()); |
|
| 630 |
Match matchDC = regex.Match(r.Cells[(int)DispColumn.MaterialDumpCount].Value.ToString()); |
|
| 631 |
|
|
| 632 |
if (!matchC.Success && !matchDC.Success) |
|
| 563 | 633 |
{
|
| 564 | 634 |
bAns = false; |
| 565 |
sError = "1以上の整数を入力してください。";
|
|
| 635 |
sError = "返却数か破棄数には整数値を入力してください。";
|
|
| 566 | 636 |
CommonMotions.chgBackColor(r.Cells[(int)DispColumn.MaterialCount], bAns); |
| 567 | 637 |
} |
| 568 | 638 |
|
| ... | ... | |
| 595 | 665 |
return false; |
| 596 | 666 |
} |
| 597 | 667 |
} |
他の形式にエクスポート: Unified diff