示例#1
0
        private void gvLabour_RowUpdated(object sender, RowObjectEventArgs e)
        {
            if (gvLabour.IsNewItemRow(e.RowHandle))
            {
                DataRowView row = e.Row as DataRowView;
                row[colId.FieldName] = LabourTimeEntry.SqlInsert(_headerRecord.Id, (int)row[colEmpNum.FieldName], ConvertEx.ToNullable <int>(row[colChangeOrder.FieldName]),
                                                                 ConvertEx.ToNullable <int>(row[colLevel1Code.FieldName]), ConvertEx.ToNullable <int>(row[colLevel2Code.FieldName]), ConvertEx.ToNullable <int>(row[colLevel3Code.FieldName]), ConvertEx.ToNullable <int>(row[colLevel4Code.FieldName]),
                                                                 (bool)row[colBillable.FieldName], (bool)row[colManual.FieldName], (string)row[colWorkClass.FieldName], ConvertEx.ToNullable <decimal>(row[colIncludedHours.FieldName]),
                                                                 ConvertEx.ToNullable <decimal>(row[colTotalHours.FieldName]), ConvertEx.ToNullable <decimal>(row[colBillAmount.FieldName]));

                foreach (var timeCode in TimeCode.SubList(EnumValueType.Hours))
                {
                    LabourTimeDetail.SqlInsert((int)row[colId.FieldName], timeCode.MatchId, ConvertEx.ToNullable <decimal>(row[BillRateI(timeCode)]), ConvertEx.ToNullable <decimal>(row[EnterHoursI(timeCode)]), null);
                }

                foreach (var timeCode in TimeCode.SubList(EnumValueType.Dollars))
                {
                    LabourTimeDetail.SqlInsert((int)row[colId.FieldName], timeCode.MatchId, null, null, ConvertEx.ToNullable <decimal>(row[EnterAmountI(timeCode)]));
                }

                LemHeader.SqlUpdateSubmitStatus(_headerRecord.Id, EnumSubmitStatus.Open);
            }
        }