/
Default.aspx.cs
83 lines (75 loc) · 2.99 KB
/
Default.aspx.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MainDataModuleTableAdapters;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
try
{
string tp = new main_class().GetCompanyName(Convert.ToInt32(TextBox1.Text));
if (tp != "0")
{
Session["type"] = TextBox1.Text;
Session["coname"] = tp;
Session["idid"] = TextBox1.Text;
string ur = "http://" + Request.Url.Authority;
for (int i = 0; (i + 1) < Request.Url.Segments.Length; i++)
{
ur += Request.Url.Segments[i];
}
string srf = ur;
ScriptManager.RegisterClientScriptBlock(this, Page.GetType(), "j01", "window.open('" + "loader.aspx?moduleid=ورود اطلاعات راننده ها" + "','_blank')", true);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "j02", "alert('یافت نشد');", true);
}
}
catch (Exception __e)
{
string errmsg = __e.Message;
errmsg = errmsg.Replace("'", " ");
new main_class().execute_command("insert into tbl_errors(e_err,e_uri) values ('" + errmsg + "','" + Request.Url.AbsoluteUri + "')");
ScriptManager.RegisterStartupScript(this, this.GetType(), "j02", "alert('یافت نشد');", true);
}
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
try
{
string tp = new main_class().GetCompanyName(Convert.ToInt32(TextBox2.Text));
if (tp != "0")
{
Session["type"] = TextBox2.Text;
Session["coname"] = tp;
Session["idid"] = TextBox2.Text;
string ur = "http://" + Request.Url.Authority;
for (int i = 0; (i + 1) < Request.Url.Segments.Length; i++)
{
ur += Request.Url.Segments[i];
}
string srf = ur;
ScriptManager.RegisterClientScriptBlock(this, Page.GetType(), "j01", "window.open('frm_cars.aspx','_blank')", true);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "j02", "alert('یافت نشد');", true);
}
}
catch (Exception __e)
{
string errmsg = __e.Message;
errmsg = errmsg.Replace("'", " ");
new main_class().execute_command("insert into tbl_errors(e_err,e_uri) values ('" + errmsg + "','" + Request.Url.AbsoluteUri + "')");
ScriptManager.RegisterStartupScript(this, this.GetType(), "j02", "alert('یافت نشد');", true);
}
}
}