Esempio n. 1
0
        public ActionResult Demandes(int actionChoisie)
        {
            ActionDAO dao = new ActionDAO();

            //On considère que l'utilisateur 3 est connecté
            ViewBag.listeActions = dao.RecupererListeActivitesEtDatesParUtil(3); //Par défaut utilisateur 3

            ReponseDao daoReponse = new ReponseDao();

            ViewBag.lesReponses = daoReponse.RecupererReponsesAffichage(actionChoisie);
            List <ReponseAffichage> lesReponses = daoReponse.RecupererReponsesAffichage(actionChoisie);

            List <DateTime> dateContact     = new List <DateTime>();
            List <string>   activiteContact = new List <string>();

            for (int i = 0; i < lesReponses.Count; i++)
            {
                int id_volontaire = (int)lesReponses[i].IdUtilisateur;
                var monTuple      = dao.DernierService(3, id_volontaire); //Par défaut utilisateur (bénéficiaire) 3
                dateContact.Add(monTuple.Item1);
                activiteContact.Add(monTuple.Item2);
            }
            ViewBag.IdActionChoisi   = actionChoisie;
            ViewBag.effectueDate     = dateContact;
            ViewBag.effectueActivite = activiteContact;
            ViewBag.detailAction     = dao.GetActionBenefChoisie(actionChoisie);
            ViewBag.detailBenevole   = daoReponse.RecupererUtilisateurSelectionne(actionChoisie);
            return(View("Demandes"));
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                ActionDAO dao  = new ActionDAO();
                string[]  data = dao.GetDataAndXslt(actionID);
                if (data[0] == string.Empty || data[1] == string.Empty)
                {
                    emptyData.Visible = true;
                    return;
                }

                xml.DocumentContent = data[1];
                XslTransform actionXslt = new XslTransform();
                actionXslt.Load(XmlReader.Create(new StringReader(data[0])));
                xml.Transform = actionXslt;

                //// compiled xslt transform
                //XslCompiledTransform actionXsltc = new XslCompiledTransform();
                //actionXsltc.Load(XmlReader.Create(new StringReader(data[0])));
                //XmlReader xr = XmlReader.Create(new StringReader(data[1]));
                //StringBuilder sb = new StringBuilder();
                //XmlWriter xw = XmlWriter.Create(sb);

                //actionXsltc.Transform(xr, xw);
                //xr.Close();
                //xw.Close();
                //xml.DocumentContent = sb.ToString();
            }
            catch
            {
                BaseContentPage.SetError("Nie uda³o siê zobrazowaæ saczegó³ów akcji", "~/OczekujaceZadania.xslt");
            }
        }
Esempio n. 3
0
        public ActionResult posterDemande(int lstService, int idMateriel, DateTime dateRealisation, int lstHeureDebut,
                                          int lstMinuteDebut, int lstHeureFin, int lstMinuteFin, int lstVille, string txtAdresse, bool ckbRecurrence)
        {
            // enregistrer les infos en base
            ActionDAO myActionDao = new ActionDAO();
            int       idAction    = myActionDao.ObtenirProchainIdAction();
            Action    action      = new Action()
            {
                Id_action             = idAction,
                Id_util               = 3, //Par défaut utilisateur 3
                Id_ville              = lstVille,
                Id_activite           = lstService,
                Id_gamme_heure_debut  = lstHeureDebut,
                Id_gamme_minute_debut = lstMinuteDebut,
                Id_gamme_heure_fin    = lstHeureFin,
                Id_gamme_minute_fin   = lstMinuteFin,
                Id_final              = 1,
                Date_action           = dateRealisation,
                Voie_action           = txtAdresse,
                Date_soumission       = DateTime.Now
            };

            try
            {
                myActionDao.EnregistrerNouvelleAction(action);
            } catch (Exception)
            {
                return(RedirectToAction("posterDemande"));
            }


            return(RedirectToAction("posterDemande"));
        }
