コード例 #1
0
        public static UserCreateResults CreateSupplier(string email, string password, Int64 CityId, out AppSupplier supplier)
        {
            supplier = null;
            if (!email.IsValidEmail())
            {
                return(UserCreateResults.InvalidEmailAddress);
            }
            supplier = AppSupplier.FetchByEmail(email);
            if (supplier != null)
            {
                return(UserCreateResults.AlreadyExists);
            }
            supplier                = new AppSupplier();
            supplier.Email          = email;
            supplier.UniqueIdString = email.NormalizeEmail();

            string pwd, salt;

            EncodePassword(password, out pwd, out salt);
            supplier.Password     = pwd;
            supplier.PasswordSalt = salt;

            try
            {
                supplier.AddressLocation = new Geometry.Point(0, 0);//TODO
                supplier.CityId          = CityId;
                supplier.Save();
                return(UserCreateResults.Success);
            }
            catch
            {
                supplier = null;
                return(UserCreateResults.UnknownError);
            }
        }
コード例 #2
0
        public static Order GenerateNewOrder(ProcessingResults results, long userId, long bidId, string gifts, long supplierId, decimal totalPrice, Source source)
        {
            //  var messageId = BIdMessageController.AddNewMessage(bidId, supplierId, 0, BIdMessageController.ADMIN_STAGE);
            var messageId = BIdMessageController.AddNewMessage(bidId, supplierId);

            var order = new Order
            {
                AppUserId             = userId,
                BidId                 = bidId,
                CreateDate            = DateTime.UtcNow,
                Last4Digits           = results.Last4Digits,
                UserPaySupplierStatus = UserPaymentStatus.NotPayed,
                TotalPrice            = totalPrice,
                Transaction           = results.CardToken,
                ExpiryDate            = results.CardExpiration,
                AuthNumber            = results.AuthNumber,
                Gifts                 = gifts,
                SpecialInstructions   = results.SpecialInstructions ?? "",
                NumOfPayments         = results.NumOfPayments,
                Source                = (int)source,
            };

            order.Save();

            AppUserCard paymentToken = AppUserCard.FetchByAppUserId(userId);

            if (paymentToken == null)
            {
                paymentToken = new AppUserCard();
            }
            paymentToken.AppUserId  = userId;
            paymentToken.CardToken  = results.CardToken;
            paymentToken.ExpiryDate = results.CardExpiration;
            paymentToken.Last4Digit = results.Last4Digits;
            if (!String.IsNullOrEmpty(results.PersonalId))
            {
                paymentToken.IdNumber = results.PersonalId;
            }
            paymentToken.Save();

            AppSupplier supplier = AppSupplier.FetchByID(supplierId);

            if (supplier != null)
            {
                supplier.MaxWinningsNum = (supplier.MaxWinningsNum > 0 ? supplier.MaxWinningsNum - 1 : 0);
                if (supplier.MaxWinningsNum == 0)
                {
                    // SupplierNotification.SendNotificationMaxAutoModeMessage(supplier.SupplierId);
                }
                supplier.Save();
            }
            SMSController.sendNewBidSMS(AppUser.FetchByID(userId).Phone);
            return(order);
        }
コード例 #3
0
 private void Save(AppSupplier supplier)
 {
     supplier.BusinessName = txtbusiness.Text;
     supplier.ContactName  = txtContactName.Text;
     supplier.Email        = txtEmail.Text;
     supplier.ContactPhone = txtContactPhone.Text;
     supplier.HouseNum     = txtNumber.Text;
     supplier.Street       = txtStreet.Text;
     supplier.CityId       = Convert.ToInt64(ddlCity.SelectedValue);
     supplier.Phone        = txtPhone.Text;
     supplier.Description  = txtDescription.Text;
     supplier.Discount     = txtDiscount.Text;
     if (txtPassword.Text.Trim() != "" && txtConfirmPassword.Text.Trim() != "")
     {
         string pwd, salt;
         AppMembership.EncodePassword(txtPassword.Text.Trim(), out pwd, out salt);
         supplier.Password     = pwd;
         supplier.PasswordSalt = salt;
     }
     if (supplier.IsService)
     {
         supplier.ApprovedTermsDate = DateTime.Now;
         if (fuImage.HasFile)
         {
             string fn = MediaUtility.SaveFile(fuImage.PostedFile, "SupplupCityier/225x225", 0, true);
             supplier.ProfileImage = fn;
             imgImage.ImageUrl     = Snoopi.core.MediaUtility.GetImagePath("Supplier", supplier.ProfileImage, 0, 225, 225);
             ImageFileHandler(fuImage, imgImage, btnDeleteImage, imgImage.ImageUrl);
         }
         else if (supplier.ProfileImage != "" && fuImage.Visible)
         {
             MediaUtility.DeleteImageFilePath("Supplier", supplier.ProfileImage, 225, 225, 0);
             supplier.ProfileImage = "";
         }
     }
     supplier.Save();
     Response.Redirect("MyProfile.aspx");
     Master.MessageCenter.DisplaySuccessMessage(SupplierProfileStrings.GetText(@"Success"));
 }
