protected void btnRegister_Click(object sender, EventArgs e)
        {
            phoneNum = txtPhoneNum.Text;
            email = txtEmail.Text;
            description = txtDescription.Text;
            url = txtURL.Text;
            email = txtEmail.Text;
            sID = txtSiteID.Text;
            lblAPI.Text = "";
            merchant m = new merchant();
            APIkey = m.apiGenerator().ToString();
            Boolean keyFound = m.checkAPIExist(APIkey);
            while (keyFound == true)
            {
                APIkey = m.apiGenerator().ToString();
                keyFound = m.checkAPIExist(APIkey);
            }
            lblAPI.Text = APIkey;

            //construct customerInfo object to pass into webservice webmthod (registerSite)
                merchant newMerch = new merchant(txtGroupMember1.Text, txtGroupMember2.Text, phoneNum);

            //check if merchant exists by siteID and return either true or false depending on if
            //it has been added
                if (pxy.RegisterSite(sID, description, APIkey, email, m.contactInfo(newMerch)) == false)
                {
                    lblMerchantAdded.Text = "Merchant seems to already exist. Try again!";
                }
                else
                    lblMerchantAdded.Text = "Merchant Added Successfully. Please take note of your API Key!";
        }
 protected void gvTransaction_SelectedIndexChanged(object sender, EventArgs e)
 {
     int transactionId = Convert.ToInt32(gvTransaction.SelectedRow.Cells[0].Text);
      loginId = Convert.ToInt32(Session["loginId"].ToString());
      merchant merchantObj = new merchant(loginId);
      DataSet merchantTransactionDetail = merchantObj.MerchantTransactionDetails(transactionId);
      gvTransactionDetails.DataSource = merchantTransactionDetail;
      gvTransactionDetails.DataBind();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["loginId"] != null)
            {
                loginId = Convert.ToInt32(Session["loginId"].ToString());

                merchant merchant = new merchant(loginId);
                string apiKey = merchant.key;
                string siteId = merchant.merchURL;
                DataSet dataSetMerchantTransaction = merchant.MerchantTransaction(siteId, apiKey);
                gvTransaction.DataSource = dataSetMerchantTransaction;
                gvTransaction.DataBind();
            }
            else
                Response.Redirect("LoginPage.aspx");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int merchantId = 1;
               if (Session["email"] != null)
               {
               string email = Session["email"].ToString();

               merchant merchantObj = new merchant(merchantId);

               lblMember1.Text = merchantObj.Member1;
               lblMmb2.Text = merchantObj.Member2;
               lblPhone.Text = merchantObj.PhoneNum;
               lblDescription.Text = merchantObj.Description;
               lblApiKey.Text = merchantObj.key;

               }
        }
Example #5
0
        public object[] contactInfo(merchant m)
        {
            object[] contactInfo = new object[3];
            contactInfo[0] = m.groupMemberName1;
            contactInfo[1] = m.groupMemberName2;
            contactInfo[2] = m.phoneNumber;

            return contactInfo;
        }