Esempio n. 4
0
        public IActionResult Demandes()
        {
            ActionDAO dao = new ActionDAO();

            ViewBag.listeActions   = dao.RecupererListeActivitesEtDatesParUtil(3); //Par défaut utilisateur 3
            ViewBag.IdActionChoisi = null;
            return(View("Demandes"));
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["{A9369F29-4E10-48ab-9E52-B4D415CF402A}"] = "LinkButton4";
            if (CoreObject.GetId(Request) <= 0)
            {
                BaseContentPage.SetError("Sprawa o podanym numerze nie istnieje", "~/Akta/AktaSpraw.aspx");
            }
            if (!IsPostBack)
            {
                int caseId = CoreObject.GetId(Request);
                if (caseId > 0)
                {
                    if (!Page.User.IsInRole("Administratorzy") && !(new CaseDAO()).IsCaseVisibleForUser(caseId, new Guid(Membership.GetUser().ProviderUserKey.ToString())))
                    {
                        BaseContentPage.SetError("Nie masz uprawnieñ do tej sprawy", "~/OczekujaceZadania.aspx");
                    }
                }
                ActionDAO dao     = new ActionDAO();
                string    xmlData = string.Empty;
                try
                {
                    //using (XmlReader xr = dao.GetAvailableActions(int.Parse(Session["idSprawy"].ToString()), (Guid)Membership.GetUser().ProviderUserKey, ActionMask.Case,ActionType.CalledFromList))
                    using (XmlReader xr = dao.GetAvailableActions(CoreObject.GetId(Request), (Guid)Membership.GetUser().ProviderUserKey, ActionMask.Case, ActionType.CalledFromList))
                    {
                        if (xr.Read())
                        {
                            xmlData = xr.ReadOuterXml();
                        }
                    }

                    XmlDataSource xds = new XmlDataSource();
                    xds.Data          = xmlData;
                    xds.EnableCaching = false;
                    lista.DataSource  = null;
                    if (xds.Data != "")
                    {
                        xds.XPath        = "/akcje/akcja";
                        lista.DataSource = xds;
                    }
                    lista.DataBind();
                }
                catch //(Exception ex)
                {
                    BaseContentPage.SetError("Nie uda³o siê odnaleŸæ sprawy", "~/Akta/AktaSpraw.aspx");
                }
            }
        }
        public ActionResult afficherActions()
        {
            ActionDAO daoAction = new ActionDAO();

            ViewBag.lesActionsAffichages = daoAction.ActionAffichagesFromBdd(3); //Par défaut utilisateur 3

            GenererContenuInput();

            ViewBag.dateFrom     = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.dateFromMini = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.dateTo       = DateTime.Now.AddDays(14).ToString("yyyy-MM-dd");
            ViewBag.dateToMini   = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.villeSelect  = 0;
            ViewBag.activSelect  = 9;

            return(View("rechercherAction"));
        }
Esempio n. 7
0
 public Action(Guid definitionId)
 {
     this.definitionId = definitionId;
     using (XmlReader xr = new ActionDAO().GetActionDefinition(definitionId))
     {
         if (!xr.Read())
         {
             throw new ArgumentException("Nie ma takiej definicji akcji");
         }
         XPathDocument  xpd = new XPathDocument(xr);
         XPathNavigator xpn = xpd.CreateNavigator();
         this.name             = xpn.SelectSingleNode("/akcja/nazwa").Value;
         this.description      = xpn.SelectSingleNode("/akcja/opis").Value;
         this.logEntryTemplate = xpn.SelectSingleNode("/akcja/szablon").Value;
         this.parameterCount   = xpn.SelectSingleNode("/akcja/definicja/liczbaParametrow").ValueAsInt;
     }
 }
Esempio n. 8
0
        private void submit_action_Click(object sender, EventArgs e)
        {
            AskAdminID admin = new AskAdminID();

            admin.ShowDialog();

            int admin_id = admin.id;

            if (state_list.SelectedItem.ToString().Equals(ticket.STATE))
            {
                int order = steps_list.SelectedIndex;
                if (order >= 0)
                {
                    L_IckEtS.model.Action action = new L_IckEtS.model.Action(note.Text, ticket.code, admin_id, order + 1, ticket.id_type);
                    ActionDAO.insertAction(database, action);
                    Close();
                }
                else
                {
                    MessageBox.Show("Must Select a step");
                }
                //TODO: Test
            }
            else
            {
                if (actions_list.Items.Count > 0)
                {
                    if (ticket.admin_id == admin_id)
                    {
                        TicketDAO.closeTicket(database, ticket.code);
                        OnTicketChanged(EventArgs.Empty);
                        Close();
                    }
                    else
                    {
                        MessageBox.Show("You cannot close this ticket");
                    }
                }
                else
                {
                    MessageBox.Show("This ticket has no Actions");
                }
            }
        }
        public ActionResult afficherActions(int radioActivite, int lstVille, DateTime dateFrom, DateTime dateTo)
        {
            //l'id Utilisateur est codé en dur; c'est le numéro 3 dans la fonction ci-dessous
            ActionDAO daoAction = new ActionDAO();
            List <ActionAffichage> maListeRecherchee = daoAction.ActionAffichagesRechercheFromBdd(radioActivite, lstVille, dateFrom, dateTo, 3);

            ViewBag.lesActionsAffichages = maListeRecherchee;

            GenererContenuInput();

            ViewBag.dateFrom     = dateFrom.ToString("yyyy-MM-dd");
            ViewBag.dateFromMini = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.dateTo       = dateTo.ToString("yyyy-MM-dd");
            ViewBag.dateToMini   = DateTime.Now.ToString("yyyy-MM-dd");
            ViewBag.villeSelect  = lstVille;
            ViewBag.activSelect  = radioActivite - 1; // Décalage lié au fait que l'indice commence à 1 en BDD dans la table Activité

            return(View("rechercherAction"));
        }
