コード例 #1
0
ファイル: AddAtms.aspx.cs プロジェクト: Transonikhil/Mphasis
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            ibuckethead bucket = new ibuckethead();

            string atm          = bucket.cleanText(txt_atm);
            string location     = bucket.cleanText(txt_location);
            string addressLine1 = bucket.cleanText(txt_addressline1);
            string addressLine2 = bucket.cleanText(txt_addressline2);
            string city         = bucket.cleanText(txt_City);;
            string pinCode      = bucket.cleanText(txt_Pin);
            string state        = bucket.cleanText(txt_state);
            string bank         = bucket.cleanText(txt_bank);
            string customer     = bucket.cleanText(txt_customer);
            string siteNumber   = bucket.cleanText(txt_sitenumber);

            string status = null;

            if (rdb_active.Checked)
            {
                status = "Active";
            }
            else if (rdb_inactive.Checked)
            {
                status = "Inactive";
            }

            if (atm == "NA")
            {
                checkErr(user_err, txt_atm);
            }
            else if (location == "NA")
            {
                checkErr(user_err0, txt_location);
            }
            else if (bank == "NA")
            {
                checkErr(user_err1, txt_bank);
            }
            else if (customer == "NA")
            {
                checkErr(user_err2, txt_customer);
            }
            else
            {
                string q = @"insert into ATMs(atmid, location, bankid, sitenumber, client, status, addressline1, addressline2, city, pin, state) values
                        ('" + atm + "','" + location + "','" + bank + "','" + siteNumber + "','" + customer + "','" + status + "','" + addressLine1 + "','" + addressLine2 + "','" + city + "','" + pinCode + "','" + state + "')";

                if (bucket.ExecuteQuery(q) == "Success")
                {
                    Response.Redirect("Atms.aspx");
                }
                else
                {
                    Response.Write("Error");
                }
            }
        }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: Transonikhil/Mphasis
        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 CH like '" + Session["Sess_username"] + "' and atmstatus<>'Inactive'";

            string[] a1 = bucket.verifyReader(q1, "atmid");

            lbl_siteassigned.Text = a1[0];
        }
コード例 #3
0
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            string atm          = bucket.cleanText(txt_atm);
            string location     = bucket.cleanText(txt_location);
            string addressLine1 = bucket.cleanText(txt_addressline1);
            string addressLine2 = bucket.cleanText(txt_addressline2);
            string city         = bucket.cleanText(txt_City);;
            string pinCode      = bucket.cleanText(txt_Pin);
            string state        = bucket.cleanText(txt_state);
            string bank         = bucket.cleanText(txt_bank);
            string customer     = bucket.cleanText(txt_customer);
            string siteNumber   = bucket.cleanText(txt_sitenumber);

            string status = null;

            if (rdb_active.Checked)
            {
                status = "Active";
            }
            else if (rdb_inactive.Checked)
            {
                status = "Inactive";
            }

            if (atm == "NA")
            {
                checkErr(user_err, txt_atm);
            }
            else if (location == "NA")
            {
                checkErr(user_err0, txt_location);
            }
            else if (bank == "NA")
            {
                checkErr(user_err1, txt_bank);
            }
            else if (customer == "NA")
            {
                checkErr(user_err2, txt_customer);
            }
            else
            {
                string q = "Update ATMs set atmid='" + atm + "', location='" + location + "', bankid='" + bank + "', sitenumber='" + siteNumber + "', client='" + customer + "', status='" + status + "', addressline1='" + addressLine1 + "', addressline2='" + addressLine2 + "', city='" + city + "', pin='" + pinCode + "', state='" + state + "' where atmid='" + Request.QueryString["atmid"] + "'";

                if (bucket.ExecuteQuery(q) == "Success")
                {
                    Response.Redirect("Atms.aspx");
                }
                else
                {
                    Response.Write("Error");
                }
            }
        }
コード例 #4
0
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            string exe = "Delete from dr_ctp where isdate(vdate)<>1";

            bucket.ExecuteQuery(exe);

            if (Page.IsPostBack)
            {
                //UpdatePanel1.Update();
            }
        }
