예제 #1
0
        private void prelevementFond(string numAutorisationDepart)
        {
            #region declaration
            crlPrelevement        prelevement        = null;
            crlAutorisationDepart autorisationDepart = null;
            crlRecuAD             recuAD             = null;
            #endregion

            #region implementation
            if (numAutorisationDepart != "")
            {
                autorisationDepart = serviceAutorisationDepart.selectAutorisationDepart(numAutorisationDepart);
                if (autorisationDepart != null)
                {
                    if (autorisationDepart.ficheBord.autorisationVoyage.Verification.Licence.vehicule.paramVehicule.Fond > 0)
                    {
                        prelevement                       = new crlPrelevement();
                        prelevement.agent                 = agent;
                        prelevement.MatriculeAgent        = agent.matriculeAgent;
                        prelevement.MontantPrelevement    = autorisationDepart.ficheBord.autorisationVoyage.Verification.Licence.vehicule.paramVehicule.Fond;
                        prelevement.NumAutorisationDepart = autorisationDepart.NumAutorisationDepart;
                        prelevement.TypePrelevement       = "Fond";

                        prelevement.NumPrelevement = servicePrelevement.insertPrelevement(prelevement);

                        if (prelevement.NumPrelevement != "")
                        {
                            recuAD                = new crlRecuAD();
                            recuAD.Libele         = "Fond";
                            recuAD.agent          = agent;
                            recuAD.MatriculeAgent = agent.matriculeAgent;
                            recuAD.Montant        = prelevement.MontantPrelevement.ToString("0");
                            recuAD.NumPrelevement = prelevement.NumPrelevement;
                            recuAD.NumRecuAD      = serviceRecuAD.insertRecuAD(recuAD);

                            autorisationDepart.ResteRegle = autorisationDepart.ResteRegle - prelevement.MontantPrelevement;

                            serviceAutorisationDepart.updateAutorisationDepart(autorisationDepart);
                        }
                        else
                        {
                        }
                    }
                }
            }

            #endregion
        }
예제 #2
0
        protected void btnValider_Click(object sender, EventArgs e)
        {
            #region declaration
            crlRecuAD recuAD = null;
            #endregion

            #region implementation
            if (hfNumFacture.Value != "")
            {
                recuAD                = new crlRecuAD();
                recuAD.Libele         = "Paiement transporteur.";
                recuAD.MatriculeAgent = agent.matriculeAgent;
                recuAD.Montant        = TextMontantFacture.Text.Replace(" ", "");
                recuAD.NumFacture     = hfNumFacture.Value;
                recuAD.agent          = agent;

                recuAD.NumRecuAD = serviceRecuAD.insertRecuAD(recuAD);
                if (recuAD.NumRecuAD != "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "pdf",
                                                                string.Format("window.open('{0}','_blank','width={1},height={2},top={3},left={4}');", "../print/print.aspx?param=recuAD&numRecuAD=" + recuAD.NumRecuAD, 700,
                                                                              500, 10, 10), true);
                }
                else
                {
                    //
                }
            }
            else
            {
                //
            }
            #endregion
        }
예제 #3
0
        protected void btnValideAvance_Click(object sender, EventArgs e)
        {
            #region declaration
            crlRecuAD             recu               = null;
            crlPrelevement        prelevement        = null;
            crlAutorisationDepart autorisationDepart = null;
            #endregion

            #region implementation
            if (hfPrelevement.Value != "" && hfAutorisationDepart.Value != "")
            {
                if (agent.sessionCaisse != null)
                {
                    autorisationDepart = serviceAutorisationDepart.selectAutorisationDepart(hfAutorisationDepart.Value);
                    prelevement        = servicePrelevement.selectPrelevement(hfPrelevement.Value);
                    if (prelevement != null && autorisationDepart != null)
                    {
                        if (serviceRecuAD.isValideMontant(prelevement.MontantPrelevement, autorisationDepart.NumAutorisationDepart))
                        {
                            recu                = new crlRecuAD();
                            recu.agent          = agent;
                            recu.Date           = DateTime.Now;
                            recu.Libele         = ddlLibelle.Text;
                            recu.MatriculeAgent = agent.matriculeAgent;
                            recu.Montant        = prelevement.MontantPrelevement.ToString("0");
                            recu.NumPrelevement = prelevement.NumPrelevement;

                            recu.NumRecuAD = serviceRecuAD.insertRecuAD(recu);

                            if (recu.NumRecuAD != "")
                            {
                                serviceSessionCaisse.insertAssocSessionCaisseRecuAD(recu.NumRecuAD, agent.sessionCaisse.NumSessionCaisse);

                                this.initialiseGridPrelevement();
                                this.initialiseGridRecuAD();

                                autorisationDepart.ResteRegle = autorisationDepart.ResteRegle - prelevement.MontantPrelevement;
                                serviceAutorisationDepart.updateAutorisationDepart(autorisationDepart);

                                TextMontant.Text         = "";
                                TextType.Text            = "";
                                hfPrelevement.Value      = "";
                                ddlLibelle.SelectedValue = "";
                                this.afficheAutorisationDepart(hfAutorisationDepart.Value);

                                Page.ClientScript.RegisterClientScriptBlock(GetType(), "pdf",
                                                                            string.Format("window.open('{0}','_blank','width={1},height={2},top={3},left={4}');", "../print/print.aspx?param=recuAD&numRecuAD=" + recu.NumRecuAD, 700,
                                                                                          500, 10, 10), true);
                            }
                            else
                            {
                                //
                            }
                        }
                        else
                        {
                            //
                        }
                    }
                }
                else
                {
                    //
                }
            }
            else
            {
                //
            }
            #endregion
        }