Example #1
0
        protected void ListView_OnItemCommand(object sender, ListViewCommandEventArgs e)
        {
            // Button name control
            if (String.Equals(e.CommandName, "AddButton"))
            {

                // take button argument and split
                string toplam = (string) e.CommandArgument;
                string[] top = toplam.Split('/');

                double price = Convert.ToDouble(top[0]);
                string id = top[1];
                // take textbox text
                TextBox t = ((TextBox)e.Item.FindControl("TextBox1"));
                string number = t.Text;

                string quantity = top[2];
                // calculate total cost
                double totalcost = price * Convert.ToDouble(number);

                Label name = ((Label)e.Item.FindControl("nameLabel"));
                Session["name"] = name.Text;
               // all arguments send with session
                Session["number"] += number + "%";
                Session["totalcost"] = Convert.ToDouble(Session["totalcost"]) + totalcost;
                Session["id"] += id + "%" ;
                Session["quantity"] += quantity + "%";
            }
        }
Example #2
0
 private void GhostCastSessionList_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     Agent.GhostCastManagerClient gcmc = new Agent.GhostCastManagerClient();
     switch (e.CommandName)
     {
         case "Clients":
             {
                 GridView list = (GridView)e.Item.FindControl("ConnectedClientsGridView");
                 list.Visible = true;
                 break;
             }
         case "Send":
             {
                 Status.Text = gcmc.SendGhostCastSession(Convert.ToInt32(e.CommandArgument));
                 this.ViewState["ClientListVisible"] = null;
                 break;
             }
         case "Close":
             {
                 Status.Text = gcmc.CloseGhostCastSession(Convert.ToInt32(e.CommandArgument));
                 RefreshSessions(false);
                 this.ViewState["ClientListVisible"] = null;
                 break;
             }
     }
 }
        protected void lvCursos_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            var idCurso = Int32.Parse((String)e.CommandArgument);
            var curso = _CursoService.GetCurso(idCurso);
            var empleado = _EmpleadoService.GetEmpleado(curso.EmpleadoId);
            var inscripcion = Cache.Get("inscripcion") as Inscripcion;
            var existe = inscripcion.Cursos.Any(d => d.Id.Equals(idCurso));

            if (!existe)
            {
                lblMensajeCurso.Text = "";
                lblMensajeCurso.Visible = false;
                lblDetalles.Text = "Detalles";
                lblDetalles.Visible = true;

                curso.Empleado = empleado;

                inscripcion.Cursos.Add(curso);

                /*recalculo los totales despues de agregar*/
                CalcularTotales(inscripcion);

                lvDetallesCursos.DataSource = inscripcion.Cursos;
                lvDetallesCursos.DataBind();

                Cache.Insert("inscripcion", inscripcion);
            }
            else
            {
                lblMensajeCurso.Text = "Ese curso ya ha sido agregado";
                lblMensajeCurso.Visible = true;
            }
        }
Example #4
0
 protected void lisItems_ItemCommand(Object sender, ListViewCommandEventArgs e)
 {
     switch(e.CommandName) {
     default:
         break;
     }
 }
Example #5
0
 protected void ltv_all_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "UpdateU":
             TextBox txtTHISname = (TextBox)e.Item.FindControl("txt_THISnameE");
             TextBox txtTHISimage = (TextBox)e.Item.FindControl("txt_THISimageE");
             TextBox txtTHIScalories = (TextBox)e.Item.FindControl("txt_THIScaloriesE");
             TextBox txtTHISfat = (TextBox)e.Item.FindControl("txt_THISfatE");
             TextBox txtTHATname = (TextBox)e.Item.FindControl("txt_THATnameE");
             TextBox txtTHATimage = (TextBox)e.Item.FindControl("txt_THATimageE");
             TextBox txtTHATcalories = (TextBox)e.Item.FindControl("txt_THATcaloriesE");
             TextBox txtTHATfat = (TextBox)e.Item.FindControl("txt_THATfatE");
             TextBox txtAnswer = (TextBox)e.Item.FindControl("txt_AnswerE");
             HiddenField hdfID = (HiddenField)e.Item.FindControl("hdf_idE");
             Guid QuestionID = Guid.Parse(hdfID.Value.ToString());
             _strMes(objquiz.commitUpdate(QuestionID, txtTHISname.Text, txtTHISimage.Text, int.Parse(txtTHIScalories.Text.ToString()), int.Parse(txtTHISfat.Text.ToString()), txtTHATname.Text, txtTHATimage.Text, int.Parse(txtTHATcalories.Text.ToString()), int.Parse(txtTHATfat.Text.ToString()), txtAnswer.Text), "update");
             _subRebind();
             break;
         case "DeleteU":
             Guid _QuestionID = Guid.Parse(((HiddenField)e.Item.FindControl("hdf_idE")).Value);
             _strMes(objquiz.commitDelete(_QuestionID), "delete");
             _subRebind();
             break;
         case "CancelU":
             _subRebind();
             break;
     }
 }
    protected void questionsList_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        int questionID = int.Parse(e.CommandArgument.ToString());
        new QuesDB().DeleteQuestion(questionID);

        Response.Redirect(Page.Request.RawUrl);
    }
        protected void lstSepet_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (e.CommandName == "UrunCikar")
            {

            }
        }
