Esempio n. 1
0
 public void SetClient(SelectionWell sw, Objecte obj = null)
 {
     if (sw == null)
     {
         return;
     }
     client = Helpers.LogicHelper.ClientsLogic.FirstModel(sw.GetIDValue(C.SelectionWell.Well, C.Well.Object, C.Objecte.Client));
     if (obj == null)
     {
         objecte = client.Objects.FirstOrDefault(x => AdresHelper.ComparisonAdres(x.Adres, Adres) || Acount.Split(',').FirstOrDefault(y => x.Accounts.Contains(y)) != null);
     }
     else
     {
         objecte = obj;
     }
     if (objecte != null)
     {
         List <string> ac = new List <string>();
         foreach (var one in Acount.Split(','))
         {
             if (!objecte.Accounts.Contains(one))
             {
                 ac.Add(one);
             }
         }
         if (ac.Count > 0)
         {
             objecte.SetAccounts(ac.ToArray());
         }
         sample = Helpers.LogicHelper.SampleLogic.FirstModel(sw.SampleID);
     }
 }
        private void LoadTitle(SelectionWell selectionWell)
        {
            Substitute = new CellExchange_Class(sheet);
            Accredit accredit = AdditionnTable.GetAccredit();

            Substitute.AddExchange(mark.acred, $"{accredit.Text}\nВыдан {accredit.YMDFrom}", 0);
            Worker work = AdditionnTable.GetSigner(data.ETypeTemplate.Protocol, "Протокол");

            Substitute.AddExchange(mark.fio_nac, work.FIO, 0);
            Substitute.AddExchange(mark.number_prot, selectionWell.FormatNumber, 0);
            Substitute.AddExchange(mark.abon, selectionWell.Objecte.Client.Detail.FullName, 0);
            Substitute.AddExchange(mark.yr_adr, Helpers.LogicHelper.AdresLogic.FirstModel(selectionWell.Objecte.Client.Detail.AdresLegalID).Adr.CutAdres(false), 0);
            Substitute.AddExchange(mark.type_well, G.TypeWell.Rows.Get <string>(selectionWell.Well.TypeWellID, C.TypeWell.FullName), 0);
            Substitute.AddExchange(mark.select_adr, selectionWell.Objecte.Adres.CutAdres(false), 0);
            Substitute.AddExchange(mark.date_select, MyTools.StringDate_From_YMDHMS(selectionWell.YMDHM, MyTools.EInputDate.YMDHM, MyTools.EInputDate.YMD), 0);
            Substitute.AddExchange(mark.time_select, MyTools.StringDate_From_YMDHMS(selectionWell.YMDHM, MyTools.EInputDate.YMDHM, MyTools.EInputDate.YMDHM), 0);
            Substitute.AddExchange(mark.repres, new Representative(selectionWell.Sample.RepresentativeID).Post_FIO, 0);
            Substitute.AddExchange(mark.year, DateControl_Class.SelectYear, 0);
            MonthYear();
            NumberFolder(_selectionWells.Select(x => x.Objecte.NumberFolder).ToArray());
            work = AdditionnTable.GetSigner(data.ETypeTemplate.Protocol, "Протокол");
            Substitute.AddExchange(mark.fio, work.FIO, 0);
            Substitute.AddExchange(mark.job, work.Post, 0);
            int day, month;

            MyTools.Y_M_D_From_YMD(StaticDate.SelectDate, out month, out month, out day);
            Substitute.AddExchange(mark.day, day, 0);
            Substitute.AddExchange(mark.month, MyTools.Month_From_M_C_R(month, Reg: MyTools.ERegistor.ToLower), 0);
            Substitute.AddExchange(mark._month, month.ToString("00"), 0);
            Substitute.Exchange();
        }
Esempio n. 3
0
 public fromMessage(SelectionWell selectionWell)
 {
     this.SelectionWell = selectionWell;
     volume             = new List <Volume>();
     _644 = null;
     _621 = null;
 }
Esempio n. 4
0
 public Compare(string UniqueKey, decimal Wes, decimal Become, SelectionWell sw)
 {
     this.UniqueKey = UniqueKey;
     this.Wes       = Wes;
     this.Become    = Become;
     this.sw        = sw;
     Select         = true;
 }
