-
Notifications
You must be signed in to change notification settings - Fork 0
/
CostConfirmView_f.cs
152 lines (121 loc) · 5.56 KB
/
CostConfirmView_f.cs
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using FarsiLibrary.Utils;
using DLibraryUtils;
namespace PIHO_DENTIST_SOFTWARE
{
public partial class CostConfirmView_f : Form
{
public DLibraryUtils.DLUtils DLUtilsobj;
dentistryEntities dentistryEntitiescontext;
public int usercodexml;
public CostConfirmView_f()
{
InitializeComponent();
}
public bool loaddata_head(string stratdate,string enddate)
{
DLUtilsobj.costconfirmobj.selectCostConfirm_head(stratdate,enddate);
SqlDataReader DataSource;
DLUtilsobj.costconfirmobj.Dbconnset(true);
DataSource = DLUtilsobj.costconfirmobj.CostConfirmclientdataset.ExecuteReader();
radGridView1.DataSource = DataSource;
DLUtilsobj.costconfirmobj.Dbconnset(false);
if (radGridView1.RowCount > 0)
{
radGridView1.Columns[0].HeaderText = " کد تایید هزینه ";
radGridView1.Columns[1].HeaderText = " شماره پرسنلی";
radGridView1.Columns[2].HeaderText = " تاریخ ویزیت";
radGridView1.Columns[3].HeaderText = "پزشک معالج ";
radGridView1.Columns[4].HeaderText = " تاریخ تایید";
radGridView1.Columns[5].HeaderText = " ساعت تایید";
radGridView1.Columns[6].HeaderText = " پزشک تایید کننده";
}
return true;
}
public bool loaddata_detail(int costconfirmHeadCode)
{
DLUtilsobj.costconfirmobj.selectCostConfirm_detail(costconfirmHeadCode);
SqlDataReader DataSource;
DLUtilsobj.costconfirmobj.Dbconnset(true);
DataSource = DLUtilsobj.costconfirmobj.CostConfirmclientdataset.ExecuteReader();
radGridView2.DataSource = DataSource;
DLUtilsobj.costconfirmobj.Dbconnset(false);
if (radGridView2.RowCount > 0)
{
radGridView2.Columns[0].HeaderText = " کد ";
radGridView2.Columns[1].HeaderText = " نام خدمت ";
radGridView2.Columns[2].HeaderText = " عکس دندان ";
}
return true;
}
private void Ins_Button_Click(object sender, EventArgs e)
{
CostConfirm_f CostConfirm_frm = new CostConfirm_f();
CostConfirm_frm.usercodexml = usercodexml;
CostConfirm_frm.ShowDialog();
}
private void edit_Button_Click(object sender, EventArgs e)
{
}
private void Search_button_Click(object sender, EventArgs e)
{
loaddata_head(persianDateTimePicker2.Value.ToString("yyyy/MM/dd"), persianDateTimePicker3.Value.ToString("yyyy/MM/dd"));
if (radGridView1.RowCount > 0)
loaddata_detail(int.Parse(radGridView1.CurrentRow.Cells[0].Value.ToString()));
}
private void CostConfirmView_f_Load(object sender, EventArgs e)
{
DLUtilsobj = new DLibraryUtils.DLUtils();
loaddata_head(persianDateTimePicker2.Value.ToString("yyyy/MM/dd"), persianDateTimePicker3.Value.ToString("yyyy/MM/dd"));
if (radGridView1.RowCount > 0)
loaddata_detail(int.Parse(radGridView1.CurrentRow.Cells[0].Value.ToString()));
}
private void CostConfirmView_f_FormClosing(object sender, FormClosingEventArgs e)
{
this.Dispose();
}
private void radGridView1_SelectionChanging(object sender, Telerik.WinControls.UI.GridViewSelectionCancelEventArgs e)
{
if (radGridView1.RowCount > 0)
loaddata_detail(int.Parse(radGridView1.CurrentRow.Cells[0].Value.ToString()));
}
private void Button_Click(object sender, EventArgs e)
{
if (radGridView1.RowCount > 0)
{
int a = int.Parse(radGridView1.CurrentRow.Cells[0].Value.ToString());
if (MessageBox.Show("آیا مطمئن به حذف رکورد انتخابی هستید؟", "Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
DLUtilsobj.costconfirmobj.deleteCostConfirm_head(a);
DLUtilsobj.costconfirmobj.deleteCostConfirm_detail(a);
DLUtilsobj.EventsLogobj.insertEventsLog(usercodexml.ToString(), DateTime.Now.Date.ToShortDateString(), DateTime.Now.ToShortTimeString(), 37, Environment.MachineName, a);
//***************************
loaddata_head(persianDateTimePicker2.Value.ToString("yyyy/MM/dd"), persianDateTimePicker3.Value.ToString("yyyy/MM/dd"));
if (radGridView1.RowCount > 0)
loaddata_detail(int.Parse(radGridView1.CurrentRow.Cells[0].Value.ToString()));
//***************************
}
}
}
private void toolStripMenuItem1_Click(object sender, EventArgs e)
{
Ins_Button_Click(toolStripMenuItem1, e);
}
private void toolStripMenuItem2_Click(object sender, EventArgs e)
{
edit_Button_Click(toolStripMenuItem2, e);
}
private void toolStripMenuItem3_Click(object sender, EventArgs e)
{
Button_Click(toolStripMenuItem3, e);
}
}
}