コード例 #1
0
        private List <ParametrStendList> loadParSTList(string NStend)
        {
            List <ParametrStendList> PSL = new List <ParametrStendList>();

            using (l2l3interactionEntities dbContext = new l2l3interactionEntities())
            {
                var list = dbContext.DiagramToRollAVO.Where(p => p.StendNumber == NStend && p.Agregat == "AVO5")
                           .OrderBy(p => p.UtcDateTime).ToList();
                int _id = 0;

                string _strL_r1 = "";
                string _strL_r2 = "";
                string _strL_r3 = "";
                string _strL_r4 = "";
                string _strL_r5 = "";
                string _strL_r6 = "";

                string _strExtr_r1 = "";
                string _strExtr_r2 = "";
                string _strExtr_r3 = "";
                string _strExtr_r4 = "";
                string _strExtr_r5 = "";
                string _strExtr_r6 = "";

                string _strTexture_r1 = "";
                string _strTexture_r2 = "";
                string _strTexture_r3 = "";
                string _strTexture_r4 = "";
                string _strTexture_r5 = "";
                string _strTexture_r6 = "";

                string _strP1750_r1 = "";
                string _strP1750_r2 = "";
                string _strP1750_r3 = "";
                string _strP1750_r4 = "";
                string _strP1750_r5 = "";
                string _strP1750_r6 = "";

                string _strB800_r1 = "";
                string _strB800_r2 = "";
                string _strB800_r3 = "";
                string _strB800_r4 = "";
                string _strB800_r5 = "";
                string _strB800_r6 = "";

                for (int i = 0; i <= list.Count() - 1; i++)
                {
                    PSL.Add(new ParametrStendList
                    {
                        id           = _id++,
                        RollNumber   = list.ElementAt(i).RollNumber,
                        StendNumber  = list.ElementAt(i).StendNumber,
                        NInStend     = list.ElementAt(i).NInStend,
                        UtcDateTime  = list.ElementAt(i).UtcDateTime,
                        p_ln         = (decimal)list.ElementAt(i).ln,
                        p_speed      = (decimal)list.ElementAt(i).p_speed,
                        p_extract    = (decimal)list.ElementAt(i).p_extract,
                        p_P1750      = (decimal)list.ElementAt(i).p_P1750,
                        p_B800       = (decimal)list.ElementAt(i).p_B800,
                        p_ILH        = (decimal)list.ElementAt(i).p_ILH,
                        p_ILL        = (decimal)list.ElementAt(i).p_ILH,
                        p_IRH        = (decimal)list.ElementAt(i).p_ILH,
                        p_IRL        = (decimal)list.ElementAt(i).p_ILH,
                        p_Texture    = (decimal)list.ElementAt(i).p_texture,
                        p_TLH        = (decimal)list.ElementAt(i).p_TLH,
                        p_TLL        = (decimal)list.ElementAt(i).p_TLH,
                        p_TRH        = (decimal)list.ElementAt(i).p_TLH,
                        p_TRL        = (decimal)list.ElementAt(i).p_TLH,
                        p_TehP_right = (decimal)list.ElementAt(i).p_TehP_righ,
                        p_TehP_left  = (decimal)list.ElementAt(i).p_TehP_left
                    });


                    switch (list.ElementAt(i).NInStend)
                    {
                    case "1": _strL_r1 = _strL_r1 + list.ElementAt(i).ln.ToString() + ";";
                        _strExtr_r1    = _strExtr_r1 + list.ElementAt(i).p_extract.ToString() + ";";
                        _strTexture_r1 = _strTexture_r1 + list.ElementAt(i).p_texture.ToString() + ";";
                        _strP1750_r1   = _strP1750_r1 + list.ElementAt(i).p_P1750.ToString() + ";";
                        _strB800_r1    = _strB800_r1 + list.ElementAt(i).p_B800.ToString() + ";";
                        break;

                    case "2": _strL_r2 = _strL_r2 + list.ElementAt(i).ln.ToString() + ";";
                        _strExtr_r2    = _strExtr_r2 + list.ElementAt(i).p_extract.ToString() + ";";
                        _strTexture_r2 = _strTexture_r2 + list.ElementAt(i).p_texture.ToString() + ";";
                        _strP1750_r2   = _strP1750_r2 + list.ElementAt(i).p_P1750.ToString() + ";";
                        _strB800_r2    = _strB800_r2 + list.ElementAt(i).p_B800.ToString() + ";";
                        break;

                    case "3": _strL_r3 = _strL_r3 + list.ElementAt(i).ln.ToString() + ";";
                        _strExtr_r3    = _strExtr_r3 + list.ElementAt(i).p_extract.ToString() + ";";
                        _strTexture_r3 = _strTexture_r3 + list.ElementAt(i).p_texture.ToString() + ";";
                        _strP1750_r3   = _strP1750_r3 + list.ElementAt(i).p_P1750.ToString() + ";";
                        _strB800_r3    = _strB800_r3 + list.ElementAt(i).p_B800.ToString() + ";";
                        break;

                    case "4": _strL_r4 = _strL_r4 + list.ElementAt(i).ln.ToString() + ";";
                        _strExtr_r4    = _strExtr_r4 + list.ElementAt(i).p_extract.ToString() + ";";
                        _strTexture_r4 = _strTexture_r4 + list.ElementAt(i).p_texture.ToString() + ";";
                        _strP1750_r4   = _strP1750_r4 + list.ElementAt(i).p_P1750.ToString() + ";";
                        _strB800_r4    = _strB800_r4 + list.ElementAt(i).p_B800.ToString() + ";";
                        break;

                    case "5": _strL_r5 = _strL_r5 + list.ElementAt(i).ln.ToString() + ";";
                        _strExtr_r5    = _strExtr_r5 + list.ElementAt(i).p_extract.ToString() + ";";
                        _strTexture_r5 = _strTexture_r5 + list.ElementAt(i).p_texture.ToString() + ";";
                        _strP1750_r5   = _strP1750_r5 + list.ElementAt(i).p_P1750.ToString() + ";";
                        _strB800_r5    = _strB800_r5 + list.ElementAt(i).p_B800.ToString() + ";";
                        break;

                    case "6": _strL_r6 = _strL_r6 + list.ElementAt(i).ln.ToString() + ";";
                        _strExtr_r6    = _strExtr_r6 + list.ElementAt(i).p_extract.ToString() + ";";
                        _strTexture_r6 = _strTexture_r6 + list.ElementAt(i).p_texture.ToString() + ";";
                        _strP1750_r6   = _strP1750_r6 + list.ElementAt(i).p_P1750.ToString() + ";";
                        _strB800_r6    = _strB800_r6 + list.ElementAt(i).p_B800.ToString() + ";";
                        break;
                    }
                }
                ViewBag.StrL_r1 = _strL_r1;
                ViewBag.StrL_r2 = _strL_r2;
                ViewBag.StrL_r3 = _strL_r3;
                ViewBag.StrL_r4 = _strL_r4;
                ViewBag.StrL_r5 = _strL_r5;
                ViewBag.StrL_r6 = _strL_r6;

                ViewBag.StrExtr_r1 = _strExtr_r1.Replace(",", ".");
                ViewBag.StrExtr_r2 = _strExtr_r2.Replace(",", ".");
                ViewBag.StrExtr_r3 = _strExtr_r3.Replace(",", ".");
                ViewBag.StrExtr_r4 = _strExtr_r4.Replace(",", ".");
                ViewBag.StrExtr_r5 = _strExtr_r5.Replace(",", ".");
                ViewBag.StrExtr_r6 = _strExtr_r6.Replace(",", ".");

                ViewBag.StrTexture_r1 = _strTexture_r1.Replace(",", ".");
                ViewBag.StrTexture_r2 = _strTexture_r2.Replace(",", ".");
                ViewBag.StrTexture_r3 = _strTexture_r3.Replace(",", ".");
                ViewBag.StrTexture_r4 = _strTexture_r4.Replace(",", ".");
                ViewBag.StrTexture_r5 = _strTexture_r5.Replace(",", ".");
                ViewBag.StrTexture_r6 = _strTexture_r6.Replace(",", ".");

                ViewBag.StrP1750_r1 = _strP1750_r1.Replace(",", ".");
                ViewBag.StrP1750_r2 = _strP1750_r2.Replace(",", ".");
                ViewBag.StrP1750_r3 = _strP1750_r3.Replace(",", ".");
                ViewBag.StrP1750_r4 = _strP1750_r4.Replace(",", ".");
                ViewBag.StrP1750_r5 = _strP1750_r5.Replace(",", ".");
                ViewBag.StrP1750_r6 = _strP1750_r6.Replace(",", ".");

                ViewBag.StrB800_r1 = _strB800_r1.Replace(",", ".");
                ViewBag.StrB800_r2 = _strB800_r2.Replace(",", ".");
                ViewBag.StrB800_r3 = _strB800_r3.Replace(",", ".");
                ViewBag.StrB800_r4 = _strB800_r4.Replace(",", ".");
                ViewBag.StrB800_r5 = _strB800_r5.Replace(",", ".");
                ViewBag.StrB800_r6 = _strB800_r6.Replace(",", ".");
            }

            return(PSL);
        }