Esempio n. 5
0
 public Item(SelectionWell sw)
 {
     client     = Helpers.LogicHelper.ClientsLogic.FirstModel(sw.GetIDValue(C.SelectionWell.Well, C.Well.Object, C.Objecte.Client));
     NameClient = client.Detail.FullName.StringDivision(30);
     INN        = client.INN;
     objecte    = sw.Objecte;
     Adres      = objecte.Adres;
     sample     = sw.Sample;
 }
        private void LoadTable(SelectionWell selectionWell)
        {
            CreateStyle();
            IRow Row = SearchRowFromMark(sheet, mark.table);

            MyTools.C_TableExcel table = new MyTools.C_TableExcel(Row.RowNum, 0, Styles.s_RLTB_CC_T10_W);
            table.columns.Add(columns.number);
            table.columns.Add(columns.pollution);
            table.columns.Add(columns.unit);

            int colResolution = 3;

            foreach (var one in PollutionBase_Class.AllResolution)
            {
                table.value.Add(new MyTools.C_ValueCell(one.GetResolutionClarify.FullName, 0, colResolution));
                if (colResolution > 3)
                {
                    table.columns.Add(new MyTools.C_ColumnExcel(string.Empty, colResolution, 10));
                }
                colResolution++;
            }
            table.MinRowHeight.Add(1, 1800);
            table.columns.Add(new MyTools.C_ColumnExcel("Нормативные показатели", 3, 10, 0, colResolution - 4));
            table.columns.Add(columns.result);
            table.columns.Add(columns.method);

            var values = selectionWell.ValueSelections.OrderBy(x => x.Pollution.Number).ToArray();
            int row    = 1;

            foreach (var one in values)
            {
                table.value.Add(new MyTools.C_ValueCell(row, row, 0));
                table.value.Add(new MyTools.C_ValueCell(one.Pollution.FullName, row, 1, 0, 0, Styles.s_RLTB_LC_T10_W));
                table.value.Add(new MyTools.C_ValueCell(AdditionnTable.AllUnits.First(x => x.ID == one.Pollution.UnitsID).Name, row, 2));
                colResolution = 3;
                foreach (var res in PollutionBase_Class.AllResolution)
                {
                    var val = PollutionBase_Class.AllValueNorm.FirstOrDefault(x => x.PollutionID == one.Pollution.ID && x.ResolutionID == res.ID);
                    if (val != null)
                    {
                        table.value.Add(new MyTools.C_ValueCell($"{(val.From > 0 ? $"{val.FromRound}-{val.ToRound}" : val.ToRound.ToString())}", row, colResolution));
                    }
                    colResolution++;
                }
                table.value.Add(new MyTools.C_ValueCell(Calc(one), row, 5));
                table.value.Add(new MyTools.C_ValueCell(one.Pollution.Method, row, 6, 0, 0, Styles.s_RLTB_LC_T9_W));
                row++;
            }

            CreateTable(sheet, table);
            ResizeWidth(sheet, MyTools.ETypeFormatBook.My, table, 25400);
            ResizeHeight(sheet, table);
        }
Esempio n. 7
0
            public SHOW(
                SelectionWell selectionWell,
                KeyValuePair <string, decimal>[] summs,
                ValueWork[] Values)
            {
                this.SelectionWell = selectionWell;
                this.summs         = summs;
                this.Values        = Values;

                result = new Dictionary <string, string>();
                result.Add(ThisColumn.Number, Number);
                result.Add(ThisColumn.Company, Company);
                result.Add(ThisColumn.Status, Status);
                result.Add(ThisColumn.DateTime, DateTime);
            }
        public EditValue_Window(SelectionWell selectionWell)
        {
            InitializeComponent();
            this.GetSetting();
            this.selectionWell = selectionWell;
            this.obj           = selectionWell.Objecte;
            this.CanEdit       = data.User <bool>(C.User.CanRedact);
            SFE = new MyTools.C_SettingFromRowEdit(MyTools.EPosition.Vertical, true, -1, true, false, true);
            DrawObject();
            ShowAct.IsEnabled = CanEdit;

            DrawColumns();
            DrawValue();

            LoadAct();
        }
Esempio n. 9
0
        private SelectionWell[] LoadSample(uint[] IDObj)
        {
            var querry = G.SelectionWell.QUERRY()
                         .SHOW
                         .WHERE
                         .ID(0);

            foreach (var one in IDObj)
            {
                querry.OR.ARC(C.SelectionWell.Well, C.Well.Object).EQUI.BV(one);
            }
            querry.DO();
            SelectionWell[] result = new SelectionWell[G.SelectionWell.Rows.Count];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = Logic.LogicInstances.SelectionWellLogic.FirstOrDefault(G.SelectionWell.Rows.GetID(i));
            }
            return(result.GroupBy(x => x.ObjectID).Select(x => x.OrderBy(y => y.YMDHM).Last()).ToArray());
        }
