protected void grid_Equivalency_DataBound(object sender, EventArgs e) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); foreach (GridViewRow row in grid_Equivalency.Rows) { //url HyperLink url = (HyperLink)row.FindControl("HyperLink1"); Label equi_id = (Label)row.FindControl("equi_id"); url.NavigateUrl = "~/secure/UsEquivalency/Update_Us_Equivalency.aspx?eqlid=" + equi_id.Text.ToString() + "&search=" + searchbox.Text; //tooltip int limit = Convert.ToInt32(app.deslimit); Label lblcdes = (Label)row.FindControl("lbldes"); string clientdes = (System.Text.RegularExpressions.Regex.Replace(Server.HtmlDecode(lblcdes.Text), @"<[^>]*>", string.Empty)).Replace(" ", ""); if (clientdes.Length > limit) { lblcdes.Text = clientdes.Substring(0, limit) + "..."; } else { lblcdes.Text = clientdes; } lblcdes.ToolTip = clientdes; } }
protected void equivalency_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); DropDownList equidp = (DropDownList)sender; switch (Session["Admin_Type"].ToString()) { case "USER": Boolean result = getRecommendation(equidp); ClientAdmin.Utility.GetEquivalency(equidp, Session["ClientId"].ToString(), app.AdminId, result); if (Session["Lid"].ToString() != "0") { equidp.SelectedValue = ClientAdmin.Utility.DetailsView_Linkageselect(Session["Lid"].ToString(), "Equi"); } break; case "ADMIN": break; default: Response.Redirect("~/Fail.aspx"); break; } } }
protected void gradescale_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); DropDownList gradedp = (DropDownList)sender; switch (Session["Admin_Type"].ToString()) { case "USER": ClientAdmin.Utility.GetGradescale(gradedp, Session["ClientId"].ToString(), app.AdminId, Session["Cid"].ToString()); if (Session["Lid"].ToString() != "0") { gradedp.SelectedValue = ClientAdmin.Utility.DetailsView_Linkageselect(Session["Lid"].ToString(), "grade"); } break; case "ADMIN": break; default: Response.Redirect("~/Fail.aspx"); break; } } }
protected void populatedata() { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); //client QuickappService.GetSubclients(dpsubclients, Convert.ToInt32(Session["Admin_Customer"].ToString()), false); //purpose QuickappService.GetPurposeList(dppurpose); //info QuickappService.Getmonth(drp_month); QuickappService.Getdate(drp_date); QuickappService.Getyear(drp_year, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear), false); QuickappService.Getcountry(drpcountry); QuickappService.Getcountry(drpcountrybirth); //upper QuickappService.Getcountry(drp_upper_country); QuickappService.Getyear(drp_upper_startdate, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear), false); //post QuickappService.Getcountry(drp_post_country); QuickappService.Getyear(drp_post_startdate, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear), false); DataTable dt = new DataTable(); //grid gvbind(GridView_UpperEdu, dt, "UpperEdu-header", true); gvbind(GridView_PostEdu, dt, "PostEdu-header", true); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); DropDownList countrydp = (DropDownList)DetailsView_Degree.FindControl("countrydp"); DropDownList dp = (DropDownList)DetailsView_Degree.FindControl("equivalency"); switch (Session["Admin_Type"].ToString()) { case "USER": ClientAdmin.Utility.Getcountry(countrydp, Session["Admin_Customer"].ToString()); ClientAdmin.Utility.GetEquivalency(dp, Session["Admin_Customer"].ToString(), app.AdminId, false); break; case "ADMIN": MasterAdmin.Utility.Getcountry(countrydp, Session["Customer_id"].ToString()); MasterAdmin.Utility.GetEquivalency(dp, Session["Customer_id"].ToString(), Session["Admin_Customer"].ToString()); break; default: Response.Redirect("~/Fail.aspx"); break; } } }
protected void Page_Load(object sender, EventArgs e) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); //track buttons SetDefaultButton(this.Page, frma1_institution, frma1_btn_submit); SetDefaultButton(this.Page, frma1_degree, frma1_btn_submit); SetDefaultButton(this.Page, frma1_city, frma1_btn_submit); SetDefaultButton(this.Page, frma1_state, frma1_btn_submit); if (!Page.IsPostBack) { ClientAdmin.Utility.Getcountry(frma1_opt_country); ClientAdmin.Utility.Getyear(frma1_year, Convert.ToInt32(app.Endyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getyear(frma1_start_year, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getyear(frma1_end_year, Convert.ToInt32(app.Endyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getmonth(frma1_month); ClientAdmin.Utility.Getdate(frma1_date); //populate from db Session["id"] = Convert.ToInt32(Request.QueryString["id"].ToString()); ClientAdmin.Utility.GetHighschooldata(frma1_opt_country, frma1_option_degree, frma1_city, frma1_state, frma1_start_year, frma1_end_year, frma1_option_graduate, frma1_month, frma1_date, frma1_year, frma1_institution, Convert.ToInt32(Session["id"].ToString())); //action based on country selected_country("old"); //action based on graduate selected_graduate(); //wait process frma1_opt_country.Attributes.Add("onchange", "Loading(true);"); frma1_btn_clear.Attributes.Add("onClick", "Loading(true);"); frma1_btn_submit.Attributes.Add("onClick", "Loading(true);"); frma1_option_degree.Attributes.Add("onchange", "Loading(true);"); frma1_option_graduate.Attributes.Add("onchange", "Loading(true);"); } }
protected void Page_Load(object sender, EventArgs e) { //track buttons SetDefaultButton(this.Page, frma1_institution, frma1_btn_submit); SetDefaultButton(this.Page, frma1_degree, frma1_btn_submit); SetDefaultButton(this.Page, frma1_city, frma1_btn_submit); SetDefaultButton(this.Page, frma1_state, frma1_btn_submit); if (!Page.IsPostBack) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); ClientAdmin.Utility.Getcountry(frma1_opt_country); ClientAdmin.Utility.Getyear(frma1_year, Convert.ToInt32(app.Endyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getyear(frma1_start_year, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getyear(frma1_end_year, Convert.ToInt32(app.Endyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getmonth(frma1_month); ClientAdmin.Utility.Getdate(frma1_date); //wait process frma1_opt_country.Attributes.Add("onchange", "Loading(true);"); frma1_btn_clear.Attributes.Add("onClick", "Loading(true);"); frma1_btn_submit.Attributes.Add("onClick", "Loading(true);"); frma1_option_degree.Attributes.Add("onchange", "Loading(true);"); frma1_option_graduate.Attributes.Add("onchange", "Loading(true);"); } }
protected void frma2_start_year_SelectedIndexChanged(object sender, EventArgs e) { if (frma2_start_year.SelectedValue.ToString() != "") { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); frma2_year.Items.Clear(); frma2_end_year.Items.Clear(); ClientAdmin.Utility.Getyear(frma2_year, Convert.ToInt32(frma2_start_year.SelectedValue.ToString()), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getyear(frma2_end_year, Convert.ToInt32(frma2_start_year.SelectedValue.ToString()), Convert.ToInt32(app.Endyear)); } }
private void Page_Control_Initialization() { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); #region personalinfo ClientAdmin.Utility.Getmonth(frm1_option_month); ClientAdmin.Utility.Getdate(frm1_option_date); ClientAdmin.Utility.Getyear(frm1_option_year, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getcountry(frm1_option_country); ClientAdmin.Utility.Getcountry(frm1_Country_birth); frm1_summary.HeaderText = ""; #endregion }
// For demo purpose the timeout is set to a smaller value. //Remember The Javascript setTimeout works in milliseconds. protected void InjectSessionExpireScript( ) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); int sessiontime = Convert.ToInt32(app.SessionTime); string script = "<script> \n" + "function expireSession(){ \n" + " window.location = '" + "Timeout.aspx" + "'}\n" + "setTimeout('expireSession()', " + sessiontime * 60 * 1000 + " ); \n" + "</script>"; this.Page.RegisterClientScriptBlock("expirescript", script); }
private void Page_Control_Initialization() { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); #region personalinfo ClientAdmin.Utility.Getmonth(frm1_option_month); ClientAdmin.Utility.Getdate(frm1_option_date); ClientAdmin.Utility.Getyear(frm1_option_year, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear)); ClientAdmin.Utility.Getcountry(frm1_option_country); ClientAdmin.Utility.Getcountry(frm1_Country_birth); #endregion #region DefaultTabLoad nav1holder.Attributes.Add("class", "current"); personalinfotab.Visible = true; #endregion }
public static int AddNew_major(string Name, int Country_ID, string customer) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); int major_id; string query = "SELECT Id FROM cc_masterdataset.major WHERE (Country_ID = " + Country_ID + ") AND (Name = '" + Name.Replace("'", "''") + "')AND ((Customer_Id=" + Convert.ToInt32(customer.ToString()) + ") or (Customer_Id=" + app.AdminId + "))"; int result = GetDataSet_reader(query); if (result == 0) { query = "INSERT INTO cc_masterdataset.major(Name, Country_ID,Confirmed,Customer_Id,Category,EquiMajor_id) VALUES ('" + Name.Replace("'", "''") + "'," + Country_ID + ",0,'" + customer.ToString() + "','Client',0)"; major_id = GetDataSet_withID(query); } else { major_id = result; } return(major_id); }
public void action() { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); switch (Session["Admin_Type"].ToString()) { case "USER": ClientAdmin.Utility.Grid_SearchGradescale(grid_Gradescale, searchbox.Text, Session["Admin_Customer"].ToString(), app.AdminId, searchoption1.SelectedItem.ToString()); break; case "ADMIN": MasterAdmin.Utility.Grid_SearchGradescale(grid_Gradescale, searchbox.Text, Session["Customer_id"].ToString(), Session["Admin_Customer"].ToString(), searchoption1.SelectedItem.ToString()); break; default: Response.Redirect("~/Fail.aspx"); break; } }
public Boolean getRecommendation(DropDownList equidp) { Boolean result = false; if (!Page.IsPostBack) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); switch (Session["Admin_Type"].ToString()) { case "USER": result = ClientAdmin.Utility.GetRecommendation(Session["Recordid"].ToString(), equidp, Session["ClientId"].ToString(), app.AdminId); break; case "ADMIN": break; default: Response.Redirect("~/Fail.aspx"); break; } } return(result); }
protected void Page_Load(object sender, EventArgs e) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); //track buttons SetDefaultButton(this.Page, frma2_institution, frma2_btn_submit); SetDefaultButton(this.Page, frma2_degree, frma2_btn_submit); SetDefaultButton(this.Page, frma2_major, frma2_btn_submit); SetDefaultButton(this.Page, frma2_city, frma2_btn_submit); SetDefaultButton(this.Page, frma2_state, frma2_btn_submit); if (!Page.IsPostBack) { Credentialpage.Utility.Getcountry(frma2_opt_country); Credentialpage.Utility.Getyear(frma2_year, Convert.ToInt32(app.Endyear), Convert.ToInt32(app.Endyear)); Credentialpage.Utility.Getyear(frma2_start_year, Convert.ToInt32(app.Startyear), Convert.ToInt32(app.Endyear)); Credentialpage.Utility.Getyear(frma2_end_year, Convert.ToInt32(app.Endyear), Convert.ToInt32(app.Endyear)); Credentialpage.Utility.Getmonth(frma2_month); Credentialpage.Utility.Getdate(frma2_date); //populate from db // Session["id"] = Convert.ToInt32(Request.QueryString["id"].ToString()); // Session["Customer_id"] = Convert.ToInt32(Request.QueryString["cid"].ToString()); Credentialpage.Utility.GetUniversitydata(frma2_opt_country, frma2_option_degree, frma2_city, frma2_state, frma2_start_year, frma2_end_year, frma2_option_graduate, frma2_month, frma2_date, frma2_year, frma2_institution, frma2_option_major, Convert.ToInt32(Request.QueryString["id"].ToString())); //action based on country selected_country("old"); //action based on graduate selected_graduate(); //wait process //frma2_opt_country.Attributes.Add("onchange", "ShowProcessMessage('ProcessingWindow')"); //frma2_btn_clear.Attributes.Add("onClick", "ShowProcessMessage('ProcessingWindow')"); //frma2_btn_submit.Attributes.Add("onClick", "ShowProcessMessage('ProcessingWindow')"); //frma2_option_degree.Attributes.Add("onchange", "ShowProcessMessage('ProcessingWindow')"); //frma2_option_graduate.Attributes.Add("onchange", "ShowProcessMessage('ProcessingWindow')"); //frma2_option_major.Attributes.Add("onchange", "ShowProcessMessage('ProcessingWindow')"); } }
protected void grid_Gradescale_DataBound(object sender, EventArgs e) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); switch (Session["Admin_Type"].ToString()) { case "USER": grid_Gradescale.Columns[4].Visible = false; break; case "ADMIN": grid_Gradescale.Columns[5].Visible = false; grid_Gradescale.Columns[6].Visible = true; foreach (GridViewRow row in grid_Gradescale.Rows) { if (row.RowType == DataControlRowType.DataRow) { ImageButton delete = ((ImageButton)row.FindControl("del")); HyperLink url = (HyperLink)row.FindControl("HyperLink1"); delete.Attributes.Add("onclick", "javascript:return " + "confirm('Are you sure you want to delete this Gradescale ?\\n \"" + url.Text + "\" ')"); } } break; default: Response.Redirect("~/Fail.aspx"); break; } foreach (GridViewRow row in grid_Gradescale.Rows) { //url HyperLink url = (HyperLink)row.FindControl("HyperLink1"); Label grade_id = (Label)row.FindControl("grade_id"); Label role = (Label)row.FindControl("Role"); url.NavigateUrl = "~/secure/Gradescale/Update_Gradescale.aspx?gid=" + grade_id.Text.ToString() + "&role=" + role.Text.ToString() + "&search=" + searchbox.Text + "&t1=" + searchoption1.SelectedIndex.ToString(); //tooltip int limit = Convert.ToInt32(app.deslimit); Label lblcdes = (Label)row.FindControl("lblclientdes"); string clientdes = (System.Text.RegularExpressions.Regex.Replace(Server.HtmlDecode(lblcdes.Text), @"<[^>]*>", string.Empty)).Replace(" ", ""); if (clientdes.Length > limit) { lblcdes.Text = clientdes.Substring(0, limit) + "..."; } else { lblcdes.Text = clientdes; } lblcdes.ToolTip = clientdes; Label lblades = (Label)row.FindControl("lbladmindes"); string admindes = (System.Text.RegularExpressions.Regex.Replace(Server.HtmlDecode(lblades.Text), @"<[^>]*>", string.Empty)).Replace(" ", ""); if (admindes.Length > limit) { lblades.Text = admindes.Substring(0, limit) + "..."; } else { lblades.Text = admindes; } lblades.ToolTip = admindes; //disable promote and promote Description ImageButton btndescription = (ImageButton)row.FindControl("btndescription"); ImageButton btngradescale = (ImageButton)row.FindControl("btngradescale"); ImageButton btnEnable = (ImageButton)row.FindControl("btn"); Label isEnable = (Label)row.FindControl("IsEnable"); if (isEnable.Text == "1") { btnEnable.ImageUrl = "~/secure/Code/button/Disable.png"; row.Cells[3].BackColor = System.Drawing.ColorTranslator.FromHtml("#E3E1D2"); } else { row.Cells[2].BackColor = System.Drawing.ColorTranslator.FromHtml("#E3E1D2"); } if (lblcdes.Text == "--") { btnEnable.Visible = false; btndescription.Enabled = false; btndescription.ImageUrl = "~/secure/Code/button/Desdisable.png"; } Label lblrole = (Label)row.FindControl("Role"); if (lblrole.Text != "Client") { btngradescale.Enabled = false; btngradescale.ImageUrl = "~/secure/Code/button/Gradisable.png"; } else { if (Session["Admin_Type"].ToString() == "ADMIN") { HyperLink linkname = (HyperLink)row.FindControl("HyperLink1"); linkname.NavigateUrl = ""; } //only client data btnEnable.Visible = false; row.Cells[2].BackColor = System.Drawing.Color.White; row.Cells[3].BackColor = System.Drawing.ColorTranslator.FromHtml("#E3E1D2"); btndescription.Enabled = false; btndescription.ImageUrl = "~/secure/Code/button/Desdisable.png"; } } }
protected void Page_Load(object sender, EventArgs e) { bool ClientIsValid = false; if (Request.QueryString["subdomain"] != null) { Subdomain = Request.QueryString["subdomain"].ToString(); } else { Subdomain = "nosubdomain"; } ClientIsValid = Authentication.Utility.ClientIsValid(Request.Url, Subdomain); //Client Check if (ClientIsValid) { int clientid = 0; Authentication.Utility.DomainAttributes dm = Authentication.Utility.GetClient(Request.Url, Subdomain); Authentication.Utility.SessionVariable sv = new Authentication.Utility.SessionVariable(); RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); if (dm.IsMultidomain) { Page.Title = dm.DmName; OrgTitle.InnerHtml = dm.DmName; Subclient.InnerHtml = "<static>Online Application for</static><br/>" + "<client>" + dm.SubDmName + "</client>"; sv.Customer_id = dm.DmID; sv.SubClient_id = dm.SubDmID; clientid = dm.SubDmID; } else { Page.Title = dm.DmName; OrgTitle.InnerHtml = dm.DmName; sv.Customer_id = dm.DmID; clientid = dm.DmID; Subclient.InnerHtml = "<static>Online Application</static>"; } Authentication.Utility.checklogo(dm.DmID, OrgTitle, logo); Session["Appsettings"] = app; Session["Clientsettings"] = dm; Session["SV"] = sv; // string listcontent = ""; // HtmlGenericControl listcontent = new HtmlGenericControl("div"); DataSet ds = Authentication.Utility.Splashpage(clientid); if (ds.Tables[0].Rows.Count > 0) { HtmlGenericControl accordion = new HtmlGenericControl("div"); accordion.Attributes.Add("id", "accordion"); //AppInstructions HtmlGenericControl title1 = new HtmlGenericControl("h3"); title1.InnerHtml = "<a href='#'>Instructions</a>"; accordion.Controls.Add(title1); HtmlGenericControl Instruction = new HtmlGenericControl("div"); Instruction.InnerHtml = ds.Tables[0].Rows[0]["AppInstructions"].ToString(); accordion.Controls.Add(Instruction); //OfflineApp Instructions if (Convert.ToBoolean(ds.Tables[0].Rows[0]["OfflineApp"].ToString())) { HtmlTable tb = new HtmlTable(); HtmlTableRow tr1 = new HtmlTableRow(); HtmlTableRow tr2 = new HtmlTableRow(); HtmlTableCell c1 = new HtmlTableCell(); HtmlTableCell c2 = new HtmlTableCell(); ImageButton imgbtn = new ImageButton(); imgbtn.Click += new ImageClickEventHandler(Downloadbtn_Click); imgbtn.ImageUrl = "~/Code/menu/pdf_icon.png"; imgbtn.Width = 42; imgbtn.Height = 42; imgbtn.AlternateText = clientid.ToString(); c1.Controls.Add(imgbtn); c2.InnerHtml = "Application.pdf"; tr1.Controls.Add(c1); c1.Align = "Center"; tr2.Controls.Add(c2); tb.Controls.Add(tr1); tb.Controls.Add(tr2); HtmlGenericControl Instruction2 = new HtmlGenericControl("span"); Instruction2.InnerHtml += "<b>Application</b><br/>" + ds.Tables[0].Rows[0]["OfflineAppInstructions"].ToString(); //"<table><tr><td style='text-align:center;' >" + //"<input type='image' name='ctl00$Content$imgbtn' alt='"+clientid+"' width='42px' Height='42px' id='ctl00_Content_imgbtn' src='Code/menu/pdf_icon.png' onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$Content$imgbtn", "", true, "", "", false, false))' style='border-width:0px;'><a href='Assets/OfflineApp/" + clientid + "/Application.pdf'><img src='Code/menu/pdf_icon.png' width='42px' Height='42px' /></a></td></tr> " + //"<tr><td>Application.pdf</td></tr></table>"; Instruction.Controls.Add(Instruction2); Instruction.Controls.Add(tb); } //BrowserInstructions HtmlGenericControl title2 = new HtmlGenericControl("h3"); title2.InnerHtml = "<a href='#'>Browser Instructions</a>"; accordion.Controls.Add(title2); HtmlGenericControl BrowserInstruction = new HtmlGenericControl("div"); BrowserInstruction.InnerHtml = ds.Tables[0].Rows[0]["BrowserInstructions"].ToString(); accordion.Controls.Add(BrowserInstruction); list.Controls.Add(accordion); //Online app if (ds.Tables[0].Rows[0]["OnlineApp"].ToString() != "1") { recaptchablk.Visible = false; } } //Application Type switch (dm.App_Type) { case 1: RedirectUrl = "~/Index.aspx"; break; case 2: RedirectUrl = "~/mIndex.aspx"; break; case 3: RedirectUrl = "~/nIndex.aspx"; break; } if (Subdomain != "nosubdomain") { RedirectUrl += "?subdomain=" + Subdomain; } } }
private bool AuthorizePayment() { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); if (Session["Customer_id"].ToString() != "0") { //transkey& loginID DataSet ds = Credentialpage.Utility.paymentcode(Session["Customer_id"].ToString()); if (ds.Tables[0].Rows.Count > 0) { string l1 = ds.Tables[0].Rows[0]["LoginId"].ToString(); string l2 = ds.Tables[0].Rows[0]["Transkey"].ToString(); string email = ds.Tables[0].Rows[0]["Email"].ToString(); string AuthNetVersion = "3.1"; // Contains CCV support string AuthNetLoginID = Credentialpage.Utility.base64Decode(l1); //"2bVa5VgR3p"; //Set your AuthNetLoginID here 411111111111111 string AuthNetTransKey = Credentialpage.Utility.base64Decode(l2); // "69fA3MXdxt8V7p7k"; // Get this from your authorize.net merchant interface //string AuthNetLoginID ="2bVa5VgR3p"; //Set your AuthNetLoginID here 411111111111111 //string AuthNetTransKey = "69fA3MXdxt8V7p7k"; // Get this from your authorize.net merchant interface WebClient webClientRequest = new WebClient(); System.Collections.Specialized.NameValueCollection InputObject = new System.Collections.Specialized.NameValueCollection(30); System.Collections.Specialized.NameValueCollection ReturnObject = new System.Collections.Specialized.NameValueCollection(30); byte[] ReturnBytes; string[] ReturnValues; string ErrorString; InputObject.Add("x_version", AuthNetVersion); InputObject.Add("x_delim_data", "True"); InputObject.Add("x_login", AuthNetLoginID); InputObject.Add("x_tran_key", AuthNetTransKey); InputObject.Add("x_relay_response", "False"); //----------------------Set to False to go Live-------------------- //InputObject.Add("x_test_request", "True");//demo // InputObject.Add("x_test_request", "False");//live InputObject.Add("x_test_request", app.Payment); //--------------------------------------------------------------------- InputObject.Add("x_delim_char", ","); InputObject.Add("x_encap_char", "|"); //Billing Address InputObject.Add("x_first_name", FirstNameTextBox.Text); InputObject.Add("x_last_name", LastNameTextBox.Text); InputObject.Add("x_phone", PhoneTextBox.Text); InputObject.Add("x_address", AddressTextBox.Text); InputObject.Add("x_city", CityTextBox.Text); InputObject.Add("x_state", StateTextBox.Text); InputObject.Add("x_zip", ZipTextBox.Text); InputObject.Add("x_email", EmailTextBox.Text); InputObject.Add("x_email_customer", "TRUE"); //Emails Customer InputObject.Add("x_merchant_email", email); //Emails Merchant InputObject.Add("x_country", CountryTextBox.Text); InputObject.Add("x_customer_ip", Request.UserHostAddress); //Store Customer IP Address //Amount InputObject.Add("x_description", "Transaction FileNo:" + Session["fno"].ToString() + " " + string.Format("{0:c2}", AmountTextBox.Text)); //Description of Purchase //Card Details InputObject.Add("x_card_num", CreditCardTextBox.Text); InputObject.Add("x_exp_date", MonthDropDownList.Text + YearDropDownList.Text); InputObject.Add("x_card_code", CCVTextBox.Text); InputObject.Add("x_method", "CC"); InputObject.Add("x_type", "AUTH_CAPTURE"); InputObject.Add("x_amount", string.Format("{0:c2}", Convert.ToDouble(AmountTextBox.Text))); // Currency setting. Check the guide for other supported currencies InputObject.Add("x_currency_code", "USD"); try { //Actual Server //Set above Testmode=off to go live webClientRequest.BaseAddress = "https://secure.authorize.net/gateway/transact.dll"; // webClientRequest.BaseAddress = "https://test.authorize.net/gateway/transact.dll"; ReturnBytes = webClientRequest.UploadValues(webClientRequest.BaseAddress, "POST", InputObject); ReturnValues = System.Text.Encoding.ASCII.GetString(ReturnBytes).Split(",".ToCharArray()); if (ReturnValues[0].Trim(char.Parse("|")) == "1") { authorizecode.Text = ReturnValues[4].Trim(char.Parse("|")); // Returned Authorisation Code transcode.Text = ReturnValues[6].Trim(char.Parse("|")); // Returned Transaction ID return(true); } else { // Error! ErrorString = ReturnValues[3].Trim(char.Parse("|")) + " (" + ReturnValues[2].Trim(char.Parse("|")) + ")"; if (ReturnValues[2].Trim(char.Parse("|")) == "44") { // CCV transaction decline ErrorString += "Credit Card Code Verification (CCV) returned the following error: "; switch (ReturnValues[38].Trim(char.Parse("|"))) { case "N": ErrorString += "Card Code does not match."; break; case "P": ErrorString += "Card Code was not processed."; break; case "S": ErrorString += "Card Code should be on card but was not indicated."; break; case "U": ErrorString += "Issuer was not certified for Card Code."; break; } } if (ReturnValues[2].Trim(char.Parse("|")) == "17") { // wrong credit card ErrorString += "The merchant accepts Visa, MasterCard, Discover, Diners Club and JCB "; } if (ReturnValues[2].Trim(char.Parse("|")) == "45") { if (ErrorString.Length > 1) { ErrorString += "<br />n"; } // AVS transaction decline ErrorString += "Address Verification System (AVS) " + "returned the following error: "; switch (ReturnValues[5].Trim(char.Parse("|"))) { case "A": ErrorString += " the zip code entered does not match the billing address."; break; case "B": ErrorString += " no information was provided for the AVS check."; break; case "E": ErrorString += " a general error occurred in the AVS system."; break; case "G": ErrorString += " the credit card was issued by a non-US bank."; break; case "N": ErrorString += " neither the entered street address nor zip code matches the billing address."; break; case "P": ErrorString += " AVS is not applicable for this transaction."; break; case "R": ErrorString += " please retry the transaction; the AVS system was unavailable or timed out."; break; case "S": ErrorString += " the AVS service is not supported by your credit card issuer."; break; case "U": ErrorString += " address information is unavailable for the credit card."; break; case "W": ErrorString += " the 9 digit zip code matches, but the street address does not."; break; case "Z": ErrorString += " the zip code matches, but the address does not."; break; } } // ErrorString contains the actual error resultSpan.InnerHtml = ErrorString; return(false); } } catch (Exception ex) { resultSpan.InnerHtml = ex.Message; return(false); } } } return(false); }
protected void drp_post_enddate_SelectedIndexChanged(object sender, EventArgs e) { RossSoft.Utility.AppConfig app = RossSoft.Utility.AppSettings(); QuickappService.Getyear(drp_post_compdate, Convert.ToInt32(drp_post_enddate.SelectedValue.ToString()), Convert.ToInt32(app.Endyear), true); }