Beispiel #1
0
        private void btnDeletePorch_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить данные подъездов?",
                                "Подъезды",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                porchAdapter.DeleteSelectedPorch(this.currPorchID);

                if (grdPorch.CurrentRow != null)
                {
                    this.currPorchID  = (int)grdPorch.CurrentRow.Cells[0].Value;
                    lblCurrPorch.Text = this.currPorchID.ToString();

                    grdPorch.DataSource = porchAdapter.GetDataBySelectObject(this.currObjID);

                    if (grdPorch.RowCount == 0)
                    {
                        this.currPorchID = 0; //чтобы обнулить помещения
                    }

                    grdPomesch.DataSource = pomeschAdapter.GetDataBySelectedPorch(this.currPorchID);

                    ActiveAudit.CheckGrid(grdPorch);
                    ActiveAudit.CheckGrid(grdPomesch);
                }
            }
        }
Beispiel #2
0
        private void grdGFObjects_SelectionChanged(object sender, EventArgs e)
        {
            if (grdGFObjects.CurrentRow != null)
            {
                this.currObjID    = (int)grdGFObjects.CurrentRow.Cells[0].Value;
                lblCurrObjID.Text = this.currObjID.ToString();

                DataTable dt = porchAdapter.GetDataBySelectObject(this.currObjID);

                grdPorch.DataSource = dt; //   porchAdapter.GetDataBySelectObject(this.currObjID);

                if (grdPorch.CurrentRow == null)
                {
                    this.currPorchID = 0;
                }
                else
                {
                    this.currPorchID = (int)grdPorch.CurrentRow.Cells[0].Value;
                }


                grdPomesch.DataSource = pomeschAdapter.GetDataBySelectedPorch(this.currPorchID);

                grdNegil.DataSource = neGiloeAdapter.GetDataByActiveObject(this.currObjID);

                ActiveAudit.CheckGrid(grdPorch);
                ActiveAudit.CheckGrid(grdNegil);
            }
        }
Beispiel #3
0
        private void tabControl1_Selected(object sender, TabControlEventArgs e)
        {
            grdPorch.DataSource   = porchAdapter.GetDataBySelectObject(this.currObjID);
            grdPomesch.DataSource = pomeschAdapter.GetDataBySelectedPorch(this.currPorchID);

            ActiveAudit.CheckGrid(grdPorch);
            ActiveAudit.CheckGrid(grdPomesch);
        }
Beispiel #4
0
        private void btnClipBoard_Click(object sender, EventArgs e)
        {
            int cnt = 0;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string[] cliparr = ActiveAudit.GetClipBoard("//my.dom.gosuslugi.ru/organization-cabinet/#!/agreements");

                if (cliparr == null)
                {
                    return;
                }

                int      skip = 0;
                string[] z;
                //string[] data = cliparr.Skip(0).ToArray();

                string[] data = cliparr.Where(s => !s.Contains("Срок действия договора истекает")).ToArray();


                while ((z = data.Skip(skip).Take(13).ToArray()).Count() != 0)
                {
                    skip += 13;
                    cnt++;

                    dogUpravlAdapter.Insert(
                        ActiveAudit.ID,
                        ActiveAudit.ID_Company,
                        z[0],
                        z[1].Split('\t')[1],                                     //идент
                        z[2].Split('\t')[1],                                     // закл
                        z[3].Split('\t')[1],                                     // вступ
                        z[4].Split('\t')[1],                                     // срок
                        z[5].Split('\t').Length == 2 ? z[5].Split('\t')[1] : "", //статус
                        z[6].Split('\t')[1],                                     //версия
                        z[7].Split('\t')[1],                                     //основание
                        z[8].Split('\t')[1],                                     // первая
                        z[9].Split('\t')[1],                                     //вторая
                        z[12]
                        );
                }

                grdDogUpravl.DataSource = dogUpravlAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);
            }
            catch (Exception ex)
            {
                MessageBox.Show(cnt.ToString() + " -- " + ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                Clipboard.Clear();

                ActiveAudit.CheckGrid(grdDogUpravl);
            }
        }
