예제 #1
0
        // GET: Broker/Delete/5
        public ActionResult Delete(int id)
        {
            broker b = brse.GetById(id);

            brse.DeleteBroker(b);
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public decimal?getTransactionFee(string transactionType, int?brokerId)
        {
            broker  broker         = this.GetBrokerById(brokerId);
            decimal?transactionFee = transactionType == "Buy" ? broker.buy_fee : broker.sell_fee;

            return(transactionFee);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            broker broker = db.brokers.Find(id);

            db.brokers.Remove(broker);
            db.SaveChanges();
            return(RedirectToAction("Index", "Admin"));
        }
예제 #4
0
        // GET: Broker/Details/5
        public ActionResult Details(int id)
        {
            var broker = new broker {
                idbroker = id, title = "HelloBroker"
            };

            return(View(broker));
        }
 public ActionResult Edit([Bind(Include = "Id,Code,Name,Email,City,CNIC,Contact_No,BrokerID")] broker broker)
 {
     if (ModelState.IsValid)
     {
         db.Entry(broker).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Admin"));
     }
     return(View(broker));
 }
예제 #6
0
 public bcertificate(broker b, string u, string a, rsakey uk, DateTime dt, string i, BigInteger sB)
 {
     brker   = b;
     user    = u;
     address = a;
     ukey    = uk;
     exp     = dt;
     info    = i;
     sigB    = sB;
 }
예제 #7
0
 public ActionResult GoBroker(broker broker)
 {
     using (agendaEntities1 db = new agendaEntities1())
     {
         db.brokers.Add(broker);
         db.SaveChanges();
     }
     ModelState.Clear();
     ViewBag.MessageSuccess = "successful";
     return(View("AddBroker", new broker()));
 }
예제 #8
0
        public Payword()
        {
            InitializeComponent();
            dredeem = new d_redemption(redemption);

            Vendor = new vendor();
            Vendor.setUIfront(Vtextbox);
            Vendor.setfref(this);
            Broker = new broker();
            Broker.setUIfront(Btextbox);
        }
        public ActionResult Create([Bind(Include = "Id,Code,Name,Email,City,CNIC,Contact_No,BrokerID")] broker broker)
        {
            if (ModelState.IsValid)
            {
                db.brokers.Add(broker);
                db.SaveChanges();
                return(RedirectToAction("Index", "Admin"));
            }

            return(View(broker));
        }
예제 #10
0
 public ActionResult Create(broker d)
 {
     if (ModelState.IsValid)
     {
         brse.AddBroker(d);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
예제 #11
0
 public ActionResult EditProfilBroker(broker EditToBroker)
 {
     try
     {
         db.Entry(EditToBroker).State = EntityState.Modified;               // si pas d'eerreur les changement s'effectue
         db.SaveChanges();
         return(RedirectToAction("ProfilBroker/" + EditToBroker.idBroker)); //redirige une fois le changement sauvegardé vers ...
     }
     catch
     {
         return(View());
     }
 }
        // GET: Broker/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            broker broker = db.brokers.Find(id);

            if (broker == null)
            {
                return(HttpNotFound());
            }
            return(View(broker));
        }
 public ActionResult Login(broker brokermodel)
 {
     using (DbModels db = new DbModels())
     {
         if (db.brokers.Any(x => x.Name == brokermodel.Name && x.Code == brokermodel.Code))
         {
             ViewBag.SuccessMessage = "Login Successful";
             Session["BrokerID"]    = brokermodel.BrokerID;
             return(RedirectToAction("Userprofile", "Broker"));
         }
         ViewBag.LoginErrorMessage = "Wrong Name and password";
         return(View("Login", brokermodel));
     }
 }
예제 #14
0
        // GET: Une methode qui permet d'afficher le ProfilBroker
        public ActionResult ProfilBroker(int?id)  // '?' rendre nullable l'id
        {
            if (id == null)
            {
                return(View("ErrorBadRequest"));
            }
            // recupère le broker par son id.
            broker brokerById = db.brokers.Find(id);

            if (brokerById == null)
            {
                return(View("ErrorPageNotFound"));
            }
            return(View(brokerById));
        }
예제 #15
0
        public BrokerBO AddBroker(BrokerBO broker)
        {
            broker _broker = new broker();

            _broker.brokername = broker.BrokerName;
            if (broker.Address != null)
            {
                _broker.addrkey = broker.Address.AddrKey;
            }
            _broker.brokerid = broker.BrokerId;
            var brokerguid = repo.Add(_broker);

            broker.BrokerKey = brokerguid;
            return(broker);
        }
예제 #16
0
 public ActionResult RegisterBroker(broker broker)
 {
     using (DbModels dbModel = new DbModels())
     {
         if (dbModel.brokers.Any(x => x.BrokerID == broker.BrokerID))
         {
             ViewBag.DuplicateMessage = "BrokerID already exists";
             return(View("RegisterBroker", broker));
         }
         dbModel.brokers.Add(broker);
         dbModel.SaveChanges();
     }
     ModelState.Clear();
     ViewBag.SuccessMessage = "Registeration successful";
     return(View("RegisterBroker", new broker()));
 }
예제 #17
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            broker a = brse.GetById(id);

            a.bonus           = float.Parse(collection["bonus"]);
            a.defaultCurrency = collection["defaultCurrency"];
            a.minDeposit      = float.Parse(collection["minDeposit"]);
            a.payment         = collection["payment"];
            a.spred           = float.Parse(collection["spred"]);

            a.title = collection["title"];
            brse.UpdateBroker(a);

            try
            {
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(a));
            }
        }
