protected void Page_Load(object sender, EventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("../Default.aspx"); } LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); LinkButton mpLinkButton = (LinkButton)mpLongView.FindControl("LoginTag"); LinkButton mpLogoffButton = (LinkButton)mpLongView.FindControl("LogoffTag"); mpLinkButton.Visible = false; mpLogoffButton.Visible = true; if (Session["Usuario"].Equals("Administrador") == false) { LinkButton mpLkbPlanillas = (LinkButton)mpLongView.FindControl("lkbPlanillas"); LinkButton mpLkbPlazass = (LinkButton)mpLongView.FindControl("lkbPlazas"); LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); mpLkbPlanillas.Visible = true; mpLkbPlazass.Visible = false; mpLkbUsuarios.Visible = false; } //se instancia la clase de base de datos servicio = new Planilla_WCF(); CargarGrid(); }
protected void Page_Load(object sender, EventArgs e) { //se instancia la clase de base de datos servicio = new Planilla_WCF(); //se valida el postback if (!IsPostBack) { } if (Session["Usuario"] == null) { Response.Redirect("../Default.aspx"); } LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); LinkButton mpLinkButton = (LinkButton)mpLongView.FindControl("LoginTag"); LinkButton mpLogoffButton = (LinkButton)mpLongView.FindControl("LogoffTag"); mpLinkButton.Visible = false; mpLogoffButton.Visible = true; if (Session["Usuario"].Equals("Administrador") == false) { LinkButton mpLkbPlanillas = (LinkButton)mpLongView.FindControl("lkbPlanillas"); LinkButton mpLkbPlazass = (LinkButton)mpLongView.FindControl("lkbPlazas"); LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); mpLkbPlanillas.Visible = true; mpLkbPlazass.Visible = false; } //si alguna acción genera un postback se limpian los mensajes de error FailureText.Text = string.Empty; ErrorMessage.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); //LinkButton mpLkbPersonal = (LinkButton)mpLongView.FindControl("lkbPersonal"); //LinkButton mpLkbCargaDatos = (LinkButton)mpLongView.FindControl("lkbCargaDatos"); //LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); //LinkButton mpLkbProgramacion = (LinkButton)mpLongView.FindControl("lkbProgramacion"); //LinkButton mpLkbJefaturas = (LinkButton)mpLongView.FindControl("lkbJefaturas"); //mpLkbPersonal.Visible = false; //mpLkbCargaDatos.Visible = false; //mpLkbUsuarios.Visible = false; //mpLkbProgramacion.Visible = false; //mpLkbJefaturas.Visible = false; LinkButton mpLkbPlanillas = (LinkButton)mpLongView.FindControl("lkbPlanillas"); //LinkButton mpLkbPlazass = (LinkButton)mpLongView.FindControl("lkbPlazas"); LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); mpLkbPlanillas.Visible = false; //mpLkbPlazass.Visible = false; mpLkbUsuarios.Visible = false; if (!IsPostBack) { Session.Abandon(); Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", "")); Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); Response.Cache.SetAllowResponseInBrowserHistory(false); Response.Cache.SetNoStore(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["student"] != null) { //LOCATES THE LOGINVIEW PARENT CONTROL LoginView lvLogin = (LoginView)this.FindControl("lvlogin"); //LOCATES THE ANCHOR TAG FROM THE PARENT REFERENCE ABOVE HtmlAnchor liWelcome = (HtmlAnchor)lvLogin.FindControl("liWelcome"); //GETS THE STUDENT OBJECT FROM SESSION Student student = (Student)Session["student"]; //USES THE STUDENT OBJECT TO PERSONALIZE WELCOME LINK WITH FIRST NAME liWelcome.InnerText = String.Format("Welcome {0}", student.FirstName); //MAKES THE REGISTER LINK INVISIBLE HtmlAnchor liRegister = (HtmlAnchor)lvLogin.FindControl("liRegister"); liRegister.Visible = false; //MAKES LOGIN LINK INVISIBLE HtmlAnchor liLogin = (HtmlAnchor)lvLogin.FindControl("liLogin"); liLogin.Visible = false; //MAKES THE LOGOUT LINK VISIBLE HtmlAnchor liLogout = (HtmlAnchor)lvLogin.FindControl("liLogout"); liLogout.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); LinkButton mpLkbPlanillas = (LinkButton)mpLongView.FindControl("lkbPlanillas"); //LinkButton mpLkbPlazass = (LinkButton)mpLongView.FindControl("lkbPlazas"); LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); mpLkbPlanillas.Visible = false; //mpLkbPlazass.Visible = false; mpLkbUsuarios.Visible = false; //LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); //LinkButton mpLkbPersonal = (LinkButton)mpLongView.FindControl("lkbPersonal"); //LinkButton mpLkbCargaDatos = (LinkButton)mpLongView.FindControl("lkbCargaDatos"); //LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); //LinkButton mpLkbProgramacion = (LinkButton)mpLongView.FindControl("lkbProgramacion"); //LinkButton mpLkbJefaturas = (LinkButton)mpLongView.FindControl("lkbJefaturas"); //mpLkbPersonal.Visible = false; //mpLkbCargaDatos.Visible = false; //mpLkbUsuarios.Visible = false; //mpLkbProgramacion.Visible = false; //mpLkbJefaturas.Visible = false; }
protected void Page_PreRender(object sender, EventArgs e) { Session["USER"] = null; ((System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("AdminSubmenu")).Visible = false; ((System.Web.UI.HtmlControls.HtmlAnchor)Master.FindControl("CastleIndex")).HRef = "~/Default"; LoginView loginView = (LoginView)(this.Page.Master as MasterPage).FindControl("LoginView1"); loginView.FindControl("BtnLogOut").Visible = false; loginView.FindControl("BtnLogIn").Visible = true; }
//public Personal_BLL servicio; //public Catalogos_BLL servicio; protected void Page_Load(object sender, EventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("../Default.aspx"); } LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); LinkButton mpLinkButton = (LinkButton)mpLongView.FindControl("LoginTag"); LinkButton mpLogoffButton = (LinkButton)mpLongView.FindControl("LogoffTag"); mpLinkButton.Visible = false; mpLogoffButton.Visible = true; if (Session["Usuario"].Equals("Administrador") == false) { LinkButton mpLkbPlanillas = (LinkButton)mpLongView.FindControl("lkbPlanillas"); //LinkButton mpLkbPlazass = (LinkButton)mpLongView.FindControl("lkbPlazas"); LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); mpLkbPlanillas.Visible = true; //mpLkbPlazass.Visible = false; mpLkbUsuarios.Visible = false; //LinkButton mpCargaDatos = (LinkButton)mpLongView.FindControl("lkbCargaDatos"); //LinkButton mpPersonal = (LinkButton)mpLongView.FindControl("lkbPersonal"); LinkButton mpProgramacion = (LinkButton)mpLongView.FindControl("lkbProgramacion"); LinkButton mpUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); LinkButton mpAvaya = (LinkButton)mpLongView.FindControl("lkbAvaya"); LinkButton mpElite = (LinkButton)mpLongView.FindControl("lkbElite"); LinkButton mpRegPersonal = (LinkButton)mpLongView.FindControl("lkbRegistroPersonal"); //mpCargaDatos.Visible = false; //mpPersonal.Visible = false; mpProgramacion.Visible = false; mpUsuarios.Visible = false; mpAvaya.Visible = false; mpElite.Visible = false; mpRegPersonal.Visible = false; } //se instancia la clase de base de datos servicio = new Planilla_WCF(); //se valida el postback if (!IsPostBack) { //se cargan los datos en el ddl de Proecto cargarProyectos(); //Se crea un item inicial que sera la opcion TODOS en el dropdown ListItem oItemTodos = new ListItem(); oItemTodos.Text = "SELECCIONE"; oItemTodos.Value = "0"; } //si alguna acción genera un postback se limpian los mensajes de error FailureText.Text = string.Empty; ErrorMessage.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("../Default.aspx"); } LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); LinkButton mpLinkButton = (LinkButton)mpLongView.FindControl("LoginTag"); LinkButton mpLogoffButton = (LinkButton)mpLongView.FindControl("LogoffTag"); mpLinkButton.Visible = false; mpLogoffButton.Visible = true; lblMensaje.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("../Default.aspx"); } LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); LinkButton mpLinkButton = (LinkButton)mpLongView.FindControl("LoginTag"); LinkButton mpLogoffButton = (LinkButton)mpLongView.FindControl("LogoffTag"); mpLinkButton.Visible = false; mpLogoffButton.Visible = true; if (Session["Usuario"].Equals("Administrador") == false) { LinkButton mpLkbPlanillas = (LinkButton)mpLongView.FindControl("lkbPlanillas"); //LinkButton mpLkbPlazass = (LinkButton)mpLongView.FindControl("lkbPlazas"); LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); mpLkbPlanillas.Visible = true; //mpLkbPlazass.Visible = false; mpLkbUsuarios.Visible = false; //LinkButton mpCargaDatos = (LinkButton)mpLongView.FindControl("lkbCargaDatos"); //LinkButton mpPersonal = (LinkButton)mpLongView.FindControl("lkbPersonal"); LinkButton mpProgramacion = (LinkButton)mpLongView.FindControl("lkbProgramacion"); LinkButton mpUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); LinkButton mpAvaya = (LinkButton)mpLongView.FindControl("lkbAvaya"); LinkButton mpElite = (LinkButton)mpLongView.FindControl("lkbElite"); LinkButton mpRegPersonal = (LinkButton)mpLongView.FindControl("lkbRegistroPersonal"); //mpCargaDatos.Visible = false; //mpPersonal.Visible = false; mpProgramacion.Visible = false; mpUsuarios.Visible = false; mpAvaya.Visible = false; mpElite.Visible = false; mpRegPersonal.Visible = false; } servicio = new Planilla_WCF(); if (!IsPostBack) { cargarDepartamento(); ListItem oItemTodos = new ListItem(); oItemTodos.Text = "SELECCIONE"; oItemTodos.Value = "0"; ddlSeccion.Items.Add(oItemTodos); cargarProyectos(); } }
protected void Page_Load(object sender, EventArgs e) {// Method used to manipulate the master page buttons visibility if (Session["UsernameLogin"] != null && Session["UserType"] != null) { usernameLabel.Text = "Welcome back: " + Session["UsernameLogin"].ToString(); var testDiv1 = LoginView.FindControl("registerLink"); var testDiv2 = LoginView.FindControl("loginLink"); testDiv2.Visible = false; var testDiv3 = LoginView1.FindControl("logoutLink"); testDiv3.Visible = true; if (Session["UserType"].ToString() == "1") { TimetableLink.HRef = "~/ClientTimetable"; testDiv1.Visible = false; } else if (Session["UserType"].ToString() == "2") { TimetableLink.HRef = "~/StaffTimetable"; testDiv1.Visible = true; } } else { var testDiv1 = LoginView.FindControl("registerLink"); testDiv1.Visible = true; var testDiv2 = LoginView.FindControl("loginLink"); testDiv2.Visible = true; var testDiv3 = LoginView1.FindControl("logoutLink"); testDiv3.Visible = false; } }
/// <summary> /// Handles the Click event of the RefundButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void RefundButton_Click(object sender, EventArgs e) { RangeValidator rangeValidator = (RangeValidator)LoginView.FindControl("RangeValidator"); Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); TextBox refundCommentTB = (TextBox)LoginView.FindControl("RefundCommentTextBox"); TextBox refundAmountTB = (TextBox)LoginView.FindControl("RefundTextBox"); Label chargedAmountLbl = (Label)LoginView.FindControl("ChargedAmountLabel"); Label refundStatusLbl = (Label)LoginView.FindControl("RefundStatusLabel"); Panel refundPanel = (Panel)LoginView.FindControl("RefundPanel"); decimal total = decimal.Parse(chargedAmountLbl.Text); rangeValidator.MaximumValue = total.ToString(); decimal amount = 0; if (decimal.TryParse(refundAmountTB.Text, out amount) && amount != 0 && amount <= total) { GCheckout.OrderProcessing.RefundOrderRequest refundReq = new GCheckout.OrderProcessing.RefundOrderRequest(orderNumberLbl.Text, refundCommentTB.Text, "USD", amount, refundCommentTB.Text); refundReq.Send(); refundStatusLbl.Text = ""; refundPanel.Visible = false; } else { refundStatusLbl.Text = "The entered amount is not correct!"; } }
protected void ChangeNicknameButton_Click(object sender, EventArgs e) { DropDownList DropDownListCharactersChangeNickname = LoginView.FindControl("DropDownListCharactersChangeNickname") as DropDownList; TextBox NewNicknameTextbox = LoginView.FindControl("NewNicknameTextbox") as TextBox; Label ChangeNicknameMessageLabel = LoginView.FindControl("ChangeNicknameMessageLabel") as Label; if (NewNicknameTextbox.MaxLength > 15) { ChangeNicknameMessageLabel.Text = "Nyb."; } if (Page.IsValid) { int returnValue = characterManager.ChangeCharacterNickname((int)Session["UserId"], int.Parse(DropDownListCharactersChangeNickname.SelectedValue), NewNicknameTextbox.Text); switch (returnValue) { case -1: ChangeNicknameMessageLabel.Text = "Nyb."; break; case 0: ChangeNicknameMessageLabel.Text = "Nickname exists ofc."; break; case 1: ChangeNicknameMessageLabel.Text = "Nickname changed, ty hf."; Page.DataBind(); break; } } }
/// <summary> /// Handles the Click event of the ChargeButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void ChargeButton_Click(object sender, EventArgs e) { Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); GCheckout.OrderProcessing.ChargeOrderRequest chargeReq = new GCheckout.OrderProcessing.ChargeOrderRequest(orderNumberLbl.Text); chargeReq.Send(); }
/// <summary> /// Handles the Click event of the CancelRefundButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void CancelRefundButton_Click(object sender, EventArgs e) { Panel refundPanel = (Panel)LoginView.FindControl("RefundPanel"); Label refundStatusLbl = (Label)LoginView.FindControl("RefundStatusLabel"); refundStatusLbl.Text = ""; refundPanel.Visible = false; }
/// <summary> /// Handles the Click event of the PartialChargingButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void PartialChargingButton_Click(object sender, EventArgs e) { Panel chargingPanel = (Panel)LoginView.FindControl("ChargingPanel"); Panel partialChargingPanel = (Panel)LoginView.FindControl("PartialChargingPanel"); partialChargingPanel.Visible = true; chargingPanel.Visible = false; }
//public Personal_BLL servicio; //public Catalogos_BLL servicio; protected void Page_Load(object sender, EventArgs e) { if (Session["Usuario"] == null) { Response.Redirect("../Default.aspx"); } LoginView mpLongView = (LoginView)Master.FindControl("LoginView1"); LinkButton mpLinkButton = (LinkButton)mpLongView.FindControl("LoginTag"); LinkButton mpLogoffButton = (LinkButton)mpLongView.FindControl("LogoffTag"); mpLinkButton.Visible = false; mpLogoffButton.Visible = true; if (Session["Usuario"].Equals("Administrador") == false) { LinkButton mpLkbPlanillas = (LinkButton)mpLongView.FindControl("lkbPlanillas"); //LinkButton mpLkbPlazass = (LinkButton)mpLongView.FindControl("lkbPlazas"); LinkButton mpLkbUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); mpLkbPlanillas.Visible = true; //mpLkbPlazass.Visible = false; mpLkbUsuarios.Visible = false; //LinkButton mpCargaDatos = (LinkButton)mpLongView.FindControl("lkbCargaDatos"); //LinkButton mpPersonal = (LinkButton)mpLongView.FindControl("lkbPersonal"); LinkButton mpProgramacion = (LinkButton)mpLongView.FindControl("lkbProgramacion"); LinkButton mpUsuarios = (LinkButton)mpLongView.FindControl("lkbUsuarios"); LinkButton mpAvaya = (LinkButton)mpLongView.FindControl("lkbAvaya"); LinkButton mpElite = (LinkButton)mpLongView.FindControl("lkbElite"); LinkButton mpRegPersonal = (LinkButton)mpLongView.FindControl("lkbRegistroPersonal"); //mpCargaDatos.Visible = false; //mpPersonal.Visible = false; mpProgramacion.Visible = false; mpUsuarios.Visible = false; mpAvaya.Visible = false; mpElite.Visible = false; mpRegPersonal.Visible = false; } //se instancia la clase de base de datos servicio = new Planilla_WCF(); //servicio = new Catalogos_BLL(); //servicio = new Personal_BLL(); //si alguna acción genera un postback se limpian los mensajes de error FailureText.Text = string.Empty; ErrorMessage.Visible = false; }
/// <summary> /// Handles the Click event of the CancelButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void CancelButton_Click(object sender, EventArgs e) { Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); string reason = "Cannceled by merchant!"; string comment = "Item(s) not available in this moment"; GCheckout.OrderProcessing.CancelOrderRequest cancelReq = new GCheckout.OrderProcessing.CancelOrderRequest(orderNumberLbl.Text, reason, comment); cancelReq.Send(); }
/// <summary> /// Handles the Click event of the CancelPartialChargingButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void CancelPartialChargingButton_Click(object sender, EventArgs e) { Panel chargingPanel = (Panel)LoginView.FindControl("ChargingPanel"); Panel partialChargingPanel = (Panel)LoginView.FindControl("PartialChargingPanel"); Label statusLabel = (Label)LoginView.FindControl("StatusLabel"); partialChargingPanel.Visible = false; chargingPanel.Visible = true; statusLabel.Text = ""; }
/// <summary> /// Handles the Click event of the UnarchiveButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void ArchiveButton_Click(object sender, EventArgs e) { Panel orderDetailsPanel = (Panel)LoginView.FindControl("OrderDetailsPanel"); Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); GCheckout.OrderProcessing.UnarchiveOrderRequest archiveReq = new GCheckout.OrderProcessing.UnarchiveOrderRequest(orderNumberLbl.Text); archiveReq.Send(); Orders.Orders.UnarchiveOrder(orderNumberLbl.Text); orderDetailsPanel.Visible = false; Response.Redirect(Request.RawUrl); }
/// <summary> /// Handles the SelectedIndexChanged event of the OrdersGridView control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void OrdersGridView_SelectedIndexChanged(object sender, EventArgs e) { GridView ordersGrid = (GridView)LoginView.FindControl("OrdersGridView"); DetailsView billingDetails = (DetailsView)LoginView.FindControl("BillingDetails"); DetailsView shippingDetails = (DetailsView)LoginView.FindControl("ShippingDetails"); Panel orderDetailsPanel = (Panel)LoginView.FindControl("OrderDetailsPanel"); Label statusLbl = (Label)LoginView.FindControl("StatusLabel"); Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); Label fulfillmentLbl = (Label)LoginView.FindControl("FulfillmentLabel"); Label financialLbl = (Label)LoginView.FindControl("FinancialLabel"); Label totalAmountLbl = (Label)LoginView.FindControl("TotalAmountLabel"); Label taxLbl = (Label)LoginView.FindControl("TaxLabel"); Label chargedAmountLbl = (Label)LoginView.FindControl("ChargedAmountLabel"); Label dateLbl = (Label)LoginView.FindControl("DateLabel"); GridView orderItemsGrid = (GridView)LoginView.FindControl("OrderItemsGridView"); Button cancelBtn = (Button)LoginView.FindControl("CancelButton"); orderDetailsPanel.Visible = true; ordersGrid.Visible = false; long dataKey = (long)ordersGrid.SelectedDataKey.Value; List <order> source = Orders.Orders.GetOrderDetails(dataKey); List <order_item> items = Orders.Orders.GetItems(source[0].order_id); List <customer> customerDetails = Orders.Orders.GetCustomerDetails(dataKey); if (source[0].status != "TEMP") { if (source[0].status == "CANCELLED" || source[0].status == "CANCELLED_BY_GOOGLE") { cancelBtn.Enabled = false; } else { cancelBtn.Enabled = true; } orderNumberLbl.Text = dataKey.ToString(); financialLbl.Text = source[0].status; fulfillmentLbl.Text = source[0].shipping_status; taxLbl.Text = source[0].tax.ToString(); totalAmountLbl.Text = source[0].total.ToString(); chargedAmountLbl.Text = source[0].charged_amount.ToString(); dateLbl.Text = source[0].order_date.ToShortDateString(); billingDetails.DataSource = customerDetails; billingDetails.DataBind(); shippingDetails.DataSource = source; shippingDetails.DataBind(); orderItemsGrid.DataSource = items; orderItemsGrid.DataBind(); } else { statusLbl.Text = "No details available!"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && Page.User.Identity.IsAuthenticated && Page.User.IsInRole("Administrators")) { GridView ordersGrid = (GridView)LoginView.FindControl("OrdersGridView"); Panel orderDetailsPanel = (Panel)LoginView.FindControl("OrderDetailsPanel"); ordersGrid.DataSource = Orders.Orders.GetArchivedOrders(); ordersGrid.DataBind(); orderDetailsPanel.Visible = false; } }
/// <summary> /// Handles the Click event of the SendShippingInfoButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void SendShippingInfoButton_Click(object sender, EventArgs e) { TextBox carrierTB = (TextBox)LoginView.FindControl("CarrierTextBox"); TextBox trackingNumberTB = (TextBox)LoginView.FindControl("TrackingNumberTextBox"); Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); Panel shippingPanel = (Panel)LoginView.FindControl("ShippingPanel"); GCheckout.OrderProcessing.DeliverOrderRequest deliverReq = new GCheckout.OrderProcessing.DeliverOrderRequest(orderNumberLbl.Text, carrierTB.Text, trackingNumberTB.Text, true); deliverReq.Send(); shippingPanel.Visible = false; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && Page.User.Identity.IsAuthenticated) { GridView ordersGrid = (GridView)LoginView.FindControl("OrdersGridView"); Panel orderDetailsPanel = (Panel)LoginView.FindControl("OrderDetailsPanel"); ordersGrid.DataSource = Orders.Orders.GetOrdersByUser(Page.User.Identity.Name); ordersGrid.DataBind(); orderDetailsPanel.Visible = false; } }
protected void SetLoginViewActions(LoginView UsersRoleLoginView) { Button EditUserRoleButton = (Button)UsersRoleLoginView.FindControl("EditUserRoleButton"); HiddenField ItemUserNameHF = (HiddenField)UsersRoleLoginView.Parent.FindControl("ItemUserNameHF"); string username = ItemUserNameHF.Value.ToString(); if (EditUserRoleButton != null) { EditUserRoleButton.CommandArgument = username; } }
/// <summary> /// Handles the SelectedIndexChanged event of the OrdersGridView control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void OrdersGridView_SelectedIndexChanged(object sender, EventArgs e) { GridView ordersGrid = (GridView)LoginView.FindControl("OrdersGridView"); DetailsView billingDetails = (DetailsView)LoginView.FindControl("BillingDetails"); DetailsView shippingDetails = (DetailsView)LoginView.FindControl("ShippingDetails"); Panel orderDetailsPanel = (Panel)LoginView.FindControl("OrderDetailsPanel"); Label statusLbl = (Label)LoginView.FindControl("StatusLabel"); Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); Label fulfillmentLbl = (Label)LoginView.FindControl("FulfillmentLabel"); Label financialLbl = (Label)LoginView.FindControl("FinancialLabel"); Label totalAmountLbl = (Label)LoginView.FindControl("TotalAmountLabel"); Label shippingLbl = (Label)LoginView.FindControl("ShippingLabel"); Label taxLbl = (Label)LoginView.FindControl("TaxLabel"); Label refundLbl = (Label)LoginView.FindControl("RefundLabel"); Label chargedAmountLbl = (Label)LoginView.FindControl("ChargedAmountLabel"); Label dateLbl = (Label)LoginView.FindControl("DateLabel"); GridView orderItemsGrid = (GridView)LoginView.FindControl("OrderItemsGridView"); orderDetailsPanel.Visible = true; ordersGrid.Visible = false; long dataKey = (long)ordersGrid.SelectedDataKey.Value; List <order> source = Orders.Orders.GetOrderDetails(dataKey); List <order_item> items = Orders.Orders.GetItems(source[0].order_id); List <customer> customerDetails = Orders.Orders.GetCustomerDetails(dataKey); if (source[0].status != "TEMP") { orderNumberLbl.Text = dataKey.ToString(); financialLbl.Text = source[0].status; fulfillmentLbl.Text = source[0].shipping_status; shippingLbl.Text = source[0].shipping.ToString(); taxLbl.Text = source[0].tax.ToString(); totalAmountLbl.Text = source[0].total.ToString(); chargedAmountLbl.Text = source[0].charged_amount.ToString(); dateLbl.Text = source[0].order_date.ToShortDateString(); billingDetails.DataSource = customerDetails; billingDetails.DataBind(); shippingDetails.DataSource = source; shippingDetails.DataBind(); orderItemsGrid.DataSource = items; orderItemsGrid.DataBind(); if (source[0].sub_total + source[0].charged_amount != source[0].total) { decimal temp = source[0].total - Math.Abs(source[0].sub_total - source[0].charged_amount.Value); refundLbl.Text = temp.ToString(); } } else { statusLbl.Text = "No details available!"; } }
/// <summary> /// Handles the Click event of the RefundPanelButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void RefundPanelButton_Click(object sender, EventArgs e) { Panel refundPanel = (Panel)LoginView.FindControl("RefundPanel"); Label orderNumberLbl = (Label)LoginView.FindControl("GoogleOrderNumberLabel"); long orderNumber = Int64.Parse(orderNumberLbl.Text); List <order> refundOrder = Orders.Orders.GetOrderDetails(orderNumber); if (refundOrder[0].charged_amount != 0) { refundPanel.Visible = true; } }
protected void SetLoginViewActions(LoginView QuoteLoginView) { Literal QuoteMessageDescription = (Literal)QuoteLoginView.FindControl("QuoteMessageDescription"); HiddenField ItemContentHF = (HiddenField)QuoteLoginView.Parent.FindControl("ItemContentHF"); string ItemContent = ItemContentHF.Value.ToString(); if (QuoteMessageDescription != null) { QuoteMessageDescription.Text = ItemContent; QuoteMessageDescription.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (Page.User.Identity.Name == string.Empty) { Response.Redirect("~/PageCommon/login.aspx"); } else { LoginView logInView = (LoginView)this.Master.FindControl("HeadLoginView"); HyperLink rdirect = (HyperLink)logInView.FindControl("HyperLink1"); rdirect.NavigateUrl = "~/PageUser/MyProfile.aspx"; } }
protected void SetLoginViewActions(LoginView CategoryLoginView) { Button EditCategoryButton = (Button)CategoryLoginView.FindControl("EditCategoryButton"); Button DeleteCategoryButton = (Button)CategoryLoginView.FindControl("DeleteCategoryButton"); HiddenField ItemIdHF = (HiddenField)CategoryLoginView.Parent.FindControl("ItemId"); HiddenField ItemContentHF = (HiddenField)CategoryLoginView.Parent.FindControl("ItemContent"); string ItemId = Guid.Parse((ItemIdHF.Value).ToString()).ToString(); string ItemContent = ItemContentHF.Value.ToString(); if (EditCategoryButton != null) { string EditDiv = AddCategoryLoginView.FindControl("EditCategoryDiv").ClientID.ToString(); string EditTB = AddCategoryLoginView.FindControl("EditCategoryTB").ClientID.ToString(); string EditID = AddCategoryLoginView.FindControl("EditCategoryID").ClientID.ToString(); string AddID = AddCategoryLoginView.FindControl("AddCategoryDiv").ClientID.ToString(); EditCategoryButton.OnClientClick = "return ShowEdit('" + EditDiv + "','" + EditID + "','" + ItemId + "','" + EditTB + "','" + ItemContent + "','" + AddID + "')"; } if (DeleteCategoryButton != null) { DeleteCategoryButton.CommandArgument = ItemId; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoginView lv = (LoginView)FindControl("HeadLoginView"); if (lv != null) { LoginName ln = (LoginName)lv.FindControl("HeadLoginName"); if (ln != null) { ln.FormatString = (string)Session["UserName"]; } } } }