Beispiel #5
0
        private void btnGetPomesch_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string[] clparr = ActiveAudit.GetClipBoard("//my.dom.gosuslugi.ru/organization-cabinet/#!/house/card?");
                if (clparr == null)
                {
                    return;
                }

                int selPorchId = (int)grdPorch.CurrentRow.Cells[0].Value; //временно на всякий случай

                string[] pdata = clparr.Where(s => !s.Contains("ПУ")).ToArray();

                if (pdata.Count() % 7 != 0)
                {
                    MessageBox.Show("Данные помещений скопированы некорректно.");
                    return;
                }

                int      skip = 0;
                string[] arr;

                while ((arr = pdata.Skip(skip).Take(7).ToArray()).Count() != 0)
                {
                    skip += 7;

                    pomeschAdapter.Insert(
                        selPorchId,
                        ActiveAudit.ID,
                        ActiveAudit.ID_Company,
                        arr[0].Split('№')[arr[0].Split('№').Length - 1],                 //Номер
                        arr[1].Split('\t')[arr[1].Split('\t').Length - 1],               //категория
                        arr[2].Split('\t')[arr[2].Split('\t').Length - 1].Split(' ')[0], //Общая пл-дь
                        arr[3].Split('\t')[arr[3].Split('\t').Length - 1].Split(' ')[0], //жилая пл-дь
                        arr[4].Split('\t')[arr[1].Split('\t').Length - 1],               //Кадастр
                        arr[5].Split(':')[1],                                            //хар-ка
                        arr[6].Split('\t')[1]
                        );
                }

                grdPomesch.DataSource = pomeschAdapter.GetDataBySelectedPorch(selPorchId);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Clipboard.Clear();
                Cursor.Current = Cursors.Default;
                ActiveAudit.CheckGrid(grdPomesch);
            }
        }
Beispiel #6
0
        private void btnGetSave_Click(object sender, EventArgs e)
        {
            int cnt = 0;

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string[] cliparr = ActiveAudit.GetClipBoard("//my.dom.gosuslugi.ru/organization-cabinet/#!/house/list");

                if (cliparr == null)
                {
                    return;
                }

                string[] data = cliparr.Where(o => !o.Contains("Информация об объекте") && !o.Contains("ОДПУ")).ToArray();

                int      skip = 0;
                string[] z;

                while ((z = data.Skip(skip).Take(12).ToArray()).Count() != 0)
                {
                    skip += 12;
                    cnt++;

                    gfObjectsAdapter.Insert(
                        ActiveAudit.ID,
                        ActiveAudit.ID_Company,
                        z[0],                  //адрес
                        z[1].Split('\t')[1],   //год постройки
                        z[2].Split('\t')[1],   //год ввода
                        z[3].Split('\t')[1],   //кадастр
                        z[4].Split('\t')[1],   //этажей
                        z[5].Split('\t')[1],   //состояние
                        z[6].Split('\t')[1],   //износ
                        z[7].Split('\t')[1],   //кол-во ЛС
                        z[8].Split('\t')[1],   //Кол_во помещений
                        z[9].Split('\t')[1],   //  Тип
                        z[10].Split('\t')[1],  //Общая площадь
                        z[11].Split('\t')[1]); //Общая полощ жил пом
                }
                grdGFObjects.DataSource = gfObjectsAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Clipboard.Clear();
                Cursor.Current = Cursors.Default;

                ActiveAudit.CheckGrid(grdGFObjects);
            }
        }
Beispiel #7
0
        private void grdPerRabUsl_SelectionChanged(object sender, EventArgs e)
        {
            if (grdPerRabUsl.CurrentRow != null)
            {
                this.currPerechID = (int)grdPerRabUsl.CurrentRow.Cells[0].Value;
                label1.Text       = this.currPerechID.ToString();

                grdPerRabUslDetals.DataSource = perechRabUslDetailsAdapter.GetDataBySelectedRabUsl(this.currPerechID, ActiveAudit.ID, ActiveAudit.ID_Company);

                ActiveAudit.CheckGrid(grdPerRabUslDetals);
            }
        }