Example #8
0
 protected void ReservationSummaryListView_OnItemCommand(object sender, ListViewCommandEventArgs e)
 {
     // Check the command name and add the reservation for the specified seats.
     if (e.CommandName.Equals("Seat"))
     {
         MessageUserControl.TryRun(() =>
         {
             // Get the data
             var reservationId = int.Parse(e.CommandArgument.ToString());
             var selectedItems = new List<byte>();//for multiple table numbers
             foreach (ListItem item in ReservationTableListBox.Items)
             {
                 if (item.Selected)
                     selectedItems.Add(byte.Parse(item.Text.Replace("Table ", "")));
             }
             var when = Mocker.MockDate.Add(Mocker.MockTime);
             // Seat the reservation customer
             var controller = new AdminController();
             controller.SeatCustomer(when, reservationId, selectedItems, int.Parse(WaiterDropDownList.SelectedValue));
             // Refresh the gridview
             SeatingGridView.DataBind();
             ReservationsRepeater.DataBind();
             ReservationTableListBox.DataBind();
         }, "Customer Seated", "Reservation customer has arrived and has been seated");
     }
 }
        protected void lvDetallePedido_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (e.CommandName == "QuitarDetalle")
            {
                var gastosServicioId = Int32.Parse(e.CommandArgument.ToString());

                var servicio = Cache.Get("servicio") as Servicio;

                var detalleGasto =
                    servicio.DetalleGastosServicios.SingleOrDefault(i => i.IdGastosServicio.Equals(gastosServicioId));

                servicio.DetalleGastosServicios.Remove(detalleGasto);

                BindServicio(servicio);

                Cache.Insert("servicio", servicio);
            }
            else if (e.CommandName == "updateItems")
            {
                var servicio = Cache.Get("servicio") as Servicio;
                foreach (var row in lvDetallePedido.Items)
                {
                    var txtCantidad = row.FindControl("txtCantidad") as TextBox;
                    var txtObs = row.FindControl("txtObservaciones") as TextBox;

                    servicio.DetalleGastosServicios[row.DisplayIndex].Cantidad = Int32.Parse(txtCantidad.Text);
                    servicio.DetalleGastosServicios[row.DisplayIndex].Observaciones = txtObs.Text;
                }
            }
        }
    protected void showFullStatement(object sender, ListViewCommandEventArgs e)
    {
        string[] emailList;
        nEmailHandler emailer = new nEmailHandler();

        //grab full list of emails
        ISession session = DatabaseEntities.NHibernateHelper.CreateSessionFactory().OpenSession();
        List<DatabaseEntities.User> userList = DatabaseEntities.User.GetAllUsers(session);

        string[] data = e.CommandArgument.ToString().Split(new char[] { '%' });

        if (String.Equals(e.CommandName, "remove"))
        {
            dbLogic.updateEligible(data[0], "0");
            LabelFeedback.Text = "User successfully removed from the current ballot. Email sent to ALL users alerting them of this action.";
            emailer.sendRemoveFromBallot(userList, GetName(Convert.ToInt32(data[1])));
        }

        else if (String.Equals(e.CommandName, "add"))
        {
            dbLogic.updateEligible(data[0], "1");
            LabelFeedback.Text = "User successfully placed back on the current ballot. Email sent to ALL users alerting them of this action.";
            emailer.sendReAddToBallot(userList, GetName(Convert.ToInt32(data[1])));
        }
        dbLogic.selectInfoForApprovalTable();
        DataSet emailSet = dbLogic.getResults();
        ListViewApproval.DataSource = emailSet;
        ListViewApproval.DataBind();
        loadApprovalInfo();
    }
        protected void ComprasListView_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            if (Session["Usuario"] == null)
            {
                Server.Transfer("ReservaNoRegistrado.aspx");
            }
            else
            {
                ventas.Matricula = e.CommandArgument.ToString();
                ventas.ObtenerDatosVehiculos();
                ventas.Reservado = 1;
                ventas.EditarVentas();
                ComprasMultiView.ActiveViewIndex = 0;

                Session["MailSubject"] = "Reserva de compra de: " + Session["email"].ToString();
                Session["MailBody"] = "Nombre y apellidos: " + Session["nombre"].ToString() + " " + Session["apellidos"].ToString()
                    + "\n\n Este cliente ha realizado una reserva del coche: \n Matrícula: " + ventas.Matricula + "\n Modelo: " + ventas.Marca + " " + ventas.Modelo
                    + "\n KM: " + ventas.KM.ToString() + "\n Precio: " + ventas.PrecioVenta + "\n Garantía: " + ventas.Garantia;
                Session["MailUser"] = Session["email"].ToString();
                Session["MailUserSubject"] = "La reserva se ha realizado con éxito.";
                Session["MailUserBody"] = "Has realizado una reserva del coche: \n Matrícula: " + ventas.Matricula + "\n Modelo: " + ventas.Marca + " " + ventas.Modelo
                    + "\n KM: " + ventas.KM.ToString() + "\n Precio: " + ventas.PrecioVenta + "\n Garantía: " + ventas.Garantia
                    + "\n\n Tiene reservado este coche durante 3 días. Pase por nuestras oficinas para tomar todos los datos necesarios y completar la compra.";
                Session["MailUrl"] = HttpContext.Current.Request.Url.ToString();
                Response.Redirect("EnviarMail.aspx");
            }
        }
