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
using System;
using System.Data;
using System.Windows.Forms;
using Atechnology.DBConnections2;
using Atechnology.Components;
namespace Atechnology.ecad.Calc{
public class RunCalc{
#region Variables
int err = 0;
DataSet ds;
#endregion
#region Стартовый метод
public void Run(dbconn _db, DataRow [] _dr, bool isDelete, object _doc){
try{
if (_dr.Length == 0)
return;
ds = _dr[0].Table.DataSet;
DataRow dr_doc = _dr[0];
DataRow dr_order = _db.GetDataRow("select * from view_orders where idorder = " + dr_doc["idorder"].ToString());
if (dr_order != null){
dr_doc["contact"] = dr_order["contact"];
dr_doc["address"] = dr_order["address"];
dr_doc["idaddress"] = dr_order["idaddress"];
dr_doc["phone"] = dr_order["phone"];
dr_doc["iddepartment"] = dr_order["iddepartment"];
dr_doc["department_name"] = dr_order["department_name"];
dr_doc["comment"] = dr_order["comment"];
}
} catch(Exception e) {
MessageBox.Show("Ошибка события\n Контрольная точка - " + err.ToString() + " Message - " + e.Message);
}
}
#endregion
}
}