コード例 #4
0
        public static UserPasswordChangeResults ChangeSupplierPassword(string email, string newPassword)
        {
            AppSupplier supplier = AppSupplier.FetchByEmail(email);

            if (supplier == null)
            {
                return(UserPasswordChangeResults.UserDoesNotExist);
            }
            if (string.IsNullOrEmpty(supplier.PasswordSalt))
            {
                string pass, salt;
                EncodePassword(newPassword, out pass, out salt);
                supplier.Password     = pass;
                supplier.PasswordSalt = salt;
            }
            else
            {
                supplier.Password = EncodePassword(newPassword, supplier.PasswordSalt);
            }
            supplier.Save();
            return(UserPasswordChangeResults.Success);
        }
コード例 #5
0
        public static UserRecoveryResults SupplierVerifyRecoveryKey(string email, string key, string newPassword)
        {
            AppSupplier user = AppSupplier.FetchByEmail(email);

            if (user == null)
            {
                return(UserRecoveryResults.UserDoesNotExist);
            }

            if (user.PasswordRecoveryKey != key)
            {
                return(UserRecoveryResults.KeyDoNotMatch);
            }

            if (user.PasswordRecoveryDate.AddHours(RecoveryKeyLifeInHours) < DateTime.UtcNow)
            {
                return(UserRecoveryResults.Expired);
            }

            if (newPassword == null)
            {
                return(UserRecoveryResults.Success);
            }
            else
            {
                string pwd, salt;
                EncodePassword(newPassword, out pwd, out salt);
                user.Password             = pwd;
                user.PasswordSalt         = salt;
                user.PasswordRecoveryKey  = @"";
                user.PasswordRecoveryDate = DateTime.UtcNow;
                user.IsLocked             = false;
                user.Save();

                return(UserRecoveryResults.Success);
            }
        }