Example #12
0
 protected void sendReply(ListViewCommandEventArgs e)
 {
     Label email = (Label)e.Item.FindControl("lbl_emailV");
     TextBox message = (TextBox)e.Item.FindControl("txt_msgR");
     TextBox subject = (TextBox)e.Item.FindControl("txt_subR");
     objSendMail.sendEMail(email.Text, "<div><a href='www.brdhchumber.com'><img src='www.brdhchumber.com/images/mailHeader.jpg' /></a><br /><br/>" +  message.Text, "(Blind River District Health Centre) " + subject.Text, true);
 }
        protected void ListViewEditeCheckname_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
           if (e.CommandName == "Update")
            {

                DropDownList ddlstatus = (DropDownList)e.Item.FindControl("ddlStatusInclass");
                string lblcheckid = ((Label)e.Item.FindControl("lblcheckid")).Text.ToString();
                if (!ddlstatus.SelectedValue.Equals("U"))
                {
                    string updateCommand = "UPDATE  CheckName SET   CheckName_Status='" + ddlstatus.SelectedValue + "' where CheckName_ID= '" + lblcheckid + "'";
                    sqlCheck.UpdateCommand = updateCommand;
                }
                else {
                    ShowMessageWeb("กรุณาระบุสถานะการเข้าห้องเรียนที่ท่านต้องการแก้ไข ! ");
                    string sql = @" SELECT   CheckName.CheckName_ID as checkid,Student.Std_Campus_Code AS stdCode, Student.Std_FName AS fname, Student.Std_LName AS lname, EnrollIn.Enroll_ID AS enroll,  
                                           CASE CheckName.CheckName_Status 
					                        WHEN 'S' THEN 'เข้าเรียน'
					                        WHEN 'L' THEN 'สาย'
					                        WHEN 'N' THEN 'ขาดเรียน'
                                            ELSE 'ยังไม่ได้เช็คชื่อ'
					                        END as status 
                                            FROM Student INNER JOIN
                                            EnrollIn ON Student.Std_Campus_Code = EnrollIn.Std_Campus_Code INNER JOIN
                                             CheckName ON EnrollIn.Enroll_ID = CheckName.Enroll_ID
                                             WHERE ([DetailTech_ID] = '" + Request.QueryString["dchID"] + "')  AND ([CheckName_Num] = '" + Request.QueryString["checknum"] + "')";

                    sqlCheck.UpdateCommand = sql;
                }
            }
        }
    protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        try
        {
            if (e.CommandName == "ExpressInterest")
            {
                if (Session["UserId"] != null)
                {
                    ListViewDataItem Edit = (ListViewDataItem)e.Item;
                    //lblreceiverId.Text = Convert.ToString(ListViewCommentsDetails.DataKeys[Edit.DisplayIndex].Value.ToString());
                   // PanelExpressInterest.Visible = true;
                   // ModalPopupInterest.Show();

                }
                else
                {

                    Response.Redirect("Default.aspx");
                }
            }
          

        }
        catch
        {
        }
         
             
    }
 protected void lvEnca_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     SqlDataSourceEnca.InsertParameters["Id_Usuario"].DefaultValue = WebMatrix.WebData.WebSecurity.CurrentUserId.ToString();
     SqlDataSourceEnca.InsertParameters["Id_Encarregado"].DefaultValue = e.CommandArgument.ToString();
     SqlDataSourceEnca.Insert();
     Response.Redirect(Request.RawUrl);
 }
 protected void lvMsgList_OnItemCommand(object sender, ListViewCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "EditMsg":
             int nextMsg = e.Item.DataItemIndex;
             SaveProfMsg(int.Parse(hfCurMsg.Value));
             LoadProfMsg(nextMsg);
             break;
         case "DelMsg":
             int curMsgIndex = int.Parse(hfCurMsg.Value);
             SaveProfMsg(curMsgIndex);
             DelProfMsg(e.Item.DataItemIndex);
             LoadProfMsg(0);
             break;
         case "AddMsg":
             if (profMsg.Count < 8)
             {
                 SaveProfMsg(int.Parse(hfCurMsg.Value));
                 profMsg.Add(new WxMsg());
                 LoadProfMsg(profMsg.Count - 1);
             }
             else
             {
                 warnMsg.Text = "最多只能同时发8条图文消息!";
             }
             break;
         case "SendMsg":
             SaveProfMsg(int.Parse(hfCurMsg.Value));
             BindProfMsg();
             SendProfMsg();
             break;
     }
 }
