-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangePhone_F.cs
82 lines (74 loc) · 2.95 KB
/
ChangePhone_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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PIHO_DENTIST_SOFTWARE
{
public partial class ChangePhone_F : Form
{
public DLibraryUtils.DLUtils DLUtilsobj;
dentistryEntities dentistryEntitiescontext;
public int usercode ;
public int IdEmployeeType;
public int fkvdfamily;
public bool confirm = false;
public ChangePhone_F()
{
InitializeComponent();
}
private void Ins_Button_Click(object sender, EventArgs e)
{
if (textBox2.Text == "")
MessageBox.Show("لطفا شماره تلفن جدید را وارد نمائید", "Information", MessageBoxButtons.OK);
else
{
/*
if (DLUtilsobj.recipeobj.checkpersoninfotbl(int.Parse(Persno_textbox.Text)) == false)
{
PersonInfo PersonInfotemp = new PersonInfo
{
// Fk_Company = -1,
// Fk_Management = 0,
// Fk_subCompany = 0 ,
IdEmployeeType = IdEmployeeType,
persno = int.Parse(Persno_textbox.Text),
telephon = textBox2.Text,
DateTime = DateTime.Now
};
dentistryEntitiescontext.PersonInfoes.Add(PersonInfotemp);
dentistryEntitiescontext.SaveChanges();
DLUtilsobj.EventsLogobj.insertEventsLog(usercode.ToString(), DateTime.Now.Date.ToShortDateString(), DateTime.Now.ToShortTimeString(), 60, Environment.MachineName, int.Parse(Persno_textbox.Text));
}
else
*
{
*/
DLUtilsobj.recipeobj.UpdatePhoneNo(fkvdfamily, textBox2.Text);
MessageBox.Show("شماره تلفن فرد مورد نظر تغییر یافت", "Information", MessageBoxButtons.OK);
DLUtilsobj.EventsLogobj.insertEventsLog(usercode.ToString(), DateTime.Now.Date.ToShortDateString(), DateTime.Now.ToShortTimeString(), 60, Environment.MachineName,fkvdfamily );
confirm = true;
this.Close();
}
//}
}
private void ChangePhone_F_Load(object sender, EventArgs e)
{
DLUtilsobj = new DLibraryUtils.DLUtils();
dentistryEntitiescontext = new dentistryEntities();
}
private void ChangePhone_F_FormClosing(object sender, FormClosingEventArgs e)
{
//this.Dispose();
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (!(char.IsDigit(e.KeyChar) || char.IsControl(e.KeyChar)))
e.Handled = true;
}
}
}