protected void btnAddItem_Click(object sender, EventArgs e) { XObjs.XMember x = new XObjs.XMember { xname = this.a_xname.Text, cname = this.a_cname.Text, xreg_date = this.xreg_date, xvisible = "1", xsync = "0", xpassword = this.a_xpass.Text, nationality = "160", addressID = "0", sys_ID = "" }; int num = this.reg.addXpayAdmin(x); this.c_x.xemail = this.a_xemail.Text; this.c_x.xmobile = this.a_xmobile.Text; this.c_x.xmemberID = num.ToString(); this.c_x.xmembertype = "rx"; this.c_x.xpass = this.a_xpass.Text; this.c_x.reg_date = this.xreg_date; num = this.reg.addPwallet(this.c_x); StringBuilder builder = new StringBuilder(); if (num > 0) { builder.Append("<tr><td style=\"text-align:center;\" colspan=\"2\"><img alt=\"Success\" class=\"style2\" src=\"../images/check.png\" width=\"48px\" height=\"48px\" /><br /><strong>RECORD ADDED SUCCESSFULLY!!</strong></td></tr>"); } else { builder.Append("<tr><td style=\"text-align:center;\" colspan=\"2\"><img alt=\"Error\" class=\"style2\" src=\"../images/delete.png\" width=\"48px\" height=\"48px\" /><br /><strong>RECORD NOT ADDED SUCCESSFULLY!!</strong></td></tr>"); } this.Session["x_msg"] = builder.ToString(); base.Response.Redirect("./m_a.aspx"); }
public XObjs.XMember getAdminByID(string xid) { XObjs.XMember member = new XObjs.XMember(); SqlConnection connection = new SqlConnection(hf.ConnectXpay()); SqlCommand command = new SqlCommand("SELECT * FROM xadmin WHERE xid='" + xid + "' ", connection); connection.Open();command.CommandTimeout = 0; SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { member.xid = reader["xid"].ToString(); member.xname = reader["xname"].ToString(); member.cname = reader["cname"].ToString(); member.xpassword = reader["xpassword"].ToString(); member.nationality = reader["nationality"].ToString(); member.addressID = reader["addressID"].ToString(); member.sys_ID = reader["sys_ID"].ToString(); member.xreg_date = reader["xreg_date"].ToString(); member.xvisible = reader["xvisible"].ToString(); member.xsync = reader["xsync"].ToString(); } reader.Close(); return member; }
protected void Page_Load(object sender, EventArgs e) { if ((this.Session["pwalletID"] != null) && (this.Session["pwalletID"].ToString() != "")) { this.adminID = this.Session["pwalletID"].ToString(); } else { base.Response.Redirect("../login.aspx"); } if (!base.IsPostBack) { this.Session["XPayMemberType"] = null; this.Session["grand_tot_cnt"] = null; this.lt_x = this.ret.getPwalletByMemberType("rx"); this.Session["grand_tot_cnt"] = this.lt_x.Count; if (this.lt_x.Count > 0) { foreach (XObjs.Pwallet pwallet in this.lt_x) { XObjs.Merchant item = new XObjs.Merchant { xid = pwallet.xid, xmembertype = pwallet.xmembertype, xmemberID = pwallet.xmemberID, xemail = pwallet.xemail, xmobile = pwallet.xmobile, xpass = pwallet.xpass, reg_date = pwallet.reg_date }; XObjs.XMember member = new XObjs.XMember(); member = this.ret.getAdminByID(item.xmemberID); item.xname = member.xname; item.cname = member.cname; item.xpassword = pwallet.xpass; item.nationality = member.nationality; item.addressID = member.addressID; item.sys_ID = member.sys_ID; item.xvisible = member.xvisible; item.xsync = member.xsync; item.xreg_date = member.xreg_date; if (item.xvisible == "1") { this.lt_m.Add(item); } this.x_cnt = this.lt_m.Count; this.Session["x_cnt"] = this.x_cnt; } this.Session["lt_m"] = this.lt_m; this.gvX.DataSource = this.lt_m; this.gvX.DataBind(); this.gvX.Columns[8].Visible = false; this.gvX.Columns[9].Visible = false; this.show_inv = 1; this.show_edit = 0; this.show_add = 0; } } }
protected void btnEditItem_Click(object sender, EventArgs e) { if ((((this.Session["e_xid"] != null) && (this.Session["e_xid"].ToString() != "")) && (this.Session["e_mem_id"] != null)) && (this.Session["e_mem_id"].ToString() != "")) { this.c_x.xid = this.Session["e_xid"].ToString(); this.c_x.xmemberID = this.Session["e_mem_id"].ToString(); this.c_x.xpass = this.e_xpass.Text; this.c_x.xmobile = this.e_xmobile.Text; this.c_x.xemail = this.e_xemail.Text; XObjs.XMember member = new XObjs.XMember { xname = this.e_xname.Text, cname = this.e_cname.Text }; int num = this.reg.updateAdmin(this.c_x.xid, this.c_x.xmemberID, this.c_x.xemail, this.c_x.xmobile, this.c_x.xpass, member.xname, member.cname); StringBuilder builder = new StringBuilder(); if (num > 0) { builder.Append("<tr><td style=\"text-align:center;\" colspan=\"2\"><img alt=\"Success\" class=\"style2\" src=\"../images/check.png\" width=\"48px\" height=\"48px\" /><br /><strong>RECORD EDITED SUCCESSFULLY!!</strong></td></tr>"); } else { builder.Append("<tr><td style=\"text-align:center;\" colspan=\"2\"><img alt=\"Error\" class=\"style2\" src=\"../images/delete.png\" width=\"48px\" height=\"48px\" /><br /><strong>RECORD NOT EDITED SUCCESSFULLY!!</strong></td></tr>"); } this.Session["x_msg"] = builder.ToString(); base.Response.Redirect("./m_a.aspx"); } }