Example #17
0
        protected void lvList_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            HiddenField hdnIdNome = (HiddenField)e.Item.FindControl("hdnIdNome");
            HiddenField hdnDescricao = (HiddenField)e.Item.FindControl("hdnDescricao");

            string idAcao = CRB.BOSS.Funcoes.Criptografia.Encrypt(hdnIdNome.Value);

            switch (e.CommandName)
            {
                case "Editar":
                    Response.Redirect("Form.aspx?IdNome=" + idAcao);
                    break;

                case "Visualizar":
                    Response.Redirect("Form.aspx?IdNome=" + idAcao + "&ReadOnly=1");
                    break;

                case "Excluir":
                    Ok ok = new Ok(Excluir);
                    Popup popup = (Popup)this.Page.Master.FindControl("popup");
                    popup.Modulo = CRB.BOSS.Autenticacao.Modulo.Modulo.Atual;
                    popup.Titulo = CRB.BOSS.Autenticacao.Modulo.Modulo.Funcionalidade;
                    popup.Mensagem = "Deseja realmente excluir?";
                    popup.Tipo = InformacoesAlerta.TipoConfirma;
                    popup.param = hdnIdNome.Value + ";" + hdnDescricao.Value;
                    popup.ExecOk = ok;
                    popup.BotaoOk.OnClientClick = String.Empty;
                    popup.Mostrar();
                    break;
            }
        }
