protected void Page_Load(object sender, EventArgs e) { #region Code to Fetch Everything on Looad if (!Page.IsPostBack) { if (Request.QueryString["userid"] != "") { string querystring = Request.QueryString["userid"]; string q = "select * from users where userid='" + querystring + "'"; string[] a = bucket.verifyReader(q, "userid", "password", "role", "ao", "oc", "fc", "om", "status"); txt_user.Text = a[0]; txt_password.Text = a[1]; txt_Role.Text = a[2]; txt_AO.Text = a[3]; txt_oc.Text = a[4]; txt_fc.Text = a[5]; txt_OM.Text = a[6]; if (a[7] == "Active") { rdb_active.Checked = true; glory(rdb_active); glory(rdb_inactive); } else if (a[7] == "Inactive") { rdb_active.Checked = true; glory(rdb_active); glory(rdb_inactive); } } } #endregion }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["atmid"] != "") { string querystring = Request.QueryString["atmid"]; string q = "select * from atms where atmid='" + querystring + "'"; string[] a = bucket.verifyReader(q, "atmid", "location", "bankid", "sitenumber", "client", "status", "addressline1", "addressline2", "city", "pin", "state"); txt_atm.Text = a[0]; txt_location.Text = a[1]; txt_bank.Text = a[2]; txt_sitenumber.Text = a[3]; txt_customer.Text = a[4]; txt_addressline1.Text = a[6]; txt_addressline2.Text = a[7]; txt_City.Text = a[8]; txt_Pin.Text = a[9]; txt_state.Text = a[10]; user_err.Visible = false; user_err0.Visible = false; user_err1.Visible = false; user_err2.Visible = false; if (a[5] == "Active") { rdb_active.Checked = true; glory(rdb_active); glory(rdb_inactive); } else if (a[5] == "Inactive") { rdb_inactive.Checked = true; glory(rdb_active); glory(rdb_inactive); } } } }
protected void Page_Load(object sender, EventArgs e) { txt_user.Text = Request.QueryString["userid"]; fte6.InvalidChars = @"`~!@#$%^&*()_+{}:<>?[]-=\;'./"""; fte7.InvalidChars = @"`~!@#$%^&*()_+{}:<>?[]-=\;'./"""; if (!IsPostBack) { string[] d1 = bucket.verifyReader("select status from users where userid='" + Request.QueryString["userid"] + "'", "status"); if (d1[0] == null) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('User does not exist.');window.location ='UserRights.aspx';", true); } else if (d1[0] == "DEL") { ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('User is Inactive.');window.location ='UserRights.aspx';", true); // Response.Redirect("~/Login.aspx"); } else { getatms(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["request"] == "ctp") { Button4.ForeColor = System.Drawing.Color.Black; Button4.BackColor = System.Drawing.Color.White; string[] q = bucket.verifyReader("select distinct COUNT(atmid) as 'a' from ATMs where status <> 'inactive' and atmid not like '%*BR*%' and atmid not like '%HDFC%' and bankid like 'ICICI'", "a"); lbl_siteassigned.Text = q[0]; } else if (Request.QueryString["request"] == "hdfc") { Button1.ForeColor = System.Drawing.Color.Black; Button1.BackColor = System.Drawing.Color.White; string[] q = bucket.verifyReader("select distinct COUNT(atmid) as 'a' from ATMs where status <> 'inactive' and atmid like '%HDFC%'", "a"); lbl_siteassigned.Text = q[0]; } else if (Request.QueryString["request"] == "axis") { Button2.ForeColor = System.Drawing.Color.Black; Button2.BackColor = System.Drawing.Color.White; string[] q = bucket.verifyReader("select distinct COUNT(atmid) as 'a' from ATMs where bankid='BANK OF MAHARASHTRA' and status <> 'inactive' and atmid like '%*BR*%' and atmid not like '%HDFC%' and bankid='BANK OF MAHARASHTRA'", "a"); lbl_siteassigned.Text = q[0]; } //graph(); oldnewversion(); if (Page.IsPostBack) { // timer.Enabled = true; } }
protected void Page_Load(object sender, EventArgs e) { ibuckethead bucket = new ibuckethead(); //bucket.ExecuteQuery("Delete from DR_CTP where atmid='null' and vdate='null'"); string q1 = "select distinct COUNT(atmid) as 'atmid' from ATMs where atmstatus <> 'DEL' and atmstatus<>'Inactive'"; string[] a1 = bucket.verifyReader(q1, "atmid"); lbl_siteassigned.Text = a1[0]; }
protected void Page_Load(object sender, EventArgs e) { string qOnline = "select count(l.userid) as 'online' from location l inner join users u on l.userid=u.userid where B_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(B_date,'/','-') + ' ' + l_time) > -60 and u.status<>'DEL' and RM like '" + Session["Sess_username"] + "' and role in ('AO','DE')"; string[] aonline = bucket.verifyReader(qOnline, "online"); lbl_Online.Text = aonline[0]; string qOffline = "select count(*) as 'offline' from location l inner join users u on l.userid=u.userid where B_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(B_date,'/','-') + ' ' + l_time) < -60 and u.status<>'DEL' and RM like '" + Session["Sess_username"] + "' and role in ('AO','DE')"; string[] aOffline = bucket.verifyReader(qOffline, "offline"); lbl_Offline.Text = aOffline[0]; string qBatteryLow = "select count(*) as 'BL' from location l inner join users u on l.userid=u.userid where B_date<>'' and Rem_Battery<=5 and u.status<>'DEL' and RM like '" + Session["Sess_username"] + "' and role in ('AO','DE')"; string[] aBatteryLow = bucket.verifyReader(qBatteryLow, "BL"); lbl_Battery.Text = aBatteryLow[0]; if (Request.QueryString.ToString() != "") { string sqlOffline = null; if (Request.QueryString["Online"] == "True") { sqlOffline = "select l.userid as [User], case when rem_battery>0 then ltrim(rtrim(rem_battery)) + '%' when rem_battery<0 then '0%' end as [Battery Remaining],'LocatorOne_1.aspx?userid=' + l.userid as [View On Map], substring(B_date,4,3) + substring(B_date,1,2)+ substring(B_date,6,5) + ' ' + L_time as [Last Updated On] from location l inner join users u on l.userid=u.userid where B_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(B_date,'/','-') + ' ' + l_time) > -60 and u.status<>'DEL' and RM like '" + Session["Sess_username"] + "' and role in ('AO','DE')"; } else if (Request.QueryString["Offline"] == "True") { sqlOffline = "select l.userid as [User], case when rem_battery>0 then ltrim(rtrim(rem_battery)) + '%' when rem_battery<0 then '0%' end as [Battery Remaining],'LocatorOne_1.aspx?userid=' + l.userid as [View On Map], substring(B_date,4,3) + substring(B_date,1,2)+ substring(B_date,6,5) + ' ' + L_time as [Last Updated On] from location l inner join users u on l.userid=u.userid where B_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(B_date,'/','-') + ' ' + l_time) < -60 and u.status<>'DEL' and RM like '" + Session["Sess_username"] + "' and role in ('AO','DE')"; } else if (Request.QueryString["Battery"] == "True") { sqlOffline = "select l.userid as [User],case when rem_battery>0 then ltrim(rtrim(rem_battery)) + '%' when rem_battery<0 then '0%' end as [Battery Remaining],'LocatorOne_1.aspx?userid=' + l.userid as [View On Map], substring(B_date,4,3) + substring(B_date,1,2)+ substring(B_date,6,5) + ' ' + L_time as [Last Updated On] from location l inner join users u on l.userid=u.userid where B_date<>'' and Rem_Battery<=5 and u.status<>'DEL' and RM like '" + Session["Sess_username"] + "' and role in ('AO','DE')"; } bucket.BindGrid(GridView1, sqlOffline); GridView1.AllowPaging = false; GridView1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { //SqlConnection con=new SqlConnection(); //SqlDataCommand cmd= string sql1 = "update location set L_date='07/14/2014',L_time='12:54' where ISDATE(L_date)<>1"; bucket.ExecuteQuery(sql1); try { if (Session["sess_role"].ToString().Contains("RO")) { Response.Redirect("CurrentAuditRO.aspx"); } else { } } catch { Response.Redirect("login.aspx"); } string qOnline = "select count(*) as 'online' from location l,users u where l.userid=u.userid and u.oc='cad' and l_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(L_date,'/','-') + ' ' + l_time) > -60"; string[] aonline = bucket.verifyReader(qOnline, "online"); lbl_Online.Text = aonline[0]; string qOffline = "select count(*) as 'offline' from location l,users u where l.userid=u.userid and u.oc='cad' and l_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(L_date,'/','-') + ' ' + l_time) < -60"; string[] aOffline = bucket.verifyReader(qOffline, "offline"); lbl_Offline.Text = aOffline[0]; string qBatteryLow = "select count(*) as 'BL' from location l,users u where l.userid=u.userid and u.oc='cad' and l_date<>'' and Rem_Battery<=5"; string[] aBatteryLow = bucket.verifyReader(qBatteryLow, "BL"); lbl_Battery.Text = aBatteryLow[0]; if (Request.QueryString.ToString() != "") { if (Session["role"].ToString().Contains("Cadbury")) { string sqlOffline = null; if (Request.QueryString["Online"] == "True") { sqlOffline = "select l.userid as [User], case when rem_battery>0 then ltrim(rtrim(rem_battery)) + '%' when rem_battery<0 then '0%' end as [Battery Remaining],'LocatorOne.aspx?userid=' + l.userid as [View On Map], substring(L_Date,4,3) + substring(L_Date,1,2)+ substring(L_Date,6,5) + ' ' + L_time as [Last Updated On] from location L join users u on l.userid=u.userid where u.oc='cad' and l_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(L_date,'/','-') + ' ' + l_time) > -60"; } else if (Request.QueryString["Offline"] == "True") { sqlOffline = "select l.userid as [User], case when rem_battery>0 then ltrim(rtrim(rem_battery)) + '%' when rem_battery<0 then '0%' end as [Battery Remaining],'LocatorOne.aspx?userid=' + l.userid as [View On Map], substring(L_Date,4,3) + substring(L_Date,1,2)+ substring(L_Date,6,5) + ' ' + L_time as [Last Updated On] from location L join users u on l.userid=u.userid where u.oc='cad' and l_date<>'' and Rem_Battery>5 and DATEDIFF(MINUTE,CONVERT(VARCHAR(19), GETDATE(),120),replace(L_date,'/','-') + ' ' + l_time) < -60"; } else if (Request.QueryString["Battery"] == "True") { sqlOffline = "select l.userid as [User],case when rem_battery>0 then ltrim(rtrim(rem_battery)) + '%' when rem_battery<0 then '0%' end as [Battery Remaining],'LocatorOne.aspx?userid=' + l.userid as [View On Map], substring(L_Date,4,3) + substring(L_Date,1,2)+ substring(L_Date,6,5) + ' ' + L_time as [Last Updated On] from location L join users u on l.userid=u.userid where u.oc='cad' and l_date<>'' and Rem_Battery<=5 "; } // Response.Write(sqlOffline); bucket.BindGrid(GridView1, sqlOffline); GridView1.AllowPaging = false; GridView1.DataBind(); } } }
protected void btn_go_Click(object sender, EventArgs e) { ibuckethead bucket = new ibuckethead(); string username = bucket.cleanText(txt_login); string pwd = bucket.cleanText(txt_pwd); string q1 = ""; string[] a1; Session["sess_Date"] = ""; q1 = "Select userid,password,role,username,status from users where userid='" + username + "'"; a1 = bucket.verifyReader(q1, "userid", "password", "role", "username", "status"); if (a1[4].Trim() == "DEL") { Response.Write("<script>alert('User deactivated')</script>"); } else if (username != "" || pwd != "") { try { if (a1[0].Trim() == username && a1[1].Trim() == pwd) { Session["sess_userid"] = a1[0]; Session["sess_role"] = a1[2]; if (Session["sess_role"].ToString() == "admin") { Session["sess_userid"] = a1[0]; Session["sess_role"] = a1[2]; Session["sess_username"] = a1[3]; Response.Redirect("FieldTracker.aspx?Offline=True"); } else if (Session["sess_role"].ToString() == "RCM") { Session["sess_userid"] = a1[0]; Session["sess_role"] = a1[2]; Session["sess_username"] = a1[3]; Response.Redirect("RCM/FieldTracker.aspx?Offline=True"); } else if (Session["sess_role"].ToString() == "RM") { Session["sess_userid"] = a1[0]; Session["sess_role"] = a1[2]; Session["sess_username"] = a1[3]; Response.Redirect("RM/FieldTracker.aspx?Offline=True"); } else if (Session["sess_role"].ToString() == "CH") { Session["sess_userid"] = a1[0]; Session["sess_role"] = a1[2]; Session["sess_username"] = a1[3]; Response.Redirect("CH/FieldTracker.aspx?Offline=True"); } else if (Session["sess_role"].ToString() == "BANK") { Session["sess_userid"] = a1[0]; Session["sess_role"] = a1[2]; Session["sess_username"] = a1[3]; Response.Redirect("bank/currentaudit1.aspx"); } else { Response.Write("<script>alert('Login Restricted.')</script>"); } } else { Response.Write("<script>alert('Invalid userid or password.')</script>"); } } catch { Response.Write("<script>alert('Invalid userid or password.')</script>"); } } else { Response.Write("<script>alert('Invalid userid or password.')</script>"); } }