-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheck.aspx.cs
160 lines (153 loc) · 6.19 KB
/
Check.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
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Spatial;
using System.Data.Entity.Validation;
using System.Data.Entity;
using System.IO;
public partial class Check : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
List<LUT_Assets_Masters> dt = this.GetData();
rptMarkers.DataSource = dt;
rptMarkers.DataBind();
}
}
private List<LUT_Assets_Masters> GetData()
{
AssetTaggingEntities context = new AssetTaggingEntities();
List<LUT_Assets_Masters> am1 = null;
if (DDSearch.SelectedValue == "2" && DDS.SelectedIndex >= 0)
{
am1 = (from am in context.LUT_Assets_Masters where am.CCID==DDS.SelectedIndex select am).ToList();
}
else if (DDSearch.SelectedValue == "3" && DDS.SelectedIndex >= 0)
{
am1 = (from am in context.LUT_Assets_Masters where am.CSID == DDS.SelectedIndex select am).ToList();
}
else if (DDSearch.SelectedValue == "5" && DDS.SelectedIndex >= 0)
{
am1 = (from am in context.LUT_Assets_Masters where am.AGrpID == DDS.SelectedIndex select am).ToList();
}
else
{
am1 = (from am in context.LUT_Assets_Masters select am).ToList();
}
return am1;
}
protected void DDSearch_SelectedIndexChanged(object sender, EventArgs e)
{
Search.Visible = true;
BArea.Visible = false;
DDS.Items.Clear();
if (DDSearch.SelectedValue == "2")
{
AssetTaggingEntities context = new AssetTaggingEntities();
List<LUT_Current_Condition> CC = (from cc in context.LUT_Current_Condition where cc.IsDeleted == false select cc).ToList();
DDS.DataTextField = "Current_Condition";
DDS.DataValueField = "CCID";
DDS.DataSource = CC;
DDS.DataBind();
DDS.Items.Insert(0, "Select Current Condition");
}
if (DDSearch.SelectedValue == "3")
{
AssetTaggingEntities context = new AssetTaggingEntities();
List<LUT_Current_Status> CS = (from cs in context.LUT_Current_Status where cs.IsDeleted == false select cs).ToList();
DDS.DataTextField = "Current_Status";
DDS.DataValueField = "CSID";
DDS.DataSource = CS;
DDS.DataBind();
DDS.Items.Insert(0, "Select Current Status");
}
if (DDSearch.SelectedValue == "5")
{
AssetTaggingEntities context = new AssetTaggingEntities();
List<LUT_Asset_Groups> Ag = (from ag in context.LUT_Asset_Groups where ag.IsDeleted == false select ag).ToList();
DDS.DataTextField = "Asset_Groups";
DDS.DataValueField = "AGrpID";
DDS.DataSource = Ag;
DDS.DataBind();
DDS.Items.Insert(0, " Select Asset Groups");
}
if (DDSearch.SelectedValue == "4")
{
Search.Visible = false;
BArea.Visible = true;
}
}
public class AssetLocations
{
public float Latitude { get; set; }
// public float Current_Location_Y { get; set; }
public float Longitude { get; set; }
// public float Current_Location_X { get; set; }
public DbGeometry GeographicPoint { get; set; }
}
//protected void DDSearch_SelectedIndexChanged(object sender, EventArgs e)
//{
// Search.Visible = true;
// DDS.Items.Clear();
// if (DDSearch.SelectedValue == "Condition")
// {
// AssetTaggingEntities context = new AssetTaggingEntities();
// List<LUT_Current_Condition> CC = (from cc in context.LUT_Current_Condition where cc.IsDeleted == false select cc).ToList();
// DDS.DataTextField = "Current_Condition";
// DDS.DataValueField = "CCID";
// DDS.DataSource = CC;
// DDS.DataBind();
// DDS.Items.Insert(0, "Select Current Condition");
// }
// if (DDSearch.SelectedValue == "Status")
// {
// AssetTaggingEntities context = new AssetTaggingEntities();
// List<LUT_Current_Status> CS = (from cs in context.LUT_Current_Status where cs.IsDeleted == false select cs).ToList();
// DDS.DataTextField = "Current_Status";
// DDS.DataValueField = "CSID";
// DDS.DataSource = CS;
// DDS.DataBind();
// DDS.Items.Insert(0, "Select Current Status");
// }
// if (DDSearch.SelectedValue == "Asset Groups")
// {
// AssetTaggingEntities context = new AssetTaggingEntities();
// List<LUT_Asset_Groups> Ag = (from ag in context.LUT_Asset_Groups where ag.IsDeleted == false select ag).ToList();
// DDS.DataTextField = "Asset_Groups";
// DDS.DataValueField = "AGrpID";
// DDS.DataSource = Ag;
// DDS.DataBind();
// DDS.Items.Insert(0, " Select Asset Groups");
// }
//}
public double ConvertDegreeAngleToDouble(double degrees, double minutes, double seconds)
{
var multiplier = (degrees < 0 ? -1 : 1);
var _deg = (double)Math.Abs(degrees);
var result = _deg + (minutes / 60) + (seconds / 3600);
return result * multiplier;
}
//public double ConvertDegreeAngleToDouble(string point)
//{
// var multiplier = (point.Contains("N") || point.Contains("E")) ? 1 : 1; //north and east
// point = Regex.Replace(point, "[^0-9.]", "");
// var pointArray = point.Split('°');
// var pointArray1 = point.Split('′');
// //var pointArray2 = point.Split('′′');
// var degrees = Double.Parse(pointArray[0]);
// var minutes = Double.Parse(pointArray[1]) / 60;
// var seconds = Double.Parse(pointArray[2]) / 3600;
// return (degrees + minutes + seconds) * multiplier;
//}
protected void DDS_SelectedIndexChanged(object sender, EventArgs e)
{
List<LUT_Assets_Masters> dt = this.GetData();
rptMarkers.DataSource = dt;
rptMarkers.DataBind();
}
}