Example #18
0
    protected void lvItems_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        Literal ltItemID = (Literal)e.Item.FindControl("ltItemID");
        TextBox txtQty = (TextBox)e.Item.FindControl("txtQty");
        double price = GetPrice(ltItemID.Text);
        bool existingItem = IsExisting(ltItemID.Text);

        if (e.CommandName == "additem")
        {
            con.Open();
            SqlCommand com = new SqlCommand();
            com.Connection = con;
            if (existingItem)
            {
                com.CommandText = "UPDATE OrderDetails SET Quantity= Quantity + @Quantity " +
                    "WHERE OrderID=0 AND ItemID=@ItemID AND UserID=@UserID";
            }
            else
            {
                com.CommandText = "INSERT INTO OrderDetails VALUES (@OrderID, @UserID, @ItemID, " +
                    "@Quantity, @Remarks, @Status)";
            }
            com.Parameters.AddWithValue("@OrderID", 0);
            com.Parameters.AddWithValue("@ItemID", ltItemID.Text);
            com.Parameters.AddWithValue("@UserID", Session["userid"].ToString());
            com.Parameters.AddWithValue("@Quantity", txtQty.Text);
            com.Parameters.AddWithValue("@Remarks", DBNull.Value);
            com.Parameters.AddWithValue("@Status", "In Cart");
            com.ExecuteNonQuery();
            con.Close();
            Response.Redirect(Request.Url.AbsoluteUri);
        }
    }
 /// <summary>
 /// リストビューのアイテム中からのコマンドを受け取る
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void FileListView_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "Select")
     {
         DoDownload((e.CommandArgument as string) ?? "");
     }
 }
Example #20
0
        protected void ListViewShowThreePolls_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            ListViewItem lvi = e.Item;
            Button btn = (Button)lvi.FindControl("VoteButton");
            var commandArg = btn.CommandArgument.ToString();
            int pollID = int.Parse(commandArg);

            if (e.CommandName == "Vote")
            {
                RadioButtonList rbl = (RadioButtonList)lvi.FindControl("RadioButtonListShowingAnswers");
                var answerIDStr = rbl.SelectedValue;
                if (answerIDStr != "")
                {
                    int answerID = int.Parse(answerIDStr);
                    PollsDAL.VoteForPoll(answerID);
                    Response.Redirect("Voting.aspx?pollId=" + pollID);
                }
            }
            else if (e.CommandName == "Reset")
            {
                Response.Redirect("Voting.aspx?reset=true&pollId=" + pollID);
            }
            else if (e.CommandName == "Delete")
            {
                PollsDAL.DeletePoll(pollID);
                Response.Redirect("Polls.aspx");
            }
        }
    protected void ReservationSummaryListView_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        //this is the mthod which will gather the seating  information for reservation and pass to the BLL for proceosessing

        if (e.CommandName.Equals("Seat"))
        {
            //execuion if the code wukk ve uynder tghe controll
            MessageUserControl.TryRun(() =>
            {
                int reservationid = int.Parse(e.CommandArgument.ToString());
                    int waiterid = int.Parse(WaiterDropDownList.SelectedValue);
                    DateTime when = Mocker.MockDate.Add(Mocker.MockTime);
                List<byte> selectedTables = new List<byte>();
                //walk throug the list box row by row
                foreach (ListItem item_tableid in ReservationTableListBox.Items)
                {
                    if (item_tableid.Selected)
                    {
                        selectedTables.Add(byte.Parse(item_tableid.Text.Replace("Table ", "")));
                    }
                }

                //with all data gatherd, connet to your library controller, and send data for processing
                AdminController sysmgr = new AdminController();
                sysmgr.SeatCustomer(when reservationid, selectedTables, waiterid);

                SeatingGridView.DataBind();
                ReservationsRepeater.DataBind();
            }, "customer Seated", "Reservation  customer has been saeated");
        }
    }