Beispiel #8
0
        private void grdHouse_SelectionChanged(object sender, EventArgs e)
        {
            if (grdHouse.CurrentRow != null)
            {
                this.currHouseId     = (int)grdHouse.CurrentRow.Cells[0].Value;
                grdUslugi.DataSource = ustavUslugiAdapter.GetDataByCurrentHouse(this.currHouseId);

                ActiveAudit.CheckGrid(grdUstav);
                ActiveAudit.CheckGrid(grdHouse);
                ActiveAudit.CheckGrid(grdUslugi);
            }
        }
Beispiel #9
0
        private void btnDelObj_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить комм. и доп. услуги?",
                                "Коммунальные и дополнительные услуги",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                dogUprUslAdapter.DeleteByActiveDog(this.currDogID);
                grdUslugi.DataSource = dogUprUslAdapter.GetDataByDogovor(ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);

                ActiveAudit.CheckGrid(grdUslugi);
            }
        }
Beispiel #10
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить платежные документы?",
                                "Платежные документы",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                platDocsAdapter.DeleteByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);
                grdPlatDocs.DataSource = platDocsAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

                ActiveAudit.CheckGrid(grdPlatDocs);
            }
        }
Beispiel #11
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить справочник работ и услуг?",
                                "Справочник работ и услуг",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                dictWorkServAdapter.DeleteByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);
                grdWorkServ.DataSource = dictWorkServAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

                ActiveAudit.CheckGrid(grdWorkServ);
            }
        }
Beispiel #12
0
        private void btnDelFiles_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить прикрепленные файлы?",
                                "Прикрепленные файлы",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                dogUprFilesAdapter.DeleteByActiveDog(this.currDogID);
                grdFiles.DataSource = dogUprFilesAdapter.GetDataByActiveDog(ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);

                ActiveAudit.CheckGrid(grdFiles);
            }
        }
Beispiel #13
0
        private void btnNegilDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить данные нежилых помещений?",
                                "Нежилые помещения",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                neGiloeAdapter.DeleteByActiveObject(this.currObjID);
                grdNegil.DataSource = neGiloeAdapter.GetDataByActiveObject(this.currObjID);

                ActiveAudit.CheckGrid(grdNegil);
            }
        }
Beispiel #14
0
        private void DogUpravl_Load(object sender, EventArgs e)
        {
            dogUpravlAdapter.FillByActiveAudit(ds.DogUpravl, ActiveAudit.ID, ActiveAudit.ID_Company); //??
            dogUprUslAdapter.FillByDogovor(ds.DogUprUslugi, ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);

            grdDogUpravl.DataSource = dogUpravlAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);
            grdUslugi.DataSource    = dogUprUslAdapter.GetDataByDogovor(ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);
            grdFiles.DataSource     = dogUprFilesAdapter.GetDataByActiveDog(ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);

            ActiveAudit.CheckGrid(grdDogUpravl);
            ActiveAudit.CheckGrid(grdUslugi);
            ActiveAudit.CheckGrid(grdFiles);



            lblCurrDogovor.Text = this.currDogID.ToString();

            grdDogUpravl.Columns[0].Visible = false;
            grdDogUpravl.Columns[1].Visible = false;
            grdDogUpravl.Columns[2].Visible = false;

            grdDogUpravl.Columns[3].Width = grdDogUpravl.Width / 12;
            grdDogUpravl.Columns[4].Width = grdDogUpravl.Width / 12;
            grdDogUpravl.Columns[5].Width = grdDogUpravl.Width / 11;
            grdDogUpravl.Columns[6].Width = grdDogUpravl.Width / 11;
            grdDogUpravl.Columns[7].Width = grdDogUpravl.Width / 11;

            grdDogUpravl.Columns[8].Width  = grdDogUpravl.Width / 12;
            grdDogUpravl.Columns[9].Width  = grdDogUpravl.Width / 12;
            grdDogUpravl.Columns[10].Width = grdDogUpravl.Width / 11;
            grdDogUpravl.Columns[11].Width = grdDogUpravl.Width / 11;
            grdDogUpravl.Columns[12].Width = grdDogUpravl.Width / 11;
            grdDogUpravl.Columns[13].Width = grdDogUpravl.Width / 11;

            grdUslugi.Columns[0].Visible = false;
            grdUslugi.Columns[1].Visible = false;
            grdUslugi.Columns[2].Visible = false;
            grdUslugi.Columns[3].Visible = false;

            grdUslugi.Columns[4].Width = grdUslugi.Width / 3;
            grdUslugi.Columns[5].Width = grdUslugi.Width / 4;
            grdUslugi.Columns[6].Width = grdUslugi.Width / 3;


            grdFiles.Columns[0].Visible = false;
            grdFiles.Columns[1].Visible = false;
            grdFiles.Columns[2].Visible = false;
            grdFiles.Columns[3].Visible = false;

            grdFiles.Columns[4].Width = grdFiles.Width / 2;
            grdFiles.Columns[5].Width = grdFiles.Width / 2;
        }