Esempio n. 10
0
        /// <summary>Отрисовка таблицы</summary>
        public void CreateTable(ICell cell, SelectionWell selectionWell)
        {
            table = CreateColumn(cell);

            for (int i = 1; i < 16; i++)
            {
                table.value.Add(new MyTools.C_ValueCell(i, 1, i - 1));
            }

            table.value.Add(new MyTools.C_ValueCell("мг / л", 0, 6));
            table.value.Add(new MyTools.C_ValueCell("мг / л", 0, 7));
            table.value.Add(new MyTools.C_ValueCell("мг / л", 0, 10));
            table.value.Add(new MyTools.C_ValueCell("тонн", 0, 8));
            table.value.Add(new MyTools.C_ValueCell("тонн", 0, 9));
            table.value.Add(new MyTools.C_ValueCell("тонн", 0, 11));

            ValueSelection[] valueSelections = selectionWell.ValueSelections.Where(x => x.Value > 0).ToArray();

            table.value.Add(new MyTools.C_ValueCell(MyTools.StringDate_From_YMDHMS(selectionWell.YMDHM, MyTools.EInputDate.YMDHM, MyTools.EInputDate.YMD), 2, 0, valueSelections.Length - 1));
            MonthVolume = obj.GetMidMonthVolume(DateControl_Class.SelectYear - 1).Volume;
            table.value.Add(new MyTools.C_ValueCell(MonthVolume, 2, 1, valueSelections.Length - 1));
            int row = 2;

            Declaration declair = selectionWell.Well.Declaration;

            foreach (var valueSelection in valueSelections)
            {
                Pollution pollution = valueSelection.Pollution;
                table.value.Add(new MyTools.C_ValueCell(pollution.FullName.TextToUpper().StringDivision(4), row, 2, style: Styles.s_RLTB_LC_T10_W));
                if (pollution.Key > 0)
                {
                    table.value.Add(new MyTools.C_ValueCell(pollution.Key, row, 3));
                }
                table.value.Add(new MyTools.C_ValueCell(valueSelection.ValueRound.KillZero(), row, 4));
                table.value.Add(new MyTools.C_ValueCell(((decimal)MonthVolume * valueSelection.Value).ToMath(6, 4, 1), row, 5, style: Styles.s_RLTB_RC_T10_W));
                table.value.AddRange(GetResolution(valueSelection, "621", row, 6, 8, 12));
                table.value.AddRange(GetResolution(valueSelection, "644", row, 7, 9, 13));

                DeclarationValue declarationValue = declair != null?declair.DeclarationValues.FirstOrDefault(x => x.PollutionID == pollution.ID) : null;

                if (declarationValue != null)
                {
                    decimal result = 0;
                    if (pollution.HasRange)
                    {
                        table.value.Add(new MyTools.C_ValueCell($"{declarationValue.FromRound.KillZero()}-{declarationValue.ToRound.KillZero()}", row, 10));
                    }
                    else
                    {
                        table.value.Add(new MyTools.C_ValueCell(declarationValue.ToRound.KillZero(), row, 10));
                        result = (decimal)MonthVolume * declarationValue.To;
                        if (result > 0)
                        {
                            table.value.Add(new MyTools.C_ValueCell(result.ToMath(6, 4, 1), row, 11, style: Styles.s_RLTB_RC_T10_W));
                        }
                        result = Math.Round(valueSelection.Value / declarationValue.To, 1);
                        if (result > 1)
                        {
                            table.value.Add(new MyTools.C_ValueCell(result.ToMoney(null, 1), row, 14));
                        }
                    }
                }
                row++;
            }

            CreateTable(cell.Sheet, table);
            ResizeWidth(cell.Sheet, MyTools.ETypeFormatBook.Horizontal, table);
            ResizeHeight(cell.Sheet, table);
        }
Esempio n. 11
0
 public ThisWell(SelectionWell selectionWell, IValue[] Values)
 {
     this._selectionWell = selectionWell;
     this.Values = Values;
 }
Esempio n. 12
0
 protected void WellNumber(SelectionWell sw)
 {
     Substitute.AddExchange(StaticMark.well, sw.Well.PresentNumber, 1);
 }
Esempio n. 13
0
 static PollutionBase_Class()
 {
     ListSelectionWell = new SelectionWell[0];
 }