Example #22
0
    protected void lvw_partsItemCommand(object sender, ListViewCommandEventArgs e)
    {
        try
        {
            string[] arg = new string[2];
            arg = e.CommandArgument.ToString().Split(';');

            int id = Convert.ToInt32(arg[0]);
            int quantity = Convert.ToInt32(arg[1]);

            if (quantity > 0)
            {
                ShoppingCart.GetInstance().AddItem(id, quantity);
                Session["databaseName"] = "Parts";
                Response.Redirect("ViewCart.aspx");
            }
            else
            {
                lblResult.Text = "That Item is Currently Sold Out!";
            }
        }
        catch(Exception)
        {
            lblResult.Text = "Couldn't Add Item to Cart!";
        }
    }
     protected void subupdel(object sender, ListViewCommandEventArgs e)
     {
         switch (e.CommandName)
         {
             case "Update":
                 TextBox txtfname = (TextBox)e.Item.FindControl("txtfnameU");
                 TextBox txtlname = (TextBox)e.Item.FindControl("txtlnameU");
                 DropDownList ddlvolType = (DropDownList)e.Item.FindControl("ddlvoltypeU");
                 TextBox txtemail = (TextBox)e.Item.FindControl("txtemailU");
                 TextBox txtcontact = (TextBox)e.Item.FindControl("txtcontactU");
                 HiddenField hdfID = (HiddenField)e.Item.FindControl("hdf_id");
                 
                  int volId = int.Parse(hdfID.Value.ToString());
                  _strMessage(objvolunteer.commitUpdate(volId, txtfname.Text, txtlname.Text, txtemail.Text, txtcontact.Text), "update");
                 
                _subRebind();
                break;
             case "Delete":
                int vol_Id = int.Parse(((HiddenField)e.Item.FindControl("hdf_idD")).Value);
                _strMessage(objvolunteer.commitDelete(vol_Id), "delete");
                _subRebind();
                break;
             case "Cancel":
                _subRebind();
                break;
                 

         }
    }
    //一般登入
    protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
    {
        if (e.CommandName == "login")
        {
            string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
            NTPCLibrary.User user = LoginUser;
            List<Department> departments = new List<Department>()
            {
                new Department()
                {
                    ID = commandArgs[0],
                    Name = commandArgs[1],
                    Groups = new List<string>()
                    {
                        commandArgs[2]
                    }
                }
            };
            user.Departments = departments;
            //設user cookie
            Util.SetCookie<NTPCLibrary.User>(Util.OPENID_SELECT_USER_COOKIE, user);

            //清除role cookie
            //Util.CleanCookie(Util.OPENID_ROLE_COOKIE);
            Util.SetCookie(Util.OPENID_ROLE_COOKIE, "0");

            //重導
            Response.Redirect(rd);

        }
    }
 protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "Cancel")
     {
         Response.Redirect("~/Client/clientaccount.aspx");
     }
 }
Example #26
0
    protected void ListViewUsers_ItemCommand(Object sender, ListViewCommandEventArgs e)
    {
        if (String.Equals(e.CommandName, "nominate"))
        {
            ISession session = DatabaseEntities.NHibernateHelper.CreateSessionFactory().OpenSession();
            DatabaseEntities.User userObjectNominee = DatabaseEntities.User.FindUser(session, int.Parse(e.CommandArgument.ToString()));

            LabelComplete.Text = "Thank you for nominating " + userObjectNominee.FirstName + " " + userObjectNominee.LastName + " for " + HiddenFieldPosition.Value;

            PanelSearch.Visible = false;
            PanelComplete.Visible = true;
            PanelComplete.Enabled = true;

            DatabaseEntities.User userObjectSubmitter = DatabaseEntities.User.FindUser(session, HttpContext.Current.User.Identity.Name);

            string[] info = { e.CommandArgument.ToString(), userObjectSubmitter.ID.ToString(), HiddenFieldPosition.Value };

            //inserts data into the db
            dbLogic.insertNominationAccept(info);

            string[] emailAddress = {userObjectNominee.Email};

            //send an email to the user nominated
            emailHelper.sendEmailToList(emailAddress, userObjectSubmitter.FirstName + " " + userObjectSubmitter.LastName + " has nominated you for the position of " + HiddenFieldPosition.Value + " for the next voting period!<br /><br />To be fully nominated you must first accept this nomination,<br /> then fill out the digital \"Willingness To Serve\" form.<br />To accept (or reject) this nomination, log into the <a href=\"" + System.Configuration.ConfigurationManager.AppSettings["baseUrl"] + "/\" target=\"_blank\"> Kutztown iVote website</a>.<br /><br />The iVote System Team", "You've been nominated for " + HiddenFieldPosition.Value);
        }
    }
        protected void uoListViewPortAgent_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            string strLogDescription;
            string strFunction;

            int index = GlobalCode.Field2Int(e.CommandArgument);

            if (e.CommandName == "Delete")
            {
                MaintenanceViewBLL.DeleteVehicleVendor(index, uoHiddenFieldUser.Value);

                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "Vehicle vendor branch deleted. (flagged as inactive)";
                strFunction       = "uoListViewPortAgent_ItemCommand";

                DateTime currentDate = CommonFunctions.GetCurrentDateTime();

                BLL.AuditTrailBLL.InsertLogAuditTrail(index, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, uoHiddenFieldUser.Value);

                GetPortAgentList();
            }
            else if (e.CommandName != "")
            {
                uoHiddenFieldSortBy.Value = e.CommandName;
                GetPortAgentList();
            }
            else
            {
                uoHiddenFieldSortBy.Value = "SortByName";
            }
        }
        protected void dlItems_ItemCommand(object source, ListViewCommandEventArgs e)
        {
            string stringId = e.CommandArgument.ToString();

            if (e.CommandName == "Add")
            {
                var message = TemplateService.GetTemplateArchiveFromRemoteServer(stringId);

                if (!message.IsNullOrEmpty())
                {
                    MsgErr(true);
                    MsgErr(message);
                }
            }

            if (e.CommandName == "Delete")
            {
                UninstallTemplate(stringId);
                SettingsDesign.Template = _default;
                CacheManager.Clean();
            }

            if (e.CommandName == "ApplyTheme")
            {
                SettingsDesign.Template = stringId;
                CacheManager.Clean();
            }
        }
