public static void FilldtNormViewer(int seriaFrom, int seriaTo, int infProdChipher, ref TrudoyomkostDBDataSet.LabourNormDataTable dttemp, bool timeInHours, ref NormTotal normTotalbyTheJob, ref NormTotal normTotalbyTheTime)
        {
            var tempResult = from labourNorm in FillTrudoyomkostDB.CurrentLabourNormList
                             join whereOpeationUse in FillTrudoyomkostDB.WhereOperationUseList on labourNorm.ID
                                 equals whereOpeationUse.LabourNormID
                             where
                                 whereOpeationUse.InfProductsChipher == infProdChipher &&
                                 ((whereOpeationUse.SeriaFrom == seriaFrom && seriaFrom <= whereOpeationUse.SeriaTo) || (whereOpeationUse.SeriaFrom <= seriaFrom && whereOpeationUse.SeriaTo >= seriaFrom))

                             select labourNorm

                                 into allInfo
                                 orderby allInfo.OperNum
                                 select allInfo;

            dttemp.Clear();
            normTotalbyTheJob.Clear();
            normTotalbyTheTime.Clear();
            normTotalbyTheTime.ValuatePrTimeSum = 0;
            normTotalbyTheJob.ValuatePrTimeSum = 0;

            foreach (var item in tempResult)
            {

                DataRow rowdttemp = dttemp.NewRow();
                rowdttemp[0] = item.ID;
                rowdttemp[1] = item.InfDetID;
                rowdttemp[2] = item.OperNum;
                rowdttemp[3] = item.DepRegion;
                rowdttemp[8] = item.WorkerRate;
                rowdttemp[6] = item.TariffNetNum;
                rowdttemp[7] = item.KindPay;
                rowdttemp[4] = item.ProfCode;
                rowdttemp[5] = item.NameKindWork;
                rowdttemp[9] = (timeInHours) ? (Decimal)item.ItemCTN : (Decimal)Math.Round((item.ItemCTN * 60), TrudoyomkostSettings.RoundNum);
                rowdttemp[10] = (timeInHours) ? (Decimal)item.PreparTimeCTN : (Decimal)Math.Round(item.PreparTimeCTN * 60, TrudoyomkostSettings.RoundNum);
                rowdttemp[11] = (timeInHours) ? (Decimal)item.ItemPayNorm : (Decimal)Math.Round(item.ItemPayNorm * 60, TrudoyomkostSettings.RoundNum);
                rowdttemp[12] = (timeInHours) ? (Decimal)item.PreparTimePayNorm : (Decimal)Math.Round((item.PreparTimePayNorm * 60), TrudoyomkostSettings.RoundNum);
                rowdttemp[13] = item.Valuation;
                rowdttemp[14] = item.ValPreparTime;
                rowdttemp[15] = Math.Round(item.CoeffCTN, TrudoyomkostSettings.RoundNum);
                rowdttemp[16] = item.DocNum;
                rowdttemp[17] = item.Date;
                rowdttemp[18] = item.TaskNumber;
                dttemp.Rows.Add(rowdttemp);
                if (item.ProfCode != 2322 && item.ProfCode != 2351)
                {
                    if (item.KindPay.Equals("С") || item.KindPay.Equals("C"))
                    {
                        normTotalbyTheJob.ItemCTNSum += item.ItemCTN;
                        normTotalbyTheJob.PrTimeCTNSum += item.PreparTimeCTN;
                        normTotalbyTheJob.ItemPaySum += item.ItemPayNorm;
                        normTotalbyTheJob.ValuateSum += item.Valuation;
                        normTotalbyTheJob.PrTimePaySum += item.PreparTimePayNorm;
                        normTotalbyTheJob.ValuatePrTimeSum += item.ValPreparTime;

                    }
                    else
                    {
                        normTotalbyTheTime.ItemCTNSum += item.ItemCTN;
                        normTotalbyTheTime.PrTimeCTNSum += item.PreparTimeCTN;
                        normTotalbyTheTime.ItemPaySum += item.ItemPayNorm;
                        normTotalbyTheTime.ValuateSum += item.Valuation;
                        normTotalbyTheTime.PrTimePaySum += item.PreparTimePayNorm;
                        normTotalbyTheTime.ValuatePrTimeSum += item.ValPreparTime;
                    }
                }

            }
            normTotalbyTheJob.ReCalcInMinutes(timeInHours);
            normTotalbyTheTime.ReCalcInMinutes(timeInHours);
            normTotalbyTheJob.SetCoeff();
            normTotalbyTheTime.SetCoeff();
        }
 public static void FilldtInfProf(TrudoyomkostDBContext dbcontext, ref TrudoyomkostDBDataSet.infProfessionDataTable dtInfProff)
 {
     var tempResult = from infproff in dbcontext.InfProfession
                      select infproff;
     dtInfProff.Clear();
     foreach (var item in tempResult)
     {
         DataRow rowdttemp = dtInfProff.NewRow();
         rowdttemp[0] = item.ProfCode;
         rowdttemp[1] = item.Name;
         rowdttemp[2] = item.NameKindWork;
         rowdttemp[3] = item.LangCode;
         dtInfProff.Rows.Add(rowdttemp);
     }
 }