Beispiel #15
0
        private void btnPerech_Click(object sender, EventArgs e)
        {//перечень услуг
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string[] cliparr = ActiveAudit.GetClipBoard("//my.dom.gosuslugi.ru/organization-cabinet/#!/agreements/contract/");

                if (cliparr == null)
                {
                    return;
                }

                string[] data = cliparr.Where(s => !s.Contains("Вид коммунальных услуг") &&
                                              !s.Contains("Дополнительные услуги") && !s.Contains("Услуги отсутствуют") &&
                                              !s.Contains("Наименование")).ToArray();

                if (data.Count() % 3 != 0)
                {
                    MessageBox.Show("Похоже, данные скопированы некорректно");
                    return;
                }


                int      skip = 0;
                string[] z;

                while ((z = data.Skip(skip).Take(3).ToArray()).Count() != 0)
                {
                    skip += 3;
                    dogUprUslAdapter.Insert(this.currDogID,
                                            ActiveAudit.ID,
                                            ActiveAudit.ID_Company,
                                            z[0],
                                            z[1].Split('\t')[0] + " - " + z[1].Split('\t')[1],
                                            z[2]);
                }

                grdUslugi.DataSource = dogUprUslAdapter.GetDataByDogovor(ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);
            }
            catch (Exception ex)
            {
                Clipboard.Clear();
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Clipboard.Clear();
                Cursor.Current = Cursors.Default;
                ActiveAudit.CheckGrid(grdUslugi);
            }
        }
Beispiel #16
0
        private void grdDogUpravl_SelectionChanged(object sender, EventArgs e)
        {
            if (grdDogUpravl.CurrentRow != null)
            {
                this.currDogID      = (int)grdDogUpravl.CurrentRow.Cells[0].Value;
                lblCurrDogovor.Text = this.currDogID.ToString();

                grdUslugi.DataSource = dogUprUslAdapter.GetDataByDogovor(ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);
                grdFiles.DataSource  = dogUprFilesAdapter.GetDataByActiveDog(ActiveAudit.ID, ActiveAudit.ID_Company, this.currDogID);
            }

            ActiveAudit.CheckGrid(grdUslugi);
            ActiveAudit.CheckGrid(grdFiles);
        }
Beispiel #17
0
        private void btnPerRabUslDetails_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                IDataObject iData = Clipboard.GetDataObject();

                if (iData.GetDataPresent(DataFormats.Html))
                {
                    string h = ((String)iData.GetData(DataFormats.Html));
                    //Можно получить GUID дома
                }

                if (iData.GetDataPresent(DataFormats.UnicodeText)) //получим массив строк
                {
                    string   cliptxt = (String)iData.GetData(DataFormats.UnicodeText);
                    string[] cliparr = cliptxt.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);

                    string[] data = cliparr.Skip(1).ToArray();

                    foreach (string s in data)
                    {
                        perechRabUslDetailsAdapter.Insert(
                            this.currPerechID,
                            ActiveAudit.ID,
                            ActiveAudit.ID_Company,
                            s.Split('\t')[0],  //Наименование
                            s.Split('\t')[1],  //код
                            s.Split('\t')[2],  //вид работ
                            s.Split('\t')[3],  //цена
                            s.Split('\t')[4],  //Объем
                            s.Split('\t')[5],  // Кол-во
                            s.Split('\t')[6]   //Стоимость
                            );
                    }
                    grdPerRabUslDetals.DataSource = perechRabUslDetailsAdapter.GetDataBySelectedRabUsl(this.currPerechID, ActiveAudit.ID, ActiveAudit.ID_Company);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Clipboard.Clear();
                Cursor.Current = Cursors.Default;
                ActiveAudit.CheckGrid(grdPerRabUslDetals);
            }
        }