Example #29
0
 protected void lvCategories_OnItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (string.Equals("DeleteCategory", e.CommandName))
     {
         CategoryService.DeleteCategoryAndPhotos(Convert.ToInt32(e.CommandArgument));
         CategoryService.RecalculateProductsCountManual();
     }
 }
Example #30
0
 protected void lvOrderStatuses_OnItemCommand(object sender, ListViewCommandEventArgs e)
 {
     if (e.CommandName == "ShowOrdersByStatus")
     {
         StatusId = Convert.ToInt32(e.CommandArgument);
         LoadOrders(StatusId);
     }
 }
Example #31
0
 protected void onlistcat(object sender, ListViewCommandEventArgs e)
 {
     //Label lblid = (Label)e.Item.FindControl("lblid");
     LinkButton hypcat = (LinkButton)e.Item.FindControl("hypcat");
     //  Response.Write("<script>alert('" + hypcat.Text + "')</script>");
     sqljobs.SelectCommand = "SELECT [Id], [Name], [abstract], [experience], [expires], [img],[Category] FROM [job] where [category]='" + hypcat.Text + "'";
     ListView2.DataBind();
 }
Example #32
0
 protected void ListView1_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
 {
     if (e.CommandName == "DeleteItem")
     {
         RecipeDataBaseRepository repo = new RecipeDataBaseRepository();
         repo.DeleteRecipe(Convert.ToInt32(e.CommandArgument));
         ListView1.DataBind();
         ShowAlertMessage(divMessage);
     }
 }
Example #33
0
        protected void ListView1_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            if (e.CommandName == "CompletedItem")
            {
                DbContext     db  = new DbContext();
                OracleCommand cmd = new OracleCommand("UPDATE sc_courses set completed='Y' where course_id=:v_courseid");

                OracleParameter para1 = new OracleParameter("v_courseid ", Convert.ToInt32(e.CommandArgument));
                cmd.Parameters.Add(para1);
                db.ExecuteNonQuery(cmd);

                ListView1.DataBind();
                divMessage.Attributes.Remove("class");
                divMessage.Attributes.Add("class", "alert alert-success");
                divMessageBody.InnerText = "The Courses was completed successfully.";
            }
        }
