using System using System Data using System Windows Forms using Atechn

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Data;
using System.Windows.Forms;
using Atechnology.DBConnections2;
using Atechnology.winDraw.Model;
using Atechnology.winDraw;
using Atechnology.Components;
using Atechnology.ecad.Document.Classes;
using Atechnology.ecad.Document.DataSets;
//Сервис и гарантия.Списки.Выбор типа документа.
namespace Atechnology.ecad.Calc{
public class RunCalc{
#region Variables
int err = 0;
public DBConnections2.dbconn db;
DataSet ds;
public DataTable table_sign;
#endregion
#region Стартовый метод
public void Run(dbconn _db, DataRow [] _dr, bool isDelete, object grsdoc){
try{
err = 1;
if (_dr.Length == 0)
return;
ds = _dr[0].Table.DataSet;
ServiceDocClass sdc = grsdoc as ServiceDocClass;
table_sign = ds.Tables["docsign"];
err = 2;
DataRow[] geogr = table_sign.Select("idsign = 105 and deleted is null");
if (geogr.Length == 0){
sdc.AddSignValue(491, false);
}
err = 5;
if (geogr.Length == 0)
sdc.SaveToBase();
} catch(Exception e) {
MessageBox.Show("Ошибка события чтения из БД\n Контрольная точка - " + err.ToString() + " Message - " + e.Message);
}
}
#endregion
}
}