Esempio n. 10
0
        protected void actions_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "exportXslt")
            {
                ActionDAO dao  = new ActionDAO();
                string    xslt = dao.GetXslt(new Guid(e.CommandArgument.ToString()));


                Response.Clear();
                Response.ContentType = "text/xml";
                Response.AddHeader("Content-Disposition", "attachment; filename=szablon.xslt");

                Response.Write(xslt);
                Response.Flush();
                Response.Close();

                return;
            }
            mv1.ActiveViewIndex = 1;
        }
Esempio n. 11
0
        private void edit_ticket_Click(object sender, EventArgs e)
        {
            if (ticket_list.SelectedItems.Count < 1)
            {
                MessageBox.Show("You need to select a Ticket");
            }
            else
            {
                int code = int.Parse(ticket_list.SelectedItems[0].Text);

                var ticket = TicketDAO.getTicketById(database, code);
                var type   = ticket.id_type != null?TypeDAO.getType(database, ticket.id_type.Value) : null;

                var client        = ClientDAO.getClient(database, ticket.client_id);
                var admin         = AdminDAO.getAdminByID(database, ticket.admin_id);
                var info_requests = RequestDAO.getTicketRequests(database, code);
                var actions       = ActionDAO.getTicketActions(database, code);
                var steps         = type != null?StepDAO.getStepsOfType(database, type.id) : null;

                TicketDetails t = new TicketDetails(database, ticket, type, client, admin, info_requests, actions, steps);
                t.Changed += new TicketDetails.RemovedEventHandler(TicketRemoved);
                t.Show();
            }
        }
Esempio n. 12
0
        public ActionResult listeActions()
        {
            ActionDAO myDAO = new ActionDAO();

            ViewBag.test = myDAO.GetPremierString();
            Action ActionResult = myDAO.LireAction(3);

            ViewBag.result = ActionResult.ToString();

            //List<Action> maListe = myDAO.RecupererListeActions();
            //ViewBag.data = maListe;
            ViewBag.data = myDAO.RecupererListeActionsParUtil(1);
            var test = myDAO.DernierService(3, 2);  //Par défaut utilisateur 3

            ViewBag.test1 = test.Item1;
            ViewBag.test2 = test.Item2;

            int x = 00;

            ViewBag.X = x;


            return(View());
        }
Esempio n. 13
0
        private string Create(string match, string mitemps, string temps, string equipe, string joueur, string action, string remarque)
        {
            string result = "";

            try {
                PartieDAO        ptdao = new PartieDAO(connexion);
                EquipeDAO        eqdao = new EquipeDAO(connexion);
                EquipeDetailsDAO eddao = new EquipeDetailsDAO(connexion);
                ActionDAO        acdao = new ActionDAO(connexion);
                PartieDetailsDAO pddao = new PartieDetailsDAO(connexion);

                Partie        pt     = ptdao.Select("WHERE id='" + match + "'").First();
                Equipe        eq     = eqdao.Select("WHERE nom='" + equipe + "'").First();
                EquipeDetails detail = eddao.Select("WHERE id='" + joueur + "'").First();
                Model.Action  act    = acdao.Select("WHERE id='" + action + "'").First();

                PartieDetails pd = new PartieDetails(pt, int.Parse(mitemps), Convert.ToDateTime(temps), eq, detail, act, remarque);

                result = pddao.Insert(pd.ToInsert());
            } catch (Exception ex) {
                throw ex;
                //System.Windows.Forms.MessageBox.Show(ex.StackTrace);
            } return(result);
        }
Esempio n. 14
0
 static public void CreaAction(string nouvelleAction)
 {
     ActionDAO.GetInstance().CreaAction(new Action(nouvelleAction));
 }
Esempio n. 15
0
        //Appel de la couche DAL pour récupérer une liste de Action

        public List <Action> GetActions()
        {
            return(ActionDAO.GetInstance().GetActions());
        }
Esempio n. 16
0
        // METHODS :

        private void InitDAO()
        {
            acdao = new ActionDAO(connexion);
        }