556 |
556 |
private void FrmRequestSummaryList_Load(object sender, EventArgs e)
|
557 |
557 |
{
|
558 |
558 |
// ?S??????F?????
|
559 |
|
// TODO
|
560 |
559 |
if (ClsExcute.ProcControlPara.Count > 0)
|
561 |
560 |
{
|
562 |
|
for (int i = 0; i < ClsExcute.ProcControlPara.Count; i++)
|
|
561 |
if (ClsExcute.ProcControlPara.Count > 0)
|
563 |
562 |
{
|
564 |
|
if ((ClsExcute.ProcControlPara[i].ArrayParameter != null)
|
565 |
|
&& (ClsExcute.ProcControlPara[i].ArrayParameter.Count > 0))
|
|
563 |
if ((ClsExcute.ProcControlPara[ClsExcute.ProcControlPara.Count -1].ArrayParameter != null)
|
|
564 |
&& (ClsExcute.ProcControlPara[ClsExcute.ProcControlPara.Count - 1].ArrayParameter.Count > 0))
|
566 |
565 |
{
|
567 |
|
ArrayList obj = ClsExcute.ProcControlPara[i].ArrayParameter[0];
|
|
566 |
ArrayList obj = ClsExcute.ProcControlPara[ClsExcute.ProcControlPara.Count - 1].ArrayParameter[0];
|
568 |
567 |
m_PaInfo = (PaymentApprovalInfo)obj[0];
|
569 |
568 |
if (m_PaInfo is PaymentApprovalInfo != true)
|
570 |
569 |
{
|
... | ... | |
868 |
867 |
sql.AppendLine("select Am.APPROVALPERSON,Picm.SealPrintName,Am.ApprovalAuthority ");
|
869 |
868 |
sql.AppendLine("from ApprovalMaster as Am left join PersonInChargeMaster as Picm on Am.APPROVALPERSON = Picm.PERSONCODE ");
|
870 |
869 |
// ApprovalListNo ??R?[?h???????
|
871 |
|
// TODO
|
872 |
|
//sql.AppendLine("where Am.APPROVALCODE = 99 ");
|
873 |
870 |
int iApprovalCode = ClsExcute.AppovalList.First(x => x.Value.Equals(s_MyProcessName[m_Labourkind])).Key;
|
874 |
871 |
sql.AppendFormat("where Am.APPROVALCODE = {0} ", iApprovalCode);
|
875 |
872 |
sql.AppendFormat("and Am.DepartmentCode = {0} ", DepartmentCode);
|
... | ... | |
3262 |
3259 |
}
|
3263 |
3260 |
#endregion
|
3264 |
3261 |
|
3265 |
|
// TODO ?i???g?p?H?j??
|
3266 |
|
#region DataGridView_CellDoubleClick
|
3267 |
|
/// <summary>
|
3268 |
|
/// DataGridView_CellDoubleClick
|
3269 |
|
/// </summary>
|
3270 |
|
/// <param name="sender"></param>
|
3271 |
|
/// <param name="e"></param>
|
3272 |
|
private void DataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
3273 |
|
{
|
3274 |
|
DataGridView dgv = (DataGridView)sender;
|
3275 |
|
|
3276 |
|
if (e.RowIndex < 0) return;
|
3277 |
|
|
3278 |
|
GoukeiRows TargetRowtype = (GoukeiRows)dgv[(int)DispColumn.RowType, e.RowIndex].Value;
|
3279 |
|
int ShoninEndCol = 0;
|
3280 |
|
|
3281 |
|
//??I???F??m?F
|
3282 |
|
bool bApprovalAuthority = false;
|
3283 |
|
for(int i = (int)DispColumn.Shonin1Authority; i <= (int)DispColumn.Shonin10Authority; i+=5)
|
3284 |
|
{
|
3285 |
|
//??I???F??t???O???????????A??????O?C??????????F??????\??
|
3286 |
|
if(CommonMotions.cnvInt(dgv[i, e.RowIndex].Value)==1)
|
3287 |
|
{
|
3288 |
|
if (CommonMotions.cnvInt(dgv[i - 3, e.RowIndex].Value) == CommonMotions.LoginUserData.PersonCode)
|
3289 |
|
{
|
3290 |
|
bApprovalAuthority = true;
|
3291 |
|
}
|
3292 |
|
}
|
3293 |
|
}
|
3294 |
|
|
3295 |
|
// ??I???F????????s??????????(??I???F????\)
|
3296 |
|
if (CommonMotions.cnvInt(dgv[(int)DispColumn.ApprovalEndFlg, e.RowIndex].Value) == 1 && dgv.Rows[e.RowIndex].ReadOnly == true && !bApprovalAuthority)
|
3297 |
|
{
|
3298 |
|
return;
|
3299 |
|
}
|
3300 |
|
|
3301 |
|
if (e.ColumnIndex == m_GenbaNM_Column)
|
3302 |
|
{
|
3303 |
|
// ????????H???????????N??????
|
3304 |
|
try
|
3305 |
|
{
|
3306 |
|
if (CommonMotions.cnvInt(dgv.Rows[e.RowIndex].Cells[m_Genba_Column].Value) != 0)
|
3307 |
|
{
|
3308 |
|
if (m_FrmLedger != null)
|
3309 |
|
{
|
3310 |
|
MessageBox.Show("?H??????????????N????????????B?H???????????I??????A??x???????_?u???N???b?N???????????", "???N???m?F"
|
3311 |
|
, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
3312 |
|
return;
|
3313 |
|
}
|
3314 |
|
m_FrmLedger = new FrmConstructionLedger();
|
3315 |
|
m_FrmLedger.FrmRequestSummaryList = this;
|
3316 |
|
m_FrmLedger.BillingProc = true;
|
3317 |
|
m_FrmLedger.ConstructionCode = CommonMotions.cnvInt(dgv.Rows[e.RowIndex].Cells[m_Genba_Column].Value);
|
3318 |
|
m_FrmLedger.AddingRequestPrice = CommonMotions.cnvInt(dgv.Rows[e.RowIndex].Cells[(int)DispColumn.KojiSeikyu].Value);
|
3319 |
|
m_FrmLedger.Show();
|
3320 |
|
}
|
3321 |
|
}
|
3322 |
|
catch (Exception ex)
|
3323 |
|
{
|
3324 |
|
logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message);
|
3325 |
|
}
|
3326 |
|
|
3327 |
|
}
|
3328 |
|
else if (e.ColumnIndex >= (int)DispColumn.TantoShonin && e.ColumnIndex < (int)DispColumn.Bikou && TargetRowtype == 0)
|
3329 |
|
{
|
3330 |
|
// ???F??
|
3331 |
|
// ???F??????????????????????????
|
3332 |
|
if (CommonMotions.cnvString(dgv[e.ColumnIndex, e.RowIndex].Value) == "")
|
3333 |
|
{
|
3334 |
|
return;
|
3335 |
|
}
|
3336 |
|
|
3337 |
|
|
3338 |
|
// ???g????I???F???????????i?O??????A???F?R?[?h?A???F???A???F???t?A???F?????A???F?????????????j
|
3339 |
|
int iColumn = (int)DispColumn.Shonin1Code;
|
3340 |
|
bool bLastShonin = false;
|
3341 |
|
while (CommonMotions.cnvInt(dgv.CurrentRow.Cells[iColumn].Value) != 0 || iColumn >= (int)DispColumn.Bikou)
|
3342 |
|
{
|
3343 |
|
iColumn += 5;
|
3344 |
|
}
|
3345 |
|
iColumn -= 5;
|
3346 |
|
ShoninEndCol = iColumn + 1;
|
3347 |
|
if (CommonMotions.LoginUserData.PersonCode == CommonMotions.cnvInt(dgv.CurrentRow.Cells[iColumn].Value))
|
3348 |
|
{
|
3349 |
|
bLastShonin = true;
|
3350 |
|
}
|
3351 |
|
|
3352 |
|
// ??I???F???????A??????F?\???l?????????
|
3353 |
|
if (bLastShonin == false && CommonMotions.cnvInt(dgv[e.ColumnIndex - 1, e.RowIndex].Value) != CommonMotions.LoginUserData.PersonCode)
|
3354 |
|
{
|
3355 |
|
return;
|
3356 |
|
}
|
3357 |
|
|
3358 |
|
int GoukeiRowIndex = SearchRowIndex(m_GoukeiCode_Column, CommonMotions.cnvInt(dgv.CurrentRow.Cells[m_GoukeiCode_Column].Value), GoukeiRows.???v);
|
3359 |
|
dgv.CurrentRow.Cells[m_GenbaNM_Column].Style.BackColor = Color.Empty;
|
3360 |
|
dgv.CurrentRow.Cells[(int)DispColumn.CyuumonshoTouchaku].Style.BackColor = Color.Empty;
|
3361 |
|
dgv.CurrentRow.Cells[(int)DispColumn.YosanSho].Style.BackColor = Color.Empty;
|
3362 |
|
dgv.Rows[GoukeiRowIndex].DefaultCellStyle.BackColor = Color.Yellow;
|
3363 |
|
|
3364 |
|
if (dgv[e.ColumnIndex, e.RowIndex].Style.ForeColor != Color.Gray)
|
3365 |
|
{
|
3366 |
|
// ???F ?? ?????F
|
3367 |
|
DateTime dtCheck;
|
3368 |
|
string sCheck = "";
|
3369 |
|
// ??i???F????????????
|
3370 |
|
if (e.ColumnIndex == (int)DispColumn.TantoShonin)
|
3371 |
|
{
|
3372 |
|
//???F??P?????F?w?????????m?F
|
3373 |
|
if(CommonMotions.cnvInt(dgv[(int)DispColumn.Shonin1Code, e.RowIndex].Value)!=0 && dgv[(int)DispColumn.Shonin1, e.RowIndex].Style.ForeColor != Color.Gray)
|
3374 |
|
{
|
3375 |
|
return;
|
3376 |
|
}
|
3377 |
|
|
3378 |
|
//??????F???????????????m?F
|
3379 |
|
for (int iCol = ((int)DispColumn.Shonin1Date) ; iCol <= (int)DispColumn.Shonin10Date; iCol += 5)
|
3380 |
|
{
|
3381 |
|
dtCheck = CommonMotions.cnvDate(dgv[iCol, e.RowIndex].Value);
|
3382 |
|
sCheck = dtCheck.ToString("yyyy/MM/dd");
|
3383 |
|
if (sCheck != "0001/01/01" && sCheck != "2001/01/01")
|
3384 |
|
{
|
3385 |
|
return;
|
3386 |
|
}
|
3387 |
|
}
|
3388 |
|
|
3389 |
|
}
|
3390 |
|
else
|
3391 |
|
{
|
3392 |
|
for (int iCol = (e.ColumnIndex + 1) + 5; iCol <= (int)DispColumn.Shonin10Date; iCol += 5)
|
3393 |
|
{
|
3394 |
|
dtCheck = CommonMotions.cnvDate(dgv[iCol, e.RowIndex].Value);
|
3395 |
|
sCheck = dtCheck.ToString("yyyy/MM/dd");
|
3396 |
|
if (sCheck != "0001/01/01" && sCheck != "2001/01/01")
|
3397 |
|
{
|
3398 |
|
return;
|
3399 |
|
}
|
3400 |
|
}
|
3401 |
|
}
|
3402 |
|
|
3403 |
|
|
3404 |
|
// ?G???[?`?F?b?N
|
3405 |
|
// ??i????F????????????X??s??????@???????K?v
|
3406 |
|
// ??I???F???
|
3407 |
|
if (e.ColumnIndex == ShoninEndCol)
|
3408 |
|
{
|
3409 |
|
dgv[(int)DispColumn.ApprovalEndFlg, e.RowIndex].Value = 0;
|
3410 |
|
}
|
3411 |
|
|
3412 |
|
|
3413 |
|
dgv[e.ColumnIndex, e.RowIndex].Style.ForeColor = Color.Gray;
|
3414 |
|
}
|
3415 |
|
else
|
3416 |
|
{
|
3417 |
|
// ?????F ?? ???F
|
3418 |
|
|
3419 |
|
// ?G???[?`?F?b?N
|
3420 |
|
// ?S??????F?????
|
3421 |
|
if (e.ColumnIndex == (int)DispColumn.TantoShonin
|
3422 |
|
|| (e.ColumnIndex != (int)DispColumn.TantoShonin && bLastShonin == true))
|
3423 |
|
{
|
3424 |
|
if (CommonMotions.cnvInt(dgv[m_Genba_Column, e.RowIndex].Value) == 0)
|
3425 |
|
{
|
3426 |
|
MessageBox.Show("????????????????B", "???F?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
3427 |
|
dgv.CurrentRow.Cells[m_GenbaNM_Column].Style.BackColor = Color.Red;
|
3428 |
|
|
3429 |
|
return;
|
3430 |
|
}
|
3431 |
|
if (CommonMotions.cnvString(dgv[(int)DispColumn.CyuumonshoTeisyutu, e.RowIndex].Value) == "??"
|
3432 |
|
&& CommonMotions.cnvString(dgv[(int)DispColumn.CyuumonshoTouchaku, e.RowIndex].Value) == "?~")
|
3433 |
|
{
|
3434 |
|
MessageBox.Show("??????????????????????B?????????????????B", "???F?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
3435 |
|
dgv.CurrentRow.Cells[(int)DispColumn.CyuumonshoTouchaku].Style.BackColor = Color.Red;
|
3436 |
|
return;
|
3437 |
|
}
|
3438 |
|
if (CommonMotions.cnvString(dgv[(int)DispColumn.YosanSho, e.RowIndex].Value) == "?~")
|
3439 |
|
{
|
3440 |
|
MessageBox.Show("?H???\?Z???????F???????????B", "???F?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
3441 |
|
dgv.CurrentRow.Cells[(int)DispColumn.YosanSho].Style.BackColor = Color.Red;
|
3442 |
|
return;
|
3443 |
|
}
|
3444 |
|
}
|
3445 |
|
|
3446 |
|
// ?????F?`?F?b?N
|
3447 |
|
if (e.ColumnIndex == (int)DispColumn.Shonin1 || e.ColumnIndex == (int)DispColumn.Shonin2
|
3448 |
|
|| e.ColumnIndex == (int)DispColumn.Shonin3 || e.ColumnIndex == (int)DispColumn.Shonin4
|
3449 |
|
|| e.ColumnIndex == (int)DispColumn.Shonin5 || e.ColumnIndex == (int)DispColumn.Shonin6
|
3450 |
|
|| e.ColumnIndex == (int)DispColumn.Shonin7 || e.ColumnIndex == (int)DispColumn.Shonin8
|
3451 |
|
|| e.ColumnIndex == (int)DispColumn.Shonin9 || e.ColumnIndex == (int)DispColumn.Shonin10)
|
3452 |
|
{
|
3453 |
|
string sCheck = "";
|
3454 |
|
DateTime dtCheck;
|
3455 |
|
|
3456 |
|
// ??I???F???O
|
3457 |
|
if (bLastShonin == false)
|
3458 |
|
{
|
3459 |
|
|
3460 |
|
// ?O?i????F???????????????i???t?????????????j??G???[
|
3461 |
|
for (int iCol = (e.ColumnIndex + 1) - 5; iCol >= (int)DispColumn.Shonin1Date; iCol -= 5)
|
3462 |
|
{
|
3463 |
|
dtCheck = CommonMotions.cnvDate(dgv[iCol, e.RowIndex].Value);
|
3464 |
|
sCheck = dtCheck.ToString("yyyy/MM/dd");
|
3465 |
|
if (sCheck == "0001/01/01" || sCheck == "2001/01/01")
|
3466 |
|
{
|
3467 |
|
MessageBox.Show("???O????F?????{?????????????A???F????????B", "???F?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
3468 |
|
return;
|
3469 |
|
}
|
3470 |
|
}
|
3471 |
|
|
3472 |
|
}
|
3473 |
|
|
3474 |
|
// ?S??????F????????????????G???[
|
3475 |
|
dtCheck = CommonMotions.cnvDate(dgv[(int)DispColumn.TantoDate, e.RowIndex].Value);
|
3476 |
|
sCheck = dtCheck.ToString("yyyy/MM/dd");
|
3477 |
|
if (sCheck == "0001/01/01" || sCheck == "2001/01/01")
|
3478 |
|
{
|
3479 |
|
MessageBox.Show("?S??????F?????{?????????????A???F????????B", "???F?G???[", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
3480 |
|
return;
|
3481 |
|
}
|
3482 |
|
|
3483 |
|
|
3484 |
|
|
3485 |
|
// ???????????z???v??H??????????z????v?????????G???[
|
3486 |
|
int GoukeiIndex = SearchRowIndex(m_GoukeiCode_Column, CommonMotions.cnvInt(dgv.CurrentRow.Cells[m_GoukeiCode_Column].Value), GoukeiRows.???v);
|
3487 |
|
if (CommonMotions.cnvInt(dgv.Rows[GoukeiIndex].Cells[(int)DispColumn.SomuSeikyu].Value) != CommonMotions.cnvInt(dgv.Rows[GoukeiIndex].Cells[(int)DispColumn.KojiSeikyu].Value))
|
3488 |
|
{
|
3489 |
|
dgv.Rows[GoukeiRowIndex].DefaultCellStyle.BackColor = Color.Red;
|
3490 |
|
if (System.Windows.Forms.DialogResult.No == MessageBox.Show("???????z????v????????????i?????????????H", "???F?G???[", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation))
|
3491 |
|
return;
|
3492 |
|
}
|
3493 |
|
|
3494 |
|
// ??I???F???
|
3495 |
|
if (e.ColumnIndex == ShoninEndCol)
|
3496 |
|
{
|
3497 |
|
dgv[(int)DispColumn.ApprovalEndFlg, e.RowIndex].Value = 1;
|
3498 |
|
}
|
3499 |
|
|
3500 |
|
}
|
3501 |
|
|
3502 |
|
dgv[e.ColumnIndex, e.RowIndex].Style.ForeColor = SystemColors.ControlText;
|
3503 |
|
|
3504 |
|
m_bChengeAns = true;
|
3505 |
|
}
|
3506 |
|
}
|
3507 |
|
}
|
3508 |
|
#endregion
|
3509 |
|
|
3510 |
3262 |
#region ?f?[?^??????
|
3511 |
3263 |
/// <summary>
|
3512 |
3264 |
/// ?f?[?^??????
|