예제 #18
0
        public ActionResult AddBroker([Bind(Include = "idBroker, lastName, firstName, mail, phoneNumber")] broker BrokerToAdd)
        {
            string regexName  = @"^[A-Za-zéèëêuùçôàö\-]+$";
            string regexMail  = @"[0-9a-zA-Z\.\-]+@[0-9a-zA-Z\.\-]+.[a-zA-Z]{2,4}";
            string regexPhone = @"^[0][0-9]{9}";

            if (!string.IsNullOrEmpty(BrokerToAdd.lastName))
            {
                // verification de regex
                if (!Regex.IsMatch(BrokerToAdd.lastName, regexName))
                {
                    ModelState.AddModelError("LastName", "Ecrire un nom valide");
                }
            }
            // Verification si le champs est libre ou pas
            else
            {
                ModelState.AddModelError("LastName", "Ecrire un nom");
            }
            if (!string.IsNullOrEmpty(BrokerToAdd.firstName))
            {
                if (!Regex.IsMatch(BrokerToAdd.firstName, regexName))
                {
                    ModelState.AddModelError("firstName", "Ecrire un prénom valide");
                }
            }
            else
            {
                ModelState.AddModelError("firstName", "Ecrire un prénom");
            }
            if (!string.IsNullOrEmpty(BrokerToAdd.mail))
            {
                if (!Regex.IsMatch(BrokerToAdd.mail, regexMail))
                {
                    ModelState.AddModelError("mail", "Ecrire une adresse mail valide");
                }
            }
            else
            {
                ModelState.AddModelError("mail", "Ecrire une adresse mail");
            }
            if (!string.IsNullOrEmpty(BrokerToAdd.phoneNumber))
            {
                if (!Regex.IsMatch(BrokerToAdd.phoneNumber, regexPhone))
                {
                    ModelState.AddModelError("phoneNumber", "Ecrire une numero de tel valide");
                }
            }
            else
            {
                ModelState.AddModelError("phoneNumber", "Ecrire une numero de tel");
            }
            if (ModelState.IsValid)
            {
                db.brokers.Add(BrokerToAdd); // insertion dans la dataBase
                db.SaveChanges();            // enregistre les changements
                return(RedirectToAction("SuccessAddBroker"));
            }
            else
            {
                return(View(BrokerToAdd)); // Il y'a des erreurs
            }
        }
예제 #19
0
 public void DeleteBroker(broker b)
 {
     ut.BrokerRepository.Delete(b);
     ut.Commit();
 }
예제 #20
0
 public void UpdateBroker(broker b)
 {
     ut.BrokerRepository.Update(b);
     ut.Commit();
 }
        public ActionResult Login()
        {
            broker Brokermodel = new broker();

            return(View(Brokermodel));
        }