コード例 #5
0
        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 bankid='TAMILNAD MERCANTILE BANK LIMITED' and atmstatus<>'Inactive'";

            string[] a1 = bucket.verifyReader(q1, "atmid");

            lbl_siteassigned.Text = a1[0];
        }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         string q1 = "delete from dr_ctp where ISDATE(vdate)<>1";
         bucket.ExecuteQuery(q1);
     }
     catch (Exception ex)
     {
     }
     AGS(); FSS(); Euronet(); PRIZM(); HDFC(); TCPSL();
 }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string query = "delete from DR_ctp where isdate(vdate)<>1";

            bucket.ExecuteQuery(query);

            txtfromdate_CalendarExtender.EndDate   = Convert.ToDateTime(DateTime.Now.Date.ToString("MM/dd/yyyy"));
            txttodate_CalendarExtender.EndDate     = Convert.ToDateTime(DateTime.Now.Date.ToString("MM/dd/yyyy"));
            txtfromdate_CalendarExtender.StartDate = Convert.ToDateTime("11/09/2014");
            txttodate_CalendarExtender.StartDate   = Convert.ToDateTime("11/09/2014");

            txtfromdate.Attributes.Add("Readonly", "true");
            txttodate.Attributes.Add("Readonly", "true");

            if (!IsPostBack)
            {
                txtfromdate.Text = txttodate.Text = System.DateTime.Now.ToString("MM/dd/yyyy");
            }
            timer_Tick(sender, e);
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string query = "delete from DR_ctp where isdate(vdate)<>1";

            bucket.ExecuteQuery(query);
        }
コード例 #9
0
ファイル: ViewUser.aspx.cs プロジェクト: Transonikhil/Mphasis
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            string userid   = bucket.cleanText(txt_user);
            string password = bucket.cleanText(txt_password);
            string role     = bucket.cleanText(txt_Role);
            string ao       = bucket.cleanText(txt_AO);
            string oc       = bucket.cleanText(txt_oc);
            string fc       = bucket.cleanText(txt_fc);
            string om       = bucket.cleanText(txt_OM);
            string status   = null;

            if (rdb_active.Checked)
            {
                status = "Active";
            }
            else if (rdb_inactive.Checked)
            {
                status = "Inactive";
            }

            if (userid == "NA")
            {
                checkErr(user_err, txt_user);
            }
            else if (password == "NA")
            {
                checkErr(Panel1, txt_password);
            }
            else if (role == "NA")
            {
                checkErr(Panel2, txt_Role);
            }
            else if (ao == "NA")
            {
                checkErr(Panel3, txt_AO);
            }
            else if (oc == "NA")
            {
                checkErr(Panel4, txt_oc);
            }
            else if (fc == "NA")
            {
                checkErr(Panel5, txt_fc);
            }
            else if (om == "NA")
            {
                checkErr(Panel6, txt_OM);
            }
            else
            {
                Response.Write("Reached.");

                string q1 = "update users set userid='" + userid + "', password='******', role='" + role + "', ao='" + ao + "', oc='" + oc + "', fc='" + fc + "', om='" + om + "', status='" + status + "' where userid='" + Request.QueryString["userid"] + "'";

                if (bucket.ExecuteQuery(q1) == "Success")
                {
                    Response.Redirect("Users.aspx");
                }
                else
                {
                    Response.Write("Error");
                }
            }
        }
コード例 #10
0
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            ibuckethead bucket = new ibuckethead();

            string userid   = bucket.cleanText(txt_user);
            string password = bucket.cleanText(txt_password);
            string role     = bucket.cleanText(txt_Role);
            string ao       = bucket.cleanText(txt_AO);
            string oc       = bucket.cleanText(txt_oc);
            string fc       = bucket.cleanText(txt_fc);
            string om       = bucket.cleanText(txt_OM);
            string status   = null;

            if (rdb_active.Checked)
            {
                status = "Active";
            }
            else if (rdb_inactive.Checked)
            {
                status = "Inactive";
            }

            if (userid == "NA")
            {
                checkErr(user_err, txt_user);
            }
            else if (password == "NA")
            {
                checkErr(Panel1, txt_password);
            }
            else if (role == "NA")
            {
                checkErr(Panel2, txt_Role);
            }
            else if (ao == "NA")
            {
                checkErr(Panel3, txt_AO);
            }
            else if (oc == "NA")
            {
                checkErr(Panel4, txt_oc);
            }
            else if (fc == "NA")
            {
                checkErr(Panel5, txt_fc);
            }
            else if (om == "NA")
            {
                checkErr(Panel6, txt_OM);
            }
            else
            {
                Response.Write("Reached.");

                string q1 = @"insert into sa_ma3.users(userid, password, role, ao, oc, fc, om, status, datastatus) values 
                    ('" + userid + "','" + password + "','" + role + "','" + ao + "','" + oc + "','" + om + "','" + fc + "','" + status + "','CRE')";

                if (bucket.ExecuteQuery(q1) == "Success")
                {
                    Response.Redirect("Users.aspx");
                }
                else
                {
                    Response.Write("Error");
                }
            }
        }
コード例 #11
0
        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();
                }
            }
        }