コード例 #6
0
        public override void Post(HttpRequest Request, HttpResponse Response, params string[] PathParams)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetMaxAge(TimeSpan.Zero);
            JObject inputData = null;

            try
            {
                using (StreamReader reader = new StreamReader(Request.InputStream))
                {
                    using (JsonTextReader jsonReader = new JsonTextReader(reader))
                    {
                        inputData = JObject.Load(jsonReader);
                    }
                }
            }
            catch
            {
                RespondBadRequest(Response);
            }

            Int64 AppUserId;

            if (IsAuthorizedRequest(Request, Response, true, out AppUserId))
            {
                Response.ContentType = @"application/json";

                try
                {
                    JToken jt;
                    string response_code = null, card_tk = null, expire_date = null, last4_digits = null, id_number = null, special_instructions = null, response_error_message = null;
                    Int64  bid_id = 0, offer_id = 0, donation_id = 0;
                    Int64  campaign_id = 0;
                    //if (inputData.TryGetValue(@"response_code", out jt)) response_code = jt.Value<string>();
                    //if (inputData.TryGetValue(@"response_error_message", out jt)) response_error_message = jt.Value<string>();
                    if (inputData.TryGetValue(@"card_tk", out jt))
                    {
                        card_tk = jt.Value <string>();
                    }
                    if (inputData.TryGetValue(@"expire_date", out jt))
                    {
                        expire_date = jt.Value <string>();
                    }
                    if (inputData.TryGetValue(@"special_instructions", out jt))
                    {
                        special_instructions = Regex.Replace(jt.Value <string>(), @"\p{Cs}", "");
                    }
                    if (inputData.TryGetValue(@"last4_digits", out jt))
                    {
                        last4_digits = jt.Value <string>();
                    }
                    if (inputData.TryGetValue(@"id_number", out jt))
                    {
                        id_number = jt.Value <string>();
                    }
                    if (inputData.TryGetValue(@"bid_id", out jt))
                    {
                        bid_id = jt.Value <Int64>();
                    }
                    if (inputData.TryGetValue(@"offer_id", out jt))
                    {
                        offer_id = jt.Value <Int64>();
                    }
                    //if (inputData.TryGetValue(@"donation_id", out jt)) donation_id = jt.Value<Int64>();
                    if (inputData.TryGetValue(@"campaign_id", out jt) && jt != null)
                    {
                        campaign_id = jt.Value <Int64?>() ?? 0;
                    }


                    using (StreamWriter streamWriter = new StreamWriter(Response.OutputStream))
                    {
                        using (JsonTextWriter jsonWriter = new JsonTextWriter(streamWriter))
                        {
                            if (Order.FetchByBidId(bid_id) != null)
                            {
                                RespondError(Response, HttpStatusCode.BadRequest, @"already-order");
                            }
                            Order order = new Order();
                            //if (response_code == OrderController.RESPONSE_CODE_OK)
                            //{
                            AppUserCard paymentToken = AppUserCard.FetchByAppUserId(AppUserId);
                            if (paymentToken == null)
                            {
                                paymentToken = new AppUserCard();
                            }
                            paymentToken.AppUserId  = AppUserId;
                            paymentToken.CardToken  = card_tk;
                            paymentToken.ExpiryDate = expire_date;
                            paymentToken.Last4Digit = last4_digits;
                            if (!String.IsNullOrEmpty(id_number))
                            {
                                paymentToken.IdNumber = id_number;
                            }
                            paymentToken.Save();
                            // }


                            Dictionary <string, string> result = BidController.GetDiscount(offer_id, AppUserId);

                            decimal TotalPrice = result["TotalPrice"] != null?Convert.ToDecimal(result["TotalPrice"].ToString()) : 0;

                            decimal PriceAfterDiscount = result["PriceAfterDiscount"] != null?Convert.ToDecimal(result["PriceAfterDiscount"].ToString()) : 0;

                            decimal PrecentDiscount = result["PrecentDiscount"] != null?Convert.ToDecimal(result["PrecentDiscount"].ToString()) : 0;

                            Int64?CampaignId = result["CampaignId"] != null ? (Int64?)Convert.ToInt64(result["CampaignId"].ToString()) : null;
                            if (CampaignId != 0)
                            {
                                order.CampaignId = CampaignId;
                            }
                            order.TotalPrice         = TotalPrice;
                            order.PriceAfterDiscount = PriceAfterDiscount;
                            order.PrecentDiscount    = PrecentDiscount;
                            order.BidId = bid_id;
                            order.SpecialInstructions = special_instructions;
                            //order.TransactionResponseCode = response_code;
                            //order.TransactionErrorMessage = response_error_message;
                            order.Transaction = card_tk;
                            //switch (response_code)
                            //{
                            //    case OrderController.RESPONSE_CODE_OK: order.TransactionStatus = OrderStatus.Payed;
                            //        break;
                            //    case OrderController.RESPONSE_CODE_ERROR: order.TransactionStatus = OrderStatus.NotPayed;
                            //        break;
                            //    default: order.TransactionStatus = OrderStatus.NotPayed;
                            //        break;
                            //}
                            // if (donation_id != 0) order.DonationId = donation_id;
                            order.Last4Digits = last4_digits;
                            order.ExpiryDate  = expire_date;
                            order.AppUserId   = AppUserId;
                            order.Save();

                            jsonWriter.WriteStartObject();
                            jsonWriter.WritePropertyName(@"order_id");
                            jsonWriter.WriteValue(order.OrderId);
                            jsonWriter.WriteEndObject();


                            if (campaign_id != null && campaign_id != 0)
                            {
                                AppUserCampaign appUserCampaign = new AppUserCampaign();
                                appUserCampaign.AppUserId  = AppUserId;
                                appUserCampaign.CampaignId = campaign_id;
                                appUserCampaign.Save();
                            }

                            Offer offer = Offer.FetchByID(offer_id);
                            // SupplierNotification.SendNotificationCloseBidToSupplier(order.OrderId, offer.SupplierId);

                            AppSupplier supplier = AppSupplier.FetchByID(offer.SupplierId);
                            if (supplier != null && supplier.StatusJoinBid == true)
                            {
                                supplier.MaxWinningsNum = (supplier.MaxWinningsNum > 0 ? supplier.MaxWinningsNum - 1 : 0);
                                if (supplier.MaxWinningsNum == 0)
                                {
                                    SupplierNotification.SendNotificationMaxAutoModeMessage(supplier.SupplierId);
                                    supplier.StatusJoinBid = false;
                                }
                                supplier.Save();
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    RespondError(Response, HttpStatusCode.InternalServerError, @"db-error");
                }
            }
        }
コード例 #7
0
        public override void Post(HttpRequest Request, HttpResponse Response, params string[] PathParams)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetMaxAge(TimeSpan.Zero);
            JObject inputData = null;

            try
            {
                using (StreamReader reader = new StreamReader(Request.InputStream))
                {
                    using (JsonTextReader jsonReader = new JsonTextReader(reader))
                    {
                        inputData = JObject.Load(jsonReader);
                    }
                }
            }
            catch
            {
                RespondBadRequest(Response);
            }

            Int64 AppUserId;

            if (IsAuthorizedRequest(Request, Response, true, out AppUserId))
            {
                Response.ContentType = @"application/json";

                try
                {
                    JToken jt;
                    string card_tk = null, expire_date = null, last4_digits = null, id_number = null, special_instructions = null;
                    Int64  order_id            = 0;
                    bool   is_payment_succesed = true;
                    if (inputData.TryGetValue(@"is_payment_succesed", out jt))
                    {
                        is_payment_succesed = jt.Value <bool>();
                    }
                    if (is_payment_succesed)
                    {
                        if (inputData.TryGetValue(@"card_tk", out jt))
                        {
                            card_tk = jt.Value <string>();
                        }
                        if (inputData.TryGetValue(@"expire_date", out jt))
                        {
                            expire_date = jt.Value <string>();
                        }
                        if (inputData.TryGetValue(@"last4_digits", out jt))
                        {
                            last4_digits = jt.Value <string>();
                        }
                        if (inputData.TryGetValue(@"id_number", out jt))
                        {
                            id_number = jt.Value <string>();
                        }
                    }
                    if (inputData.TryGetValue(@"order_id", out jt))
                    {
                        order_id = jt.Value <Int64>();
                    }



                    using (StreamWriter streamWriter = new StreamWriter(Response.OutputStream))
                    {
                        using (JsonTextWriter jsonWriter = new JsonTextWriter(streamWriter))
                        {
                            if (Order.FetchByOrderId(order_id) == null)
                            {
                                RespondError(Response, HttpStatusCode.BadRequest, @"order not exist");
                            }
                            Order order = Order.FetchByOrderId(order_id);
                            if (is_payment_succesed)
                            {
                                AppUserCard paymentToken = AppUserCard.FetchByAppUserId(AppUserId);
                                if (paymentToken == null)
                                {
                                    paymentToken = new AppUserCard();
                                }
                                paymentToken.AppUserId  = AppUserId;
                                paymentToken.CardToken  = card_tk;
                                paymentToken.ExpiryDate = expire_date;
                                paymentToken.Last4Digit = last4_digits;
                                if (!String.IsNullOrEmpty(id_number))
                                {
                                    paymentToken.IdNumber = id_number;
                                }
                                paymentToken.Save();

                                order.Transaction           = card_tk;
                                order.Last4Digits           = last4_digits;
                                order.ExpiryDate            = expire_date;
                                order.AppUserId             = AppUserId;
                                order.UserPaySupplierStatus = UserPaymentStatus.Payed;
                            }
                            else
                            {
                                order.UserPaySupplierStatus = UserPaymentStatus.NotPayed;
                            }
                            order.Save();

                            jsonWriter.WriteStartObject();
                            jsonWriter.WritePropertyName(@"order_id");
                            jsonWriter.WriteValue(order.OrderId);
                            jsonWriter.WriteEndObject();

                            long supplierId = 0; // need to update from offer
                            SupplierNotification.SendNotificationCloseBidToSupplier(order.OrderId, supplierId);

                            AppSupplier supplier = AppSupplier.FetchByID(supplierId);
                            if (supplier != null && supplier.StatusJoinBid == true)
                            {
                                supplier.MaxWinningsNum = (supplier.MaxWinningsNum > 0 ? supplier.MaxWinningsNum - 1 : 0);
                                if (supplier.MaxWinningsNum == 0)
                                {
                                    SupplierNotification.SendNotificationMaxAutoModeMessage(supplier.SupplierId);
                                    supplier.StatusJoinBid = false;
                                }
                                supplier.Save();
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    RespondError(Response, HttpStatusCode.InternalServerError, @"db-error");
                }
            }
        }
コード例 #8
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            string SupplierEmail = null;
            bool   EmailChanged  = false;

            AppSupplier supplier = null;

            if (IsNewMode)
            {
                Membership.UserCreateResults results = Membership.CreateSupplier(txtEmail.Text, txtPassword.Text.Trim(), Convert.ToInt64(ddlCity.SelectedValue), out supplier);
                switch (results)
                {
                default:
                case Membership.UserCreateResults.UnknownError:
                    Master.MessageCenter.DisplayErrorMessage(SuppliersStrings.GetText(@"MessageCreateFailedUnknown"));
                    return;

                case Membership.UserCreateResults.AlreadyExists:
                    Master.MessageCenter.DisplayErrorMessage(SuppliersStrings.GetText(@"MessageCreateFailedAlreadyExists"));
                    return;

                case Membership.UserCreateResults.InvalidEmailAddress:
                    Master.MessageCenter.DisplayErrorMessage(SuppliersStrings.GetText(@"MessageCreateFailedEmailAddressInvalid"));
                    return;

                case Membership.UserCreateResults.Success:
                    break;
                }
                SupplierId    = supplier.SupplierId;
                SupplierEmail = supplier.Email;
                //supplier.OrderDisplay = OrderDisplay.GetLastOrder() + 1;
            }
            else
            {
                supplier      = core.DAL.AppSupplier.FetchByID(SupplierId);
                SupplierEmail = supplier.Email;
            }
            supplier.BusinessName = txtBusinessName.Text;

            if (ddlIsProduct.SelectedValue == "prod")
            {
                supplier.IsProduct = true;
                supplier.IsService = false;
            }
            else
            {
                supplier.IsProduct = false;
                supplier.IsService = true;
            }
            //supplier.IsProduct = chkIsProduct.Checked;
            //supplier.IsService = chkIsService.Checked;
            supplier.IsPremium    = chkIsPremium.Checked;
            supplier.IsLocked     = chkIsLocked.Checked;
            supplier.ContactName  = txtContactName.Text;
            supplier.ContactPhone = txtContactPhone.Text;
            supplier.Phone        = txtPhone.Text;
            supplier.CityId       = Convert.ToInt64(ddlCity.SelectedValue);
            supplier.Street       = txtStreet.Text;
            supplier.HouseNum     = txtHouseNum.Text;
            try
            {
                string city = ddlCity.SelectedItem.Text;
                //var address = (city != "" ? city + " " : "") +" "+ (txtStreet.Text != "" ? txtStreet.Text+" " : "") + (txtHouseNum.Text != "" ? txtHouseNum.Text : "");
                var locationService = new GoogleLocationService();
                var point           = (city.Trim() != "" ? locationService.GetLatLongFromAddress(city) : new MapPoint());
                supplier.AddressLocation = new Geometry.Point(point.Latitude, point.Longitude);
            }
            catch (Exception) {
                supplier.AddressLocation = new Geometry.Point(0, 0);
            }
            supplier.HouseNum = txtHouseNum.Text;

            supplier.Precent     = txtPrecent.Text != "" ?Convert.ToInt32(txtPrecent.Text):0;
            supplier.SumPerMonth = txtSumPerMonth.Text != "" ? Convert.ToInt32(txtSumPerMonth.Text) : 0;
            //supplier.StatusJoinBid = chkIsStatusJoinBid.Checked;
            //supplier.AllowChangeStatusJoinBid = chkAllowChangeStatusJoinBid.Checked;
            //supplier.MaxWinningsNum =txtMaxWinningsNum.Text != "" ? Convert.ToInt32(txtMaxWinningsNum.Text) : 0;
            supplier.MastercardCode = txtMastercardCode.Text;
            supplier.Save();

            if (IsNewMode)
            {
                SupplierId = supplier.SupplierId;
                //if (chkIsStatusJoinBid.Checked == false)//handel
                //{
                //    (new Query(SupplierProduct.TableSchema).Where(SupplierProduct.Columns.SupplierId, SupplierId).Delete()).Execute();
                //    ProductCollection pcol = ProductCollection.FetchByQuery(new Query(Product.TableSchema).Where(Product.Columns.IsDeleted, false));
                //    foreach (Product item in pcol)
                //    {
                //        SupplierProduct sp = new SupplierProduct();
                //        sp.SupplierId = SupplierId;
                //        sp.ProductId = item.ProductId;
                //        sp.Gift = "";
                //        sp.Save();
                //    }
                //}
            }
            //if (chkIsService.Checked)
            if (ddlIsProduct.SelectedValue != "prod")
            {
                foreach (ListItem item in ddlServices.Items)
                {
                    if (item.Selected)
                    {
                        SupplierService supplierService = SupplierService.FetchByID(Convert.ToInt64(item.Value), SupplierId);
                        if (supplierService == null)
                        {
                            supplierService            = new SupplierService();
                            supplierService.SupplierId = SupplierId;
                            supplierService.ServiceId  = Convert.ToInt64(item.Value);
                            supplierService.Save();
                        }
                    }
                    else
                    {
                        SupplierService.Delete(Convert.ToInt64(item.Value), SupplierId);
                    }
                }
            }
            else
            {
                SupplierController.DeleteAllSupplierServices(SupplierId);
            }

            if (supplier.Email != txtEmail.Text.Trim().NormalizeEmail())
            {
                if (AppSupplier.FetchByEmail(txtEmail.Text.Trim().NormalizeEmail()) != null)
                {
                    Master.MessageCenter.DisplayWarningMessage(AppUsersStrings.GetText(@"MessageEmailChangeFailed"));
                }
                else
                {
                    supplier.Email          = txtEmail.Text.Trim().NormalizeEmail();
                    supplier.UniqueIdString = supplier.Email;//email.NormalizeEmail();
                    SupplierEmail           = supplier.Email;
                    EmailChanged            = true;
                }
            }

            SupplierEmail = supplier.Email;
            supplier.Save();

            if (txtPassword.Text.Length > 0)
            {
                if (txtConfirmPassword.Text != txtPassword.Text)
                {
                    Master.MessageCenter.DisplayErrorMessage(SuppliersStrings.GetText(@"SupplierNewPasswordConfirmInvalid"));
                    return;
                }
                Membership.UserPasswordChangeResults results;
                results = Membership.ChangeSupplierPassword(supplier.Email, txtPassword.Text);
                switch (results)
                {
                default:
                    Master.MessageCenter.DisplayWarningMessage(SuppliersStrings.GetText(@"MessagePasswordChangeFailedUnknown"));
                    break;

                case Membership.UserPasswordChangeResults.PasswordDoNotMatch:
                    Master.MessageCenter.DisplayWarningMessage(SuppliersStrings.GetText(@"MessagePasswordChangeBadOldPassword"));
                    break;

                case Membership.UserPasswordChangeResults.Success:
                    break;
                }
            }

            if (IsNewMode)
            {
                string successMessage = SuppliersStrings.GetText(@"MessageSupplierCreated");
                string url            = @"EditSupplier.aspx?Email=" + SupplierEmail + "&SupplierId=" + supplier.SupplierId;
                url += @"&message-success=" + Server.UrlEncode(successMessage);
                Response.Redirect(url, true);
            }
            else
            {
                string successMessage = SuppliersStrings.GetText(@"MessageSupplierSaved");
                if (EmailChanged)
                {
                    string url = @"EditSupplier.aspx?message-success=" + Server.UrlEncode(successMessage) + "&SupplierId=" + supplier.SupplierId;
                    if (SupplierId != supplier.SupplierId)
                    {
                        url += @"&Email=" + SupplierEmail;
                    }
                    Response.Redirect(url, true);
                }
                else
                {
                    Master.MessageCenter.DisplaySuccessMessage(successMessage);
                    LoadView();
                }
            }
        }