예제 #22
0
        public void DisplayPage()
        {
            try
            {
                ItemInfo = false;
                OrderInfo order = (OrderInfo)ClientContext.Context["LatestOrder"];
                Mediachase.eCF.BusLayer.Orders.Order _order;
                _order = new Mediachase.eCF.BusLayer.Orders.Order();

                string orderID = Request["orderID"];
                if (order == null && string.IsNullOrEmpty(orderID) == false)
                {
                    _order.LoadByPrimaryKey(int.Parse(orderID));
                }
                else
                {
                    _order.LoadByPrimaryKey(order.OrderId);
                }
                if (_order == null)
                {
                    Response.Redirect("~");
                }
                StringBuilder sb = new StringBuilder();

                DataSet ds21 = getsql("select uid from [order] where orderid=" + _order.OrderId.ToString());
                LitPixel2.Text = "";
                if (ds21.Tables.Count > 0)
                {
                    if (ds21.Tables[0].Rows.Count > 0)
                    {
                        if (ds21.Tables[0].Rows[0].ItemArray[0] != null)
                        {
                            if (ds21.Tables[0].Rows[0].ItemArray[0].ToString().ToUpper() == "ASN_ZZZ_0001")
                            {
                                LitPixel2.Text = "<img src='https://www.howlifeworks.com/Lib/conversion_tracker.aspx?Adv_ID=403' width='1' height='1' alt='' />";
                            }
                        }
                    }
                }

                //  foreach (OrderItem i in order.OrderItems)
                foreach (OrderSku i in _order.OrderSku)
                {
                    StringBuilder _sb = new StringBuilder();
                    _sb.Append(table);

                    // _sb.Replace("{Description}", i.ProductTitle);
                    _sb.Replace("{Description}", i.Sku.MetaFields["Everything_Description"].ToString());
                    //_sb.Replace("{Description}", i.Sku.Name);
                    if (i.SkuId == 347)
                    {
                        _sb.Replace("{Quantity}", i.Quantity.ToString());
                        _sb.Replace("{Price}*", "7.95".ToString());
                    }
                    else if (i.SkuId == 336)
                    {
                        ItemInfo = true;
                        _sb.Replace("{Quantity}", i.Quantity.ToString());
                        _sb.Replace("{Price}", "9.95".ToString());
                    }
                    else
                    {
                        _sb.Replace("{Quantity}", i.Quantity.ToString());
                        _sb.Replace("{Price}*", Math.Round(Convert.ToDouble((i.Quantity * i.Price).ToString()), 2).ToString());
                    }

                    sb.Append(_sb.ToString());
                }
                sb.Replace("~", ((char)(34)).ToString());
                LiteralTableRows.Text = sb.ToString();
                LiteralSubTotal.Text  = Math.Round(_order.SubTotal, 2).ToString();
                LiteralShipping.Text  = Math.Round(_order.ShippingCost, 2).ToString();
                LiteralTax.Text       = Math.Round(_order.Tax, 2).ToString();
                LiteralTotal.Text     = Math.Round((_order.SubTotal + _order.ShippingCost + _order.Tax), 2).ToString();

                DataSet shippingAddress = getsql("SELECT A.*, country.Code FROM [ORDERSHIPMENT] OS INNER JOIN ADDRESS A ON A.ADDRESSID = OS.ADDRESSID LEFT OUTER JOIN COUNTRY ON COUNTRY.COUNTRYID = A.COUNTRYID WHERE ORDERID = " + _order.OrderId);
                if (shippingAddress != null && shippingAddress.Tables.Count > 0)
                {
                    LiteralName.Text     = shippingAddress.Tables[0].Rows[0]["FirstName"].ToString() + " " + shippingAddress.Tables[0].Rows[0]["LastName"].ToString();
                    LiteralAddress.Text  = shippingAddress.Tables[0].Rows[0]["Address1"].ToString();
                    LiteralAddress2.Text = shippingAddress.Tables[0].Rows[0]["Address2"].ToString();
                    LiteralCity.Text     = shippingAddress.Tables[0].Rows[0]["City"].ToString();
                    LiteralState.Text    = shippingAddress.Tables[0].Rows[0]["StateProvince"].ToString();
                    LiteralZip.Text      = shippingAddress.Tables[0].Rows[0]["ZipPostalCode"].ToString();
                    LiteralCountry.Text  = shippingAddress.Tables[0].Rows[0]["Code"].ToString();
                }

                LiteralEmail.Text = _order.Email.ToString();

                DataSet billingAddress = getsql("SELECT A.*, country.Code FROM [ORDER] O INNER JOIN ADDRESS A ON A.ADDRESSID = O.BILLINGADDRESSID LEFT OUTER JOIN COUNTRY ON COUNTRY.COUNTRYID = A.COUNTRYID WHERE ORDERID = " + _order.OrderId);
                if (billingAddress != null && shippingAddress.Tables.Count > 0)
                {
                    LiteralName_b.Text     = shippingAddress.Tables[0].Rows[0]["FirstName"].ToString() + " " + shippingAddress.Tables[0].Rows[0]["LastName"].ToString();
                    LiteralAddress_b.Text  = shippingAddress.Tables[0].Rows[0]["Address1"].ToString();
                    LiteralAddress2_b.Text = shippingAddress.Tables[0].Rows[0]["Address2"].ToString();
                    LiteralCity_b.Text     = shippingAddress.Tables[0].Rows[0]["City"].ToString();
                    LiteralState_b.Text    = shippingAddress.Tables[0].Rows[0]["StateProvince"].ToString();
                    LiteralZip_b.Text      = shippingAddress.Tables[0].Rows[0]["ZipPostalCode"].ToString();
                    LiteralCountry_b.Text  = shippingAddress.Tables[0].Rows[0]["Code"].ToString();
                }

                ConversionSystems.MediaChase.Web.ProductHelper.SendOrderCompletedEmail(_order, ClientContext.Context.CurrentLanguage, RM, ItemInfo);


                //Get 3rd Party Upsell.
                broker        mySSOLWS     = new broker();
                WDIAuthHeader myAuthHeader = new WDIAuthHeader();

                mySSOLWS.Url = "https://secure.majorsavings.com/SmartSellOnlineWS/broker.asmx?wsdl";

                myAuthHeader.Username    = "******";
                myAuthHeader.Password    = "******";
                myAuthHeader.AffiliateId = 98;

                mySSOLWS.WDIAuthHeaderValue = myAuthHeader;

                SSTeaser myTeaser = default(SSTeaser);
                string   ccexp    = Convert.ToDateTime(_order.CreditCardExpired).ToString("MMyyyy");
                string   ccnum    = _order.CreditCardNumber;
                string   cctype   = "";
                if (_order.CreditCardName.ToLower().Contains("visa"))
                {
                    cctype = "V";
                }
                else if (_order.CreditCardName.ToLower().Contains("AmericanExpress"))
                {
                    cctype = "A";
                }
                else if (_order.CreditCardName.ToLower().Contains("Discover"))
                {
                    cctype = "D";
                }
                else if (_order.CreditCardName.ToLower().Contains("MasterCard"))
                {
                    cctype = "M";
                }
                else if (_order.CreditCardName.ToLower().Contains("amex"))
                {
                    cctype = "A";
                }
                string countryCode = "";
                if (LiteralCountry_b.Text.ToLower().Contains("us"))
                {
                    countryCode = "1";
                }
                else if (LiteralCountry_b.Text.Contains("canada"))
                {
                    countryCode = "2";
                }

                string t = "ZQUIET2" + "" + _order.Email + LiteralName_b.Text + LiteralAddress_b.Text + "" + LiteralCity_b.Text + LiteralState_b.Text + LiteralZip_b.Text + countryCode + GetCleanPhoneNumber(billingAddress.Tables[0].Rows[0]["PhoneNumber"].ToString()) + cctype + ccnum + ccexp + _order.OrderId + "N";

                myTeaser = mySSOLWS.getTeaser("ZQUIET2", "", _order.Email, billingAddress.Tables[0].Rows[0]["FirstName"].ToString(), billingAddress.Tables[0].Rows[0]["LastName"].ToString(),
                                              LiteralAddress_b.Text, "", LiteralCity_b.Text, LiteralState_b.Text, LiteralZip_b.Text, countryCode, GetCleanPhoneNumber(billingAddress.Tables[0].Rows[0]["PhoneNumber"].ToString()), cctype, ccnum, ccexp, _order.OrderId, "N");
                test.Text = t;
                if (myTeaser.rc == 0)
                {
                    SmartSell.NavigateUrl = myTeaser.target;
                    SmartSell.ImageUrl    = myTeaser.source;
                    SmartSell.Visible     = true;
                }
                else
                {
                    SmartSell.Visible = false;
                }
                PanelItemInfo.Visible = ItemInfo;
            }
            catch (Exception e)
            {
            }
        }