コード例 #2
0
        private bool testEnebledRoll(List <StendList> listStend)
        {
            try
            {
                using (l2l3interactionEntities dbContext = new l2l3interactionEntities())
                {
                    for (int i = 0; i <= listStend.Count() - 1; i++)
                    {
                        string   _NRoll          = listStend.ElementAt(i).NRoll;
                        string   _NStend         = listStend.ElementAt(i).NStend;
                        string   _NInStend       = listStend.ElementAt(i).NInStend;
                        DateTime _DateCreate     = listStend.ElementAt(i).DateCreate;
                        DateTime _DateProduction = listStend.ElementAt(i).DateProduction;

                        var cntD = dbContext.DiagramToRollAVO.Where(p => p.RollNumber == _NRoll && p.Agregat == "AVO5").Count();

                        if (cntD == 0)
                        {
                            var crGlDiagr = dbContext.sp_TransportDiagramsAVO5(_NRoll,
                                                                               _NStend,
                                                                               _NInStend,
                                                                               _DateCreate,
                                                                               _DateProduction);

                            cntD = dbContext.DiagramToRollAVO.Where(p => p.RollNumber == _NRoll && p.Agregat == "AVO5").Count();
                        }

                        decimal _SKORP1750      = SKORoll(listStend.ElementAt(i).NRoll, "P1750");
                        decimal UstavkaP1750    = Convert.ToDecimal(0.05);
                        decimal UstavkaB800     = Convert.ToDecimal(0.05);
                        string  _colorTextP1750 = "";
                        string  _colorTextB800  = "";

                        if (_SKORP1750 <= 0)
                        {
                            _colorTextP1750 = "text-danger";
                        }
                        else if (_SKORP1750 > UstavkaP1750)
                        {
                            _colorTextP1750 = "text-warning";
                        }

                        decimal _SKORB800 = SKORoll(listStend.ElementAt(i).NRoll, "B800");
                        if (_SKORB800 <= 0)
                        {
                            _colorTextB800 = "text-danger";
                        }
                        else if (_SKORB800 > UstavkaB800)
                        {
                            _colorTextB800 = "text-warning";
                        }

                        switch (_NInStend)
                        {
                        case "1": @ViewBag.NRoll1 = listStend.ElementAt(i).NRoll; @ViewBag.DataRoll1 = "; длина(м.): " +
                                                                                                       listStend.ElementAt(i).Length.ToString().Remove(listStend.ElementAt(i).Length.ToString().IndexOf(".")) + "; вес(кг.): " +
                                                                                                       listStend.ElementAt(i).Weight.ToString().Remove(listStend.ElementAt(i).Weight.ToString().IndexOf(".")) + "; СКО P1750: " +
                                                                                                       _SKORP1750 + "; СКО B800: " +
                                                                                                       _SKORB800;
                            @ViewBag.SKO_P1750_1   = _SKORP1750;
                            @ViewBag.SKO_B800_1    = _SKORB800;
                            @ViewBag.colorP1750_r1 = _colorTextP1750;
                            @ViewBag.colorB800_r1  = _colorTextB800;
                            break;

                        case "2": @ViewBag.NRoll2 = listStend.ElementAt(i).NRoll; @ViewBag.DataRoll2 = "; длина(м.): " +
                                                                                                       listStend.ElementAt(i).Length.ToString().Remove(listStend.ElementAt(i).Length.ToString().IndexOf(".")) + "; вес(кг.): " +
                                                                                                       listStend.ElementAt(i).Weight.ToString().Remove(listStend.ElementAt(i).Weight.ToString().IndexOf(".")) + "; СКО P1750: " +
                                                                                                       _SKORP1750 + "; СКО B800: " +
                                                                                                       _SKORB800;
                            @ViewBag.SKO_P1750_2   = _SKORP1750;
                            @ViewBag.SKO_B800_2    = _SKORB800;
                            @ViewBag.colorP1750_r2 = _colorTextP1750;
                            @ViewBag.colorB800_r2  = _colorTextB800;
                            break;

                        case "3": @ViewBag.NRoll3 = listStend.ElementAt(i).NRoll; @ViewBag.DataRoll3 = "; длина(м.): " +
                                                                                                       listStend.ElementAt(i).Length.ToString().Remove(listStend.ElementAt(i).Length.ToString().IndexOf(".")) + "; вес(кг.): " +
                                                                                                       listStend.ElementAt(i).Weight.ToString().Remove(listStend.ElementAt(i).Weight.ToString().IndexOf(".")) + "; СКО P1750: " +
                                                                                                       _SKORP1750 + "; СКО B800: " +
                                                                                                       _SKORB800;
                            @ViewBag.SKO_P1750_3   = _SKORP1750;
                            @ViewBag.SKO_B800_3    = _SKORB800;
                            @ViewBag.colorP1750_r3 = _colorTextP1750;
                            @ViewBag.colorB800_r3  = _colorTextB800;
                            break;

                        case "4": @ViewBag.NRoll4 = listStend.ElementAt(i).NRoll; @ViewBag.DataRoll4 = "; длина(м.): " +
                                                                                                       listStend.ElementAt(i).Length.ToString().Remove(listStend.ElementAt(i).Length.ToString().IndexOf(".")) + "; вес(кг.): " +
                                                                                                       listStend.ElementAt(i).Weight.ToString().Remove(listStend.ElementAt(i).Weight.ToString().IndexOf(".")) + "; СКО P1750: " +
                                                                                                       _SKORP1750 + "; СКО B800: " +
                                                                                                       _SKORB800;
                            @ViewBag.SKO_P1750_4   = _SKORP1750;
                            @ViewBag.SKO_B800_4    = _SKORB800;
                            @ViewBag.colorP1750_r4 = _colorTextP1750;
                            @ViewBag.colorB800_r4  = _colorTextB800;
                            break;

                        case "5": @ViewBag.NRoll5 = listStend.ElementAt(i).NRoll; @ViewBag.DataRoll5 = "; длина(м.): " +
                                                                                                       listStend.ElementAt(i).Length.ToString().Remove(listStend.ElementAt(i).Length.ToString().IndexOf(".")) + "; вес(кг.): " +
                                                                                                       listStend.ElementAt(i).Weight.ToString().Remove(listStend.ElementAt(i).Weight.ToString().IndexOf(".")) + "; СКО P1750: " +
                                                                                                       _SKORP1750 + "; СКО B800: " +
                                                                                                       _SKORB800;
                            @ViewBag.SKO_P1750_5   = _SKORP1750;
                            @ViewBag.SKO_B800_5    = _SKORB800;
                            @ViewBag.colorP1750_r5 = _colorTextP1750;
                            @ViewBag.colorB800_r5  = _colorTextB800;
                            break;

                        case "6": @ViewBag.NRoll6 = listStend.ElementAt(i).NRoll; @ViewBag.DataRoll6 = "; длина(м.): " +
                                                                                                       listStend.ElementAt(i).Length.ToString().Remove(listStend.ElementAt(i).Length.ToString().IndexOf(".")) + "; вес(кг.): " +
                                                                                                       listStend.ElementAt(i).Weight.ToString().Remove(listStend.ElementAt(i).Weight.ToString().IndexOf(".")) + "; СКО P1750: " +
                                                                                                       _SKORP1750 + "; СКО B800: " +
                                                                                                       _SKORB800;
                            @ViewBag.SKO_P1750_6   = _SKORP1750;
                            @ViewBag.SKO_B800_6    = _SKORB800;
                            @ViewBag.colorP1750_r6 = _colorTextP1750;
                            @ViewBag.colorB800_r6  = _colorTextB800;
                            break;
                        }
                    }
                }

                return(true);
            }
            catch
            {
                return(false);
            }
        }