Beispiel #18
0
        private void btnGetPorch_Click(object sender, EventArgs e)
        {//данные подъездов
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string[] clparr = ActiveAudit.GetClipBoard("//my.dom.gosuslugi.ru/organization-cabinet/#!/house/card?houseCardGuid");

                if (clparr == null)
                {
                    return;
                }

                int      skip = 0;
                string[] strarr;

                if (clparr.Count() % 4 != 0)
                {
                    MessageBox.Show("Данные подъездов скопированы некорректно.");
                    return;
                }

                while ((strarr = clparr.Skip(skip).Take(4).ToArray()).Count() != 0)
                {
                    skip += 4;
                    porchAdapter.Insert(
                        this.currObjID,
                        ActiveAudit.ID_Company,
                        ActiveAudit.ID,
                        strarr[0].Split(' ')[strarr[0].Split(' ').Length - 1], //Номер
                        strarr[1].Split(' ')[strarr[1].Split(' ').Length - 1], //Количество ЛС
                        strarr[2].Split(' ')[strarr[2].Split(' ').Length - 1], // Этажность
                        strarr[3].Split(' ')[strarr[3].Split(' ').Length - 1]  //Год постройки
                        );
                }

                grdPorch.DataSource = porchAdapter.GetDataBySelectObject(this.currObjID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Clipboard.Clear();
                Cursor.Current = Cursors.Default;

                ActiveAudit.CheckGrid(grdPorch);
            }
        }
Beispiel #19
0
        private void PerechRabUslug_Load(object sender, EventArgs e)
        {
            //pereschRabUslAdapter.FillByActiveAudit(ds.PerechRabUslug, ActiveAudit.ID, ActiveAudit.ID_Company);
            //perechRabUslDetailsAdapter.FillBySelectedRabUsl(ds.PerechRabUslugDetails, this.currPerechID, ActiveAudit.ID, ActiveAudit.ID_Company);

            grdPerRabUsl.DataSource       = pereschRabUslAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);                             //???
            grdPerRabUslDetals.DataSource = perechRabUslDetailsAdapter.GetDataBySelectedRabUsl(this.currPerechID, ActiveAudit.ID, ActiveAudit.ID_Company); //???

            ActiveAudit.CheckGrid(grdPerRabUsl);
            ActiveAudit.CheckGrid(grdPerRabUslDetals);

            grdPerRabUsl.Columns[0].Visible = false;
            grdPerRabUsl.Columns[1].Visible = false;
            grdPerRabUsl.Columns[2].Visible = false;

            grdPerRabUsl.Columns[3].Width = grdPerRabUsl.Width / 6;
            grdPerRabUsl.Columns[4].Width = grdPerRabUsl.Width / 6;
            grdPerRabUsl.Columns[5].Width = grdPerRabUsl.Width / 6;
            grdPerRabUsl.Columns[6].Width = grdPerRabUsl.Width / 5;
            grdPerRabUsl.Columns[7].Width = grdPerRabUsl.Width / 5;


            //grdPerRabUsl.Columns[8].Width = grdPerRabUsl.Width / 8;
            //grdPerRabUsl.Columns[9].Width = grdPerRabUsl.Width / 8;            //grdPerRabUsl.Columns[0].Visible = false;
            //grdPerRabUsl.Columns[1].Visible = false;
            //grdPerRabUsl.Columns[2].Visible = false;

            //grdPerRabUsl.Columns[3].Width = grdPerRabUsl.Width / 7;
            //grdPerRabUsl.Columns[4].Width = grdPerRabUsl.Width / 7;
            //grdPerRabUsl.Columns[5].Width = grdPerRabUsl.Width / 7;
            //grdPerRabUsl.Columns[6].Width = grdPerRabUsl.Width / 7;
            //grdPerRabUsl.Columns[7].Width = grdPerRabUsl.Width / 8;
            //grdPerRabUsl.Columns[8].Width = grdPerRabUsl.Width / 8;
            //grdPerRabUsl.Columns[9].Width = grdPerRabUsl.Width / 8;

            ////////////
            ///
            grdPerRabUslDetals.Columns[0].Visible = false;
            grdPerRabUslDetals.Columns[1].Visible = false;
            grdPerRabUslDetals.Columns[2].Visible = false;
            grdPerRabUslDetals.Columns[3].Visible = false;

            grdPerRabUslDetals.Columns[3].Width = grdPerRabUslDetals.Width / 7;
            grdPerRabUslDetals.Columns[4].Width = grdPerRabUslDetals.Width / 8;
            grdPerRabUslDetals.Columns[5].Width = grdPerRabUslDetals.Width / 8;
            grdPerRabUslDetals.Columns[6].Width = grdPerRabUslDetals.Width / 7;
            grdPerRabUslDetals.Columns[7].Width = grdPerRabUslDetals.Width / 7;
            grdPerRabUslDetals.Columns[8].Width = grdPerRabUslDetals.Width / 7;
            grdPerRabUslDetals.Columns[9].Width = grdPerRabUslDetals.Width / 7;
        }
