Пример #1
0
 protected void btnAddItem_Click(object sender, EventArgs e)
 {
     XObjs.XPartner x = new XObjs.XPartner {
         xname = this.a_xname.Text,
         cname = this.a_cname.Text,
         xreg_date = this.xreg_date,
         xvisible = "1",
         xsync = this.a_xsync.Text,
         xpassword = this.a_xpass.Text,
         nationality = "160",
         addressID = "0",
         sys_ID = ""
     };
     int num = this.reg.addXpayPartner(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 = "rp";
     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_m.aspx");
 }
Пример #2
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.XPartner partner = new XObjs.XPartner {
             xname = this.e_xname.Text,
             cname = this.e_cname.Text
         };
         int num = this.reg.updateMerchant(this.c_x.xid, this.c_x.xmemberID, this.c_x.xemail, this.c_x.xmobile, this.c_x.xpass, partner.xname, partner.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_m.aspx");
     }
 }
Пример #3
0
 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("rp");
         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.XPartner partner = new XObjs.XPartner();
                 partner = this.ret.getPartnerByID(item.xmemberID);
                 item.xname = partner.xname;
                 item.cname = partner.cname;
                 item.xpassword = pwallet.xpass;
                 item.nationality = partner.nationality;
                 item.addressID = partner.addressID;
                 item.sys_ID = partner.sys_ID;
                 item.xvisible = partner.xvisible;
                 item.xsync = partner.xsync;
                 item.xreg_date = partner.xreg_date;
                 if (item.xvisible == "1")
                 {
                     this.lt_m.Add(item);
                 }
                 this.x_cnt = this.lt_x.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;
         }
     }
 }
Пример #4
0
 public XObjs.XPartner getPartnerByID(string xid)
 {
     XObjs.XPartner partner = new XObjs.XPartner();
     SqlConnection connection = new SqlConnection(hf.ConnectXpay());
     SqlCommand command = new SqlCommand("SELECT * FROM xpartner WHERE xid='" + xid + "' ", connection);
     connection.Open(); command.CommandTimeout = 0;
     SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
     while (reader.Read())
     {
         partner.xid = reader["xid"].ToString();
         partner.xname = reader["xname"].ToString();
         partner.cname = reader["cname"].ToString();
         partner.xpassword = reader["xpassword"].ToString();
         partner.nationality = reader["nationality"].ToString();
         partner.addressID = reader["addressID"].ToString();
         partner.sys_ID = reader["sys_ID"].ToString();
         partner.xreg_date = reader["xreg_date"].ToString();
         partner.xvisible = reader["xvisible"].ToString();
         partner.xsync = reader["xsync"].ToString();
     }
     reader.Close();
     return partner;
 }