-
Notifications
You must be signed in to change notification settings - Fork 0
/
PuroPostStandard.ascx.cs
176 lines (163 loc) · 6.35 KB
/
PuroPostStandard.ascx.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using context = System.Web.HttpContext;
//PUROPOSTSTANDARD
public partial class PuroPostStandard : System.Web.UI.UserControl
{
const int INVOICE_COURIER_EDI = 3;
const int SHIPMENT_STATUS_COURIER_EDI = 4;
public event EventHandler RemoveUserControl;
public event EventHandler UserControlSaved;
public event EventHandler buttonClick;
public UserControlParams Params = new UserControlParams();
protected void Page_Load(object sender, EventArgs e)
{
clsEDIRecipReq qEDIRecipReq = SrvEDIRecipReq.GetEDIRecipReqsByID(Params.idEDIRecipReqs);
if (qEDIRecipReq != null && !IsPostBack)
{
GetCommunicationMethods();
UpdateControls(qEDIRecipReq);
}
else if (Params.bNewDialog)
{
Params.CheckPassBacks(Params.idEDIRecipReqs, false);
RemoveUserControl(sender, e);
GetCommunicationMethods();
UpdateControls(qEDIRecipReq);
}
SetCommunicationMethodControls();
if (!string.IsNullOrEmpty(qEDIRecipReq.PanelTitle))
RadPanelBar1.Items[0].Text = qEDIRecipReq.PanelTitle;
else
RadPanelBar1.Items[0].Text = "Record num: " + (Params.iRecordID + 1).ToString();
RadPanelBar1.Items[0].Expanded = false;
textBoxPanelTitle.Text = RadPanelBar1.Items[0].Text;
}
public void LoadParams(UserControlParams p)
{
Params = p;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public string GetCurrentMethod()
{
var st = new StackTrace();
var sf = st.GetFrame(1);
return sf.GetMethod().Name;
}
protected void Page_Init(object sender, EventArgs e)
{
//this. += new DetailsViewCommandEventHandler(RoomForm_ItemCommand);
}
void RoomForm_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (e.CommandName == "Cancel")
{
int er = 0;
er++;
}
}
protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
{
//SetFileFormatControls();
}
protected void CommunicationMethod_SelectedIndexChanged(object sender, EventArgs e)
{
SetCommunicationMethodControls();
}
private void SetCommunicationMethodControls()
{
if (comboxCommunicationMethod.SelectedText.ToString().ToLower().Contains("ftp"))
{
lblFTPAddress.Visible = true;
textBoxFTPAddress.Visible = true;
lblUserName.Visible = true;
textBoxUserName.Visible = true;
lblPassword.Visible = true;
textBoxPassword.Visible = true;
lblFolderPath.Visible = true;
textBoxFolderPath.Visible = true;
lblEmail.Visible = false;
textBoxEmail.Visible = false;
}
else
{
lblFTPAddress.Visible = false;
textBoxFTPAddress.Visible = false;
lblUserName.Visible = false;
textBoxUserName.Visible = false;
lblPassword.Visible = false;
textBoxPassword.Visible = false;
lblFolderPath.Visible = false;
textBoxFolderPath.Visible = false;
if (comboxCommunicationMethod.SelectedText.ToString().ToLower().Contains("email"))
{
lblEmail.Visible = true;
textBoxEmail.Visible = true;
}
}
}
protected void btnfirst_Click(object sender, EventArgs e)
{
int er = 0;
er++;
}
protected void btnRemove_Click(object sender, EventArgs e)
{
RemoveUserControl(sender, e);
}
protected void btnSubmit210Changes_Click(object sender, EventArgs e)
{
//int iFileformat = int.Parse(comboBxFileFormat.SelectedValue);
int iCommMethod = int.Parse(comboxCommunicationMethod.SelectedValue);
clsEDIRecipReq qEDIRecipReq = SrvEDIRecipReq.GetEDIRecipReqsByID(Params.idEDIRecipReqs);
qEDIRecipReq.idCommunicationMethod = iCommMethod;
qEDIRecipReq.FTPAddress = textBoxFTPAddress.Text;
qEDIRecipReq.UserName = textBoxUserName.Text;
qEDIRecipReq.Password = textBoxPassword.Text;
qEDIRecipReq.FolderPath = textBoxFolderPath.Text;
qEDIRecipReq.Email = textBoxEmail.Text;
qEDIRecipReq.PanelTitle = textBoxPanelTitle.Text;
RadPanelBar1.Items[0].Text = qEDIRecipReq.PanelTitle;
qEDIRecipReq.UpdatedBy = Session["userName"].ToString();
qEDIRecipReq.UpdatedOn = DateTime.Now;
SrvEDIRecipReq.Insert(qEDIRecipReq);
UserControlSaved(sender, e);
}
protected void GetCommunicationMethods()
{
try
{
List<ClsCommunicationMethod> qCommMeth = SrvCommunicationMethod.GetCommunicationMethods();
comboxCommunicationMethod.DataSource = qCommMeth;
comboxCommunicationMethod.DataTextField = "CommunicationMethod";
comboxCommunicationMethod.DataValueField = "idCommunicationMethod";
comboxCommunicationMethod.DataBind();
}
catch (Exception ex)
{
long lnewID = 0;
clsExceptionLogging error = new clsExceptionLogging() { Method = GetCurrentMethod(), ExceptionMsg = ex.Message.ToString(), ExceptionType = ex.GetType().Name.ToString(), ExceptionURL = context.Current.Request.Url.ToString(), ExceptionSource = ex.StackTrace.ToString(), CreatedOn = DateTime.Now, CreatedBy = Session["userName"].ToString() };
SrvExceptionLogging.Insert(error, out lnewID);
}
}
protected void UpdateControls(clsEDIRecipReq qEDIRecipReq)
{
//comboBxFileFormat.SelectedValue = qEDIRecipReq.idFileType.ToString();
comboxCommunicationMethod.SelectedValue = qEDIRecipReq.idCommunicationMethod.ToString();
//txtBoxISA.Text = qEDIRecipReq.X12_ISA;
//txtBoxGS.Text = qEDIRecipReq.X12_GS;
//txtBoxQualifier.Text = qEDIRecipReq.X12_Qualifier;
textBoxFTPAddress.Text = qEDIRecipReq.FTPAddress;
textBoxUserName.Text = qEDIRecipReq.UserName;
textBoxPassword.Text = qEDIRecipReq.Password;
textBoxFolderPath.Text = qEDIRecipReq.FolderPath;
textBoxEmail.Text = qEDIRecipReq.Email;
return;
}
}