Beispiel #20
0
        private void DictWorkService_Load(object sender, EventArgs e)
        {
            //dictWorkServAdapter.FillByActiveAudit(ds.DictWorkService, ActiveAudit.ID, ActiveAudit.ID_Company); //??
            grdWorkServ.DataSource = dictWorkServAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);
            ActiveAudit.CheckGrid(grdWorkServ);

            grdWorkServ.Columns[0].Visible = false;
            grdWorkServ.Columns[1].Visible = false;
            grdWorkServ.Columns[2].Visible = false;

            grdWorkServ.Columns[3].Width = grdWorkServ.Width / 3;
            grdWorkServ.Columns[4].Width = grdWorkServ.Width / 3;
            grdWorkServ.Columns[5].Width = grdWorkServ.Width / 3;
        }
Beispiel #21
0
        private void btnNegilAdd_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                string[] clparr = ActiveAudit.GetClipBoard("nonResidential=yes");
                if (clparr == null)
                {
                    return;
                }
                if (clparr.Count() % 7 != 0)
                {
                    MessageBox.Show("Данные нежилых помещений скопированы некорректно.");
                    return;
                }

                int      skip = 0;
                string[] arr;

                while ((arr = clparr.Skip(skip).Take(7).ToArray()).Count() != 0)
                {
                    skip += 7;

                    neGiloeAdapter.Insert(
                        this.currObjID,
                        ActiveAudit.ID,
                        ActiveAudit.ID_Company,
                        arr[0],
                        arr[1].Split('\t')[1],
                        arr[2].Split('\t')[1],
                        arr[3].Split('\t')[1],
                        arr[4].Split('\t')[1],
                        arr[6].Split('\t')[1]
                        );
                }

                grdNegil.DataSource = neGiloeAdapter.GetDataByActiveObject(this.currObjID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                Clipboard.Clear();

                ActiveAudit.CheckGrid(grdNegil);
            }
        }