Example #34
0
    protected void lvInvoice_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
    {
        Literal ltInvoiceID = (Literal)e.Item.FindControl("ltInvoiceID");

        using (var con = new SqlConnection(Helper.GetCon()))
            using (var cmd = new SqlCommand())
            {
                con.Open();
                cmd.Connection  = con;
                cmd.CommandText = @"DELETE FROM Invoice
                                WHERE InvoiceID = @id";
                cmd.Parameters.AddWithValue("@id", ltInvoiceID.Text);
                cmd.ExecuteNonQuery();
            }

        GetInvoice();
    }
        protected void ListView1_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            if (e.CommandName == "DeleteItem")
            {
                DbContext     db  = new DbContext();
                OracleCommand cmd = new OracleCommand("delete_instuctor_sp");
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                OracleParameter para1 = new OracleParameter("v_instructorid ", Convert.ToInt32(e.CommandArgument));
                OracleParameter para2 = new OracleParameter("v_affectednumber", OracleDbType.Int32, ParameterDirection.Output);
                cmd.Parameters.Add(para1);
                cmd.Parameters.Add(para2);
                db.ExecuteNonQuery(cmd);

                ListView1.DataBind();
                divMessage.Attributes.Remove("class");
                divMessage.Attributes.Add("class", "alert alert-success");
                divMessageBody.InnerText = string.Format("Instructor and his {0} courses were deleted successfully.", para2.Value.ToString());
            }
        }
        /// <summary>
        /// Modified By: Charlene Remotigue
        /// Date Modified: 03/03/2012
        /// Description: add unlock user and reset password
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void uoUserList_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            string strLogDescription;
            string strFunction;

            if (e.CommandName == "Delete")
            {
                UserAccountBLL.DeleteUser(e.CommandArgument.ToString());

                DateTime dateNow          = CommonFunctions.GetCurrentDateTime();
                string   sUserNameDeleted = e.CommandArgument.ToString();


                //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                strLogDescription = "User account deleted. (flagged as inactive) " + sUserNameDeleted;
                strFunction       = "uoUserList_ItemCommand";


                BLL.AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                      CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, uoHiddenFieldUser.Value);

                GetUsers("", "");
            }

            else if (e.CommandName == "Unlock")
            {
                MembershipUser mUser = Membership.GetUser(e.CommandArgument.ToString());
                mUser.UnlockUser();
                AlertMessage("User " + e.CommandArgument.ToString() + " successfully unlocked.");
            }
            else if (e.CommandName == "Reset")
            {
                MembershipUser mUser  = Membership.GetUser(e.CommandArgument.ToString());
                string         str    = mUser.ResetPassword();
                string         sEmail = mUser.Email.ToString();
                SendEmail(e.CommandArgument.ToString(), sEmail, str);
                //AlertMessage("User password successfully reset. New password will be emailed to user.");
                AlertMessage("New password has been sent to " + mUser.Email + ".");
            }
        }
Example #37
0
        protected void listViewUsers_OnItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            if (String.Equals(e.CommandName, "Allow"))
            {
                // Verify that the employee ID is not already in the list. If not, add the
                // employee to the list.
                ListViewDataItem dataItem   = (ListViewDataItem)e.Item;
                string           employeeID =
                    listViewUsers.DataKeys[dataItem.DisplayIndex].Value.ToString();

                if (UserBLL.ActivateUserWith180DaysInacitvity(Int32.Parse(employeeID), this.AccountInfo.UserId))
                {
                    // usrSearchType = SearchType.Recent;

                    pager.SetPageProperties(0, pager.PageSize, false);


                    //Page.DataBind();
                    listViewUsers.DataBind();
                }
            }
        }
Example #38
0
        protected void ListView1_ItemCommand(object sender, System.Web.UI.WebControls.ListViewCommandEventArgs e)
        {
            if (e.CommandName == "DeleteItem")
            {
                DbContext     db  = new DbContext();
                OracleCommand cmd = new OracleCommand("DELETE sc_students where student_id= :v_studentid");
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                OracleParameter para1 = new OracleParameter("v_studentid ", Convert.ToInt32(e.CommandArgument));
                cmd.Parameters.Add(para1);
                db.ExecuteNonQuery(cmd);

                ListView1.DataBind();
                divMessage.Attributes.Remove("class");
                divMessage.Attributes.Add("class", "alert alert-success");
                divMessage.InnerText = "Student was deleted successfully.";
                return;
            }
            if (e.CommandName == "SelecteItem")
            {
                divCourse.Visible     = true;
                divStuentID.InnerText = e.CommandArgument.ToString();

                DbContext     db  = new DbContext();
                OracleCommand cmd = new OracleCommand("SELECT * FROM vw_courseEnroll where student_id=:v_studentid ORDER BY COMPLETED");

                OracleParameter para1 = new OracleParameter("v_studentid ", Convert.ToInt32(e.CommandArgument));
                cmd.Parameters.Add(para1);
                OracleDataReader reader = db.ExecuteReader(cmd);
                cblCourses.Items.Clear();
                while (reader.Read())
                {
                    ListItem item = new ListItem(reader["title"].ToString(), reader["course_id"].ToString());
                    item.Selected = ((reader["IsEnrolled"].ToString()) == "1");
                    item.Enabled  = (reader["completed"].ToString()) == "N";
                    cblCourses.Items.Add(item);
                }
            }
        }