コード例 #3
0
        private List <ParametrList> LoadParametrs(List <StartFinish> DT)
        {
            List <ParametrList> ListParam = new List <ParametrList>();

            using (l2l3interactionEntities dbContext = new l2l3interactionEntities())
            {
                ListParam = dbContext.sp_WebP_LoadAVO3Parametrs(DT.ElementAt(0).DateStart, DT.ElementAt(0).DateFinish).
                            OrderBy(p => p.Length).
                            Select(p => new ParametrList()
                {
                    UtcDateTime = (DateTime)p.UtcDateTime,
                    Length      = (decimal)p.Length,
                    Speed       = (decimal)p.Speed,
                    Extract     = (decimal)p.Extract,
                    P1750       = (decimal)p.P1750,
                    B800        = (decimal)p.B800,  //Индукция
                    ILH         = (decimal)p.ILH,
                    ILL         = (decimal)p.ILL,
                    IRH         = (decimal)p.IRH,
                    IRL         = (decimal)p.IRL,
                    Texture     = (decimal)p.Texture,
                    TLH         = (decimal)p.TLH,
                    TLL         = (decimal)p.TLL,
                    TRH         = (decimal)p.TRH,
                    TRL         = (decimal)p.TRL,
                    TehP_right  = (decimal)p.TehP_right,
                    TehP_left   = (decimal)p.TehP_left
                }).ToList();
            }

            List <ParametrList> NewListParam = new List <ParametrList>();

            if (ListParam.Count >= 1)
            {
                decimal startLength = ListParam.ElementAt(0).Length;
                decimal realLength  = ListParam.ElementAt(0).Length;

                for (int i = 1; i <= ListParam.Count - 2; i++)
                {
                    if (realLength < ListParam.ElementAt(i).Length)
                    {
                        NewListParam.Add(new ParametrList
                        {
                            UtcDateTime = ListParam.ElementAt(i).UtcDateTime,
                            Length      = ListParam.ElementAt(i).Length,
                            Speed       = ListParam.ElementAt(i).Speed,
                            Extract     = ListParam.ElementAt(i).Extract,
                            P1750       = ListParam.ElementAt(i).P1750,
                            B800        = ListParam.ElementAt(i).B800, //Индукция
                            ILH         = ListParam.ElementAt(i).ILH,
                            ILL         = ListParam.ElementAt(i).ILL,
                            IRH         = ListParam.ElementAt(i).IRH,
                            IRL         = ListParam.ElementAt(i).IRL,
                            Texture     = ListParam.ElementAt(i).Texture,
                            TLH         = ListParam.ElementAt(i).TLH,
                            TLL         = ListParam.ElementAt(i).TLL,
                            TRH         = ListParam.ElementAt(i).TRH,
                            TRL         = ListParam.ElementAt(i).TRL,
                            TehP_right  = ListParam.ElementAt(i).TehP_right,
                            TehP_left   = ListParam.ElementAt(i).TehP_left
                        });

                        realLength = ListParam.ElementAt(i).Length;
                    }
                }
            }

            return(NewListParam);
        }