Beispiel #22
0
        private void btnGetClipBoard_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                string[] cliparr = ActiveAudit.GetClipBoard("my.dom.gosuslugi.ru/organization-cabinet/#!/agreements");

                if (cliparr == null)
                {
                    return;
                }

                if (cliparr.Count() % 7 != 0)
                {
                    MessageBox.Show("Данные устава скопированы некорректно.");
                    return;
                }

                ustavAdapter.Insert(ActiveAudit.ID,
                                    ActiveAudit.ID_Company,
                                    cliparr[0].Split('\t')[1], //идентификатор
                                    cliparr[5],                //статус
                                    cliparr[1].Split('\t')[1], //сроки передачи показаний по приборам
                                    cliparr[2].Split('\t')[1], //Срок представления платежных документов
                                    cliparr[3].Split('\t')[1], //Срок внесения платы
                                    cliparr[6].Split('\t')[1]  //Версия
                                    );

                //?? ustavAdapter.FillByCurrentAudit(ds.Ustav, ActiveAudit.ID, ActiveAudit.ID_Company);
                grdUstav.DataSource = ustavAdapter.GetDataByCurrentAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

                if (grdUstav.Rows.Count > 0)
                {
                    grdUstav.Rows[grdUstav.Rows.Count - 1].Selected = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Clipboard.Clear();
                Cursor.Current = Cursors.Default;

                ActiveAudit.CheckGrid(grdUstav);
                ActiveAudit.CheckGrid(grdHouse);
                ActiveAudit.CheckGrid(grdUslugi);
            }
        }
Beispiel #23
0
        private void grdPorch_SelectionChanged(object sender, EventArgs e)
        {
            if (grdPorch.CurrentRow != null)
            {
                this.currPorchID  = (int)grdPorch.CurrentRow.Cells[0].Value;
                lblCurrPorch.Text = this.currPorchID.ToString();

                grdPomesch.DataSource = pomeschAdapter.GetDataBySelectedPorch(this.currPorchID);
                ActiveAudit.CheckGrid(grdPomesch);
            }
            else
            {
                Console.WriteLine(this.currPorchID);
            }
        }
Beispiel #24
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Удалить лицензию?",
                                "Лицензии",
                                MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                int currID = (int)grdLicense.CurrentRow.Cells[0].Value;
                licenseAdapter.DeleteByCurrentLicense(currID, ActiveAudit.ID, ActiveAudit.ID_Company);
                grdLicense.DataSource = licenseAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

                grdLicHouses.DataSource = licenseHousesAdapter.GetDataByCurrentLicense(currID, ActiveAudit.ID, ActiveAudit.ID_Company);

                ActiveAudit.CheckGrid(grdLicense);
                ActiveAudit.CheckGrid(grdLicHouses);
            }
        }
Beispiel #25
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (ActiveAudit.ID != 0)
            {
                if (MessageBox.Show("Удалить данные лицевых счетов?",
                                    "Лицевые счета",
                                    MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    licSchetAdapter.DeleteQueryCurrents(ActiveAudit.ID, ActiveAudit.ID_Company);

                    //licSchetAdapter.FillByActiveAudit(ds.LicSchet, ActiveAudit.ID, ActiveAudit.ID_Company);
                    grdLicSchet.DataSource = licSchetAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

                    ActiveAudit.CheckGrid(grdLicSchet);
                }
            }
        }
Beispiel #26
0
        private void License_Load(object sender, EventArgs e)
        {
            //licenseAdapter.FillByActiveAudit(ds.License, ActiveAudit.ID, ActiveAudit.ID_Company);
            grdLicense.DataSource = licenseAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);


            int currID = 0;

            if (grdLicense.CurrentRow != null)
            {
                currID = (int)grdLicense.CurrentRow.Cells[0].Value;
            }

            //licenseHousesAdapter.FillByCurrentLicense(ds.LicenseHouses, currID, ActiveAudit.ID, ActiveAudit.ID_Company);
            grdLicHouses.DataSource = licenseHousesAdapter.GetDataByCurrentLicense(currID, ActiveAudit.ID, ActiveAudit.ID_Company);

            ActiveAudit.CheckGrid(grdLicense);
            ActiveAudit.CheckGrid(grdLicHouses);

            grdLicense.Columns[0].Visible = false;
            grdLicense.Columns[1].Visible = false;
            grdLicense.Columns[2].Visible = false;

            grdLicense.Columns[3].Width = grdLicense.Width / 10;
            grdLicense.Columns[4].Width = grdLicense.Width / 10;
            grdLicense.Columns[5].Width = grdLicense.Width / 10;
            grdLicense.Columns[6].Width = grdLicense.Width / 10;
            grdLicense.Columns[7].Width = grdLicense.Width / 10;

            grdLicense.Columns[8].Width  = grdLicense.Width / 10;
            grdLicense.Columns[8].Width  = grdLicense.Width / 10;
            grdLicense.Columns[10].Width = grdLicense.Width / 10;
            grdLicense.Columns[11].Width = grdLicense.Width / 10;
            grdLicense.Columns[12].Width = grdLicense.Width / 10;

            grdLicHouses.Columns[0].Visible = false;
            grdLicHouses.Columns[1].Visible = false;
            grdLicHouses.Columns[2].Visible = false;
            grdLicHouses.Columns[3].Visible = false;

            grdLicHouses.Columns[4].Width = grdLicHouses.Width / 5;
            grdLicHouses.Columns[5].Width = grdLicHouses.Width / 5;
            grdLicHouses.Columns[6].Width = grdLicHouses.Width / 5;
            grdLicHouses.Columns[7].Width = grdLicHouses.Width / 6;
            grdLicHouses.Columns[8].Width = grdLicHouses.Width / 6;
        }