예제 #23
0
        public ActionResult Gobroker(int id = 0) // Methode pour aller à la view AddBroker.
        {
            broker broker = new broker();

            return(View("AddBroker")); //nom de la view.
        }
예제 #24
0
 public void AddBroker(broker b)
 {
     ut.BrokerRepository.Add(b);
     ut.Commit();
 }
예제 #25
0
        //[ValidateAntiForgeryToken]
        public ActionResult ProfilBroker([Bind(Include = "idBroker,lastName,firstName,mail,phoneNumber")] broker brokerList)
        {
            //Déclaration des Regexs
            string regexName  = @"^[A-Za-zéèàêâôûùïüç-]+$";
            string regexMail  = @"^[0-9a-zA-Z.-]+@[0-9a-zA-Z.-]+.[a-zA-Z]{2,4}";
            string regexPhone = @"^[0][0-9]{9}";

            //Vérification que le champ lastName ne soit pas incorrect ou null
            if (!String.IsNullOrEmpty(brokerList.lastName))  //si le champ mail n'est pas vide ou null on vérifie la validité de l'entrée
            {
                if (!Regex.IsMatch(brokerList.lastName, regexName))
                {
                    //Message d'erreur
                    ModelState.AddModelError("lastName", "Votre nom n'est pas valide");
                }
            }
            else
            {
                //Message d'erreur si le lastName est vide ou null
                ModelState.AddModelError("lastName", "Veuillez remplir ce champ");
            }
            //Vérification que le champ firstName ne soit pas incorrect ou null
            if (!String.IsNullOrEmpty(brokerList.firstName))         //si le champ firstName n'est pas vide ou null on vérifie la validité de l'entrée
            {
                if (!Regex.IsMatch(brokerList.firstName, regexName)) //si l'entrée utilisateur ne passe pas la regex ajout d'un message d'erreur
                {
                    //Message d'erreur
                    ModelState.AddModelError("firstName", "Votre prénom n'est pas valide");
                }
            }
            else
            {
                //Message d'erreur si le firstName est vide ou null
                ModelState.AddModelError("firstName", "Veuillez remplir ce champ");
            }
            //Vérification que le champ email ne soit pas incorrect ou null
            if (!String.IsNullOrEmpty(brokerList.mail)) //si le champ mail n'est pas vide ou null on vérifie la validité de l'entrée
            {
                if (!Regex.IsMatch(brokerList.mail, regexMail))
                {
                    //Message d'erreur
                    ModelState.AddModelError("mail", "Veuillez écrire un email valide");
                }
            }
            else
            {
                //Message d'erreur si le mail est vide ou null
                ModelState.AddModelError("mail", "Veuillez remplir ce champ");
            }
            if (!String.IsNullOrEmpty(brokerList.phoneNumber)) //si le champ phoneNumber n'est pas vide ou null on vérifie la validité de l'entrée
            {
                if (!Regex.IsMatch(brokerList.phoneNumber, regexPhone))
                {
                    //Message d'erreur
                    ModelState.AddModelError("phoneNumber", "Veuillez saisir un numéro valide");
                }
            }
            else
            {
                //Message d'erreur si le numéro de téléphone est vide ou null
                ModelState.AddModelError("phoneNumber", "Veuillez remplir ce champ");
            }
            if (ModelState.IsValid)
            {
                db.Entry(brokerList).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("successAddBroker"));
            }
            else
            {
                return(View("ProfilBroker"));
            }
        }
예제 #26
0
        public broker GetBrokerById(int?brokerId)
        {
            broker broker = entities.brokers.Where(q => q.id == brokerId).FirstOrDefault();

            return(broker);
        }