Esempio n. 1
0
        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");
                }
            }
        }
Esempio n. 2
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");
                }
            }
        }
Esempio n. 3
0
        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");
                }
            }
        }
Esempio n. 4
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");
                }
            }
        }
Esempio n. 5
0
        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>");
            }
        }