Beispiel #27
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (ActiveAudit.ID != 0)
            {
                if (MessageBox.Show("Удалить данные приборов учета?",
                                    "Реестр приборов учета",
                                    MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    priborAdapter.DeleteCurrents(ActiveAudit.ID, ActiveAudit.ID_Company);

                    //priborAdapter.FillByActiveAudit(ds.Pribor, ActiveAudit.ID, ActiveAudit.ID_Company);
                    grdPribors.DataSource = priborAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

                    ActiveAudit.CheckGrid(grdPribors);
                }
            }
        }
Beispiel #28
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (ActiveAudit.ID != 0)
            {
                if (MessageBox.Show("Удалить данные голосований?",
                                    "Голосования",
                                    MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    votingAdapter.DeleteCurrents(ActiveAudit.ID, ActiveAudit.ID_Company);

                    votingAdapter.FillByActiveAudit(ds.Voting, ActiveAudit.ID, ActiveAudit.ID_Company);
                    grdVoting.DataSource = votingAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

                    ActiveAudit.CheckGrid(grdVoting);
                }
            }
        }
Beispiel #29
0
        private void btnWorksServ_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                string[] cliparr = ActiveAudit.GetClipBoard("//my.dom.gosuslugi.ru/organization-cabinet/#!/org-nsi/OrganizationWork");

                if (cliparr == null)
                {
                    return;
                }

                int      skip = 0;
                string[] z;
                string[] data = cliparr.Skip(1).ToArray();

                while ((z = data.Skip(skip).Take(2).ToArray()).Count() != 0)
                {
                    skip += 2;

                    string[] vals = z[1].Split('\t');

                    dictWorkServAdapter.Insert(
                        ActiveAudit.ID,
                        ActiveAudit.ID_Company,
                        z[0],
                        vals[0],
                        vals.Count() == 2 ? vals[1] : ""
                        );
                }

                grdWorkServ.DataSource = dictWorkServAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                Clipboard.Clear();
                Cursor.Current = Cursors.Default;

                ActiveAudit.CheckGrid(grdWorkServ);
            }
        }
Beispiel #30
0
        private void Pribors_Load(object sender, EventArgs e)
        {
            //priborAdapter.FillByActiveAudit(ds.Pribor, ActiveAudit.ID, ActiveAudit.ID_Company);
            grdPribors.DataSource = priborAdapter.GetDataByActiveAudit(ActiveAudit.ID, ActiveAudit.ID_Company);

            ActiveAudit.CheckGrid(grdPribors);

            grdPribors.Columns[0].Visible = false;
            grdPribors.Columns[1].Visible = false;
            grdPribors.Columns[2].Visible = false;

            grdPribors.Columns[3].Width = grdPribors.Width / 7;
            grdPribors.Columns[4].Width = grdPribors.Width / 7;
            grdPribors.Columns[5].Width = grdPribors.Width / 7;
            grdPribors.Columns[6].Width = grdPribors.Width / 7;
            grdPribors.Columns[7].Width = grdPribors.Width / 8;
            grdPribors.Columns[8].Width = grdPribors.Width / 8;
            grdPribors.Columns[9].Width = grdPribors.Width / 8;
        }