Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }

                    if (Session["ShoppingCartBook"] != null)
                    {
                        shoppingCartbookDT = (DataTable)Session["ShoppingCartBook"];
                    }

                    if (Session["ShoppingCart"] != null)
                    {
                        shoppingCartDT = (DataTable)Session["ShoppingCart"];
                    }

                    ShoppingCartBookGV.DataSource = shoppingCartbookDT;
                    ShoppingCartBookGV.DataBind();

                    Calculate();
                }
                catch (Exception)
                {
                }
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (Session["InteractionBroker"] != null)
                    {
                        _ib = (CustomerAgent)Session["InteractionBroker"];
                    }
                    else
                    {
                        _ib = new CustomerAgent();
                        Session["InteractionBroker"] = _ib;
                    }

                    if (Session["SearchBroker"] != null)
                    {
                        _sb = (CustomerAgent)Session["SearchBroker"];
                    }
                    else
                    {
                        _sb = new CustomerAgent();
                        Session["SearchBroker"] = _sb;
                    }

                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }
                    else
                    {
                        _pb = new CustomerAgent();
                        Session["PurchaseBroker"] = _pb;
                    }

                    if (Session["shoppingCart"] != null)
                    {
                        shoppingCartDT = (DataTable)Session["shoppingCart"];
                    }
                    else
                    {
                        Session["shoppingCart"] = shoppingCartDT;
                    }

                    if (Session["ShoppingCartBook"] != null)
                    {
                        shoppingCartbookDT = (DataTable)Session["ShoppingCartBook"];
                    }
                    else
                    {
                        shoppingCartbookDT          = new DataTable();
                        Session["ShoppingCartBook"] = shoppingCartbookDT;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Пример #3
0
 // set kakao information
 public void SetKakaoInformation()
 {
     kakaoImage.enabled = true;
     pieImage.enabled   = false;
     chatText.text      = "오늘의 정보 \n\n" + "손님들이" + stageManager.ProFavor + "%의 확률로 " + ItemData.ReturnTypeString(stageManager.FavoriteGroup) + "을(를) 선호합니다.\n"
                          + "손님들이" + stageManager.ProFavor + "%의 확률로 " + CustomerAgent.ReturnBuyScaleString(stageManager.BuyScale) + "삽니다.";
 }
Пример #4
0
    private void Start()
    {
        timer = GameObject.FindGameObjectWithTag("GameController").GetComponent <GlobalTimer>();
        ca    = this.GetComponent <CustomerAgent>();

        customerWaitTime = Random.Range(minWaitTime, maxWaitTime);
        waitTimeLeft     = customerWaitTime;
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session["DeliveryAgent"] != null)
                    {
                        _db = (CustomerAgent)Session["DeliveryAgent"];
                    }
                    else
                    {
                        _db = new CustomerAgent();
                        Session["DeliveryAgent"] = _db;
                    }

                    if (Session["ProfileMonitor"] != null)
                    {
                        _pmb = (CustomerAgent)Session["ProfileMonitor"];
                    }
                    else
                    {
                        _pmb = new CustomerAgent();
                        Session["ProfileMonitor"] = _pmb;
                    }

                    Numberlbl.Text          = _pmb._CCNumber.ToString();
                    namelbl.Text            = _pmb._Name;
                    CardTypelbl.Text        = _pmb._CardType;
                    ExpirationMonthlbl.Text = _pmb._ExpirationMonth.ToString();
                    ExpirationYearlbl.Text  = _pmb._ExpirationYear.ToString();

                    DateTime d = new DateTime(_pmb._ExpirationYear, _pmb._ExpirationMonth, 1);

                    if (d.Month >= DateTime.Now.Month && d.Year >= DateTime.Now.Year)
                    {
                        confirmbtn.Visible = true;
                    }
                    else
                    {
                        updatebtn.Visible          = true;
                        ExpirationMonthtxt.Visible = true;
                        ExpirationYeartxt.Visible  = true;
                        ExpirationMonthlbl.Visible = false;
                        ExpirationYearlbl.Visible  = false;
                        ExpirationMonthtxt.Text    = _pmb._ExpirationMonth.ToString();
                        ExpirationYeartxt.Text     = _pmb._ExpirationYear.ToString();
                    }
                }
                catch (Exception)
                {
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }
                    else
                    {
                        _pb = new CustomerAgent();
                        Session["PurchaseBroker"] = _pb;
                    }

                    if (Session["ProfileMonitor"] != null)
                    {
                        _pmb = (CustomerAgent)Session["ProfileMonitor"];
                    }
                    else
                    {
                        _pmb = new CustomerAgent();
                        Session["ProfileMonitor"] = _pmb;
                    }

                    GetCountries();
                    GetCities(int.Parse(CountryDDL.Text.ToString()));

                    _pmb._CustomerId = _pb._CustomerId;
                    _pmb._Flag       = "C";
                    _pmb._Top        = 1;
                    _pmb._PageSize   = 1000;
                    _pmb.Execute("SelectCustomer_AddressByCustomerIdCapability");
                    if (_pmb.Success != null)
                    {
                        DataTable addressDT = (DataTable)_pmb.Success;
                        if (addressDT.Rows.Count > 0)
                        {
                            AddressGV.DataSource = addressDT;
                            AddressGV.DataBind();
                        }
                        else
                        {
                            addresstable.Visible = true;
                            Addbtn.Visible       = false;
                        }
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }
                    else
                    {
                        _pb = new CustomerAgent();
                        Session["PurchaseBroker"] = _pb;
                    }

                    if (Session["CatalogueBroker"] != null)
                    {
                        _cb = (CustomerAgent)Session["CatalogueBroker"];
                    }
                    else
                    {
                        _cb = new CustomerAgent();
                        Session["CatalogueBroker"] = _cb;
                    }

                    DisplayCatgeory();

                    currentIndex = 1;

                    DisplayBook(currentIndex);

                    _pb._CustomerId = 1;

                    DisplayShoppingCart();

                    Save();
                }
            }
            catch (Exception)
            {
            }
        }
Пример #8
0
    // create customer setting information
    public void CreateGameInformation()
    {
        // allocate probability
        switch (manager.GamePlayer.StoreData.StoreStep)
        {
        case 1:
            probabilityOfBuyScale = probabilityOfFavoriteGroup = 100;
            break;

        case 2:
            probabilityOfBuyScale = probabilityOfFavoriteGroup = 90;
            break;

        case 3:
            probabilityOfBuyScale = probabilityOfFavoriteGroup = 80;
            break;
        }

        // allocate data
        buyScale      = CustomerAgent.ReturnBuyScale(UnityEngine.Random.Range(1, 6));
        favoriteGroup = ItemData.ReturnType(UnityEngine.Random.Range(1, 8));

        // set sell furiture object set
        sellFurnitureSet = new List <FurnitureObject>( );
        for (int i = 0; i < manager.GamePlayer.AllocateFurnitureObjectSet.Count; i++)
        {
            if (manager.GamePlayer.AllocateFurnitureObjectSet[i].InstanceData.Furniture.Function == FurnitureData.FunctionType.SellObject)
            {
                sellFurnitureSet.Add(manager.GamePlayer.AllocateFurnitureObjectSet[i]);
            }
        }

        // set stage time
        stageTime = manager.GamePlayer.StoreData.StageTime;

        // set customer cycle
        customerCycle = 3f;
    }
Пример #9
0
    void Awake()
    {
        TickTack.EveryOtherClick = false;

        Debug.Log("Awake in ClickFloors started");
        go1 = GameObject.Find("Customer1");
        go2 = GameObject.Find("Customer2");

        if (go1 != null && go2 != null)
        {
            Debug.Log("MyCylinder was found using Find.");
            sn1 = go1.GetComponent <CustomerAgent>();
            sn2 = go2.GetComponent <CustomerAgent>();
            Debug.Log("Tried to get sn SmartNavmeshAgent!");
        }
        else
        {
            Debug.Log("find couldn't find anything!!!!");
        }

        //other = (PropertiesAndCoroutines) go.GetComponent(typeof(PropertiesAndCoroutines));
        Debug.Log("onAwake ended");
    }
Пример #10
0
    // set favorite group & buy scale
    public void SetBuyInformation()
    {
        // buy scale
        if (UnityEngine.Random.Range(1, 101) >= stageManager.ProScale)
        {
            buyScale = stageManager.BuyScale;
        }
        else
        {
            int i = ( int )stageManager.BuyScale;
            while (i != ( int )stageManager.BuyScale)
            {
                i = UnityEngine.Random.Range(1, 6);
            }
            buyScale = CustomerAgent.ReturnBuyScale(i);
        }

        // favorite group
        if (UnityEngine.Random.Range(1, 101) >= stageManager.ProFavor)
        {
            favoriteItemType = stageManager.FavoriteGroup;
        }
        else
        {
            int i = ( int )stageManager.FavoriteGroup;
            while (i != ( int )stageManager.FavoriteGroup)
            {
                i = UnityEngine.Random.Range(1, 8);
            }
            favoriteItemType = ItemData.ReturnType(i);
        }

        calculatedBuyScale = BuyScaleSetFloatType(buyScale);

        storeDoor  = GameObject.Find("StoreDoor").transform;
        moveTarget = storeEnterPoint;
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (Session["ProfileMonitor"] != null)
                    {
                        _pmb = (CustomerAgent)Session["ProfileMonitor"];
                    }
                    else
                    {
                        _pmb = new CustomerAgent();
                        Session["ProfileMonitor"] = _pmb;
                    }
                }

                _pmb.Execute("SelectCustomer_CreditCardByCustomerIdCapability");
                if (_pmb.Success != null)
                {
                    creditCardDT = (DataTable)_pmb.Success;
                    if (creditCardDT.Rows.Count > 0)
                    {
                        CreditCardGV.DataSource = creditCardDT;
                        CreditCardGV.DataBind();
                    }
                    else
                    {
                        CreditCardtable.Visible = true;
                        Addbtn.Visible          = false;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Пример #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session["DeliveryAgent"] != null)
                    {
                        _db = (CustomerAgent)Session["DeliveryAgent"];
                    }
                    else
                    {
                        _db = new CustomerAgent();
                        Session["DeliveryAgent"] = _db;
                    }

                    _db._Top      = 1;
                    _db._PageSize = 100;
                    _db._Flag     = "C";
                    _db.Execute("SelectAllDeliveryMethodCapability");
                    if (_db.Success != null)
                    {
                        deliveryDT = (DataTable)_db.Success;
                        for (int i = 0; i < deliveryDT.Rows.Count; i++)
                        {
                            deliveryDT.Rows[i]["Method"] = deliveryDT.Rows[i]["Method"].ToString().TrimEnd();
                        }

                        DeliveryGV.DataSource = deliveryDT;
                        DeliveryGV.DataBind();
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }
                    else
                    {
                        _pb = new CustomerAgent();
                        Session["PurchaseBroker"] = _pb;
                    }

                    if (Session["DeliveryAgent"] != null)
                    {
                        _db = (CustomerAgent)Session["DeliveryAgent"];
                    }
                    else
                    {
                        _db = new CustomerAgent();
                        Session["DeliveryAgent"] = _db;
                    }

                    if (Session["ProfileMonitor"] != null)
                    {
                        _pmb = (CustomerAgent)Session["ProfileMonitor"];
                    }
                    else
                    {
                        _pmb = new CustomerAgent();
                        Session["ProfileMonitor"] = _pmb;
                    }

                    if (Session["ShoppingCartBook"] != null)
                    {
                        shoppingCartbookDT = (DataTable)Session["ShoppingCartBook"];
                    }

                    if (Session["ShoppingCart"] != null)
                    {
                        shoppingCartDT = (DataTable)Session["ShoppingCart"];
                    }

                    numbertxt.Text   = _pmb._Number.ToString();
                    streettxt.Text   = _pmb._Street;
                    Districttxt.Text = _pmb._District.ToString();
                    countrytxt.Text  = _pmb._Country;
                    citytxt.Text     = _pmb._City;
                    zipCodetxt.Text  = _pmb._ZipCode.ToString();

                    Methodtxt.Text          = _db._Method;
                    costtxt.Text            = _db._Cost.ToString();
                    peritemCosttxt.Text     = _db._PerItemCost.ToString();
                    MinDeliveryTimetxt.Text = _db._MinDeliveryTime.ToString();
                    MaxDeliveryTimetxt.Text = _db._MaxDeliveryTime.ToString();

                    ShoppingCartBookGV.DataSource = shoppingCartbookDT;
                    ShoppingCartBookGV.DataBind();
                    Calculate();
                }

                catch (Exception)
                {
                }
            }
        }
Пример #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }
                    else
                    {
                        _pb = new CustomerAgent();
                        Session["PurchaseBroker"] = _pb;
                    }

                    if (Session["InteractionBroker"] != null)
                    {
                        _ib = (CustomerAgent)Session["InteractionBroker"];
                    }
                    else
                    {
                        _ib = new CustomerAgent();
                        Session["InteractionBroker"] = _ib;
                    }

                    if (Session["CatalogueBroker"] != null)
                    {
                        _cb = (CustomerAgent)Session["CatalogueBroker"];
                    }
                    else
                    {
                        _cb = new CustomerAgent();
                        Session["CatalogueBroker"] = _cb;
                    }

                    if (Session["ShoppingCartBook"] != null)
                    {
                        shoppingCartbookDT = (DataTable)Session["ShoppingCartBook"];
                    }

                    if (Session["ShoppingCart"] != null)
                    {
                        shoppingCartDT = (DataTable)Session["ShoppingCart"];
                    }

                    idtxt.Text            = _cb._Id.ToString();
                    ISBNtxt.Text          = _cb._ISBN;
                    titletxt.Text         = _cb._Title;
                    editionNumbertxt.Text = _cb._EditionNumber.ToString();
                    copyRighttxt.Text     = _cb._CopyRight.ToString();
                    Amounttxt.Text        = _cb._Amount.ToString();
                    pricetxt.Text         = _cb._Price.ToString();
                    categorylbl.Text      = _cb._Name;

                    _cb._NumOfVisits++;
                    _cb.Execute("UpdateBookCapability");
                    if (_cb.Success != null)
                    {
                    }

                    _ib._CustomerId = _pb._ShoppingCartId;
                    _ib.Execute("SelectCustomerWishListByCustomerIdCapability");
                    if (_ib.Success != null)
                    {
                        CustomerBookWishListDT = (DataTable)_ib.Success;
                    }

                    _ib._BookId = int.Parse(idtxt.Text);
                    _ib.Execute("SelectCustomerRateByBookIdCapability");
                    if (_ib.Success != null)
                    {
                        CustomerBookRateListDT = (DataTable)_ib.Success;
                        double sum = 0;
                        for (int i = 0; i < CustomerBookRateListDT.Rows.Count; i++)
                        {
                            sum += double.Parse(CustomerBookRateListDT.Rows[i]["Rate"].ToString());
                        }
                        double v = sum / CustomerBookRateListDT.Rows.Count;
                        ratelbl.Text = v.ToString();
                    }

                    _ib._BookId = int.Parse(idtxt.Text);
                    _ib.Execute("SelectCustomerReviewByBookIdCapability");
                    if (_ib.Success != null)
                    {
                        CustomerBookReviewListDT = (DataTable)_ib.Success;
                        CommentGV.DataSource     = CustomerBookReviewListDT;
                        CommentGV.DataBind();
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Пример #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (Session["InteractionBroker"] != null)
                    {
                        _ib = (CustomerAgent)Session["InteractionBroker"];
                    }
                    else
                    {
                        _ib = new CustomerAgent();
                        Session["InteractionBroker"] = _ib;
                    }

                    if (Session["PurchaseBroker"] != null)
                    {
                        _pb = (CustomerAgent)Session["PurchaseBroker"];
                    }
                    else
                    {
                        _pb = new CustomerAgent();
                        Session["PurchaseBroker"] = _pb;
                    }

                    if (Session["CatalogueBroker"] != null)
                    {
                        _cb = (CustomerAgent)Session["CatalogueBroker"];
                    }
                    else
                    {
                        _cb = new CustomerAgent();
                        Session["CatalogueBroker"] = _cb;
                    }

                    if (Session["StockBroker"] != null)
                    {
                        _sb = (CustomerAgent)Session["StockBroker"];
                    }
                    else
                    {
                        _sb = new CustomerAgent();
                        Session["StockBroker"] = _sb;
                    }

                    if (Session["DeliveryAgent"] != null)
                    {
                        _db = (CustomerAgent)Session["DeliveryAgent"];
                    }
                    else
                    {
                        _db = new CustomerAgent();
                        Session["DeliveryAgent"] = _db;
                    }

                    if (Session["ProfileMonitor"] != null)
                    {
                        _pmb = (CustomerAgent)Session["ProfileMonitor"];
                    }
                    else
                    {
                        _pmb = new CustomerAgent();
                        Session["ProfileMonitor"] = _pmb;
                    }

                    if (Session["ShoppingCartBook"] != null)
                    {
                        shoppingCartbookDT = (DataTable)Session["ShoppingCartBook"];
                    }

                    if (Session["shoppingCart"] != null)
                    {
                        shoppingCartDT = (DataTable)Session["shoppingCart"];
                    }

                    Calculate();
                    SaveOrder();
                }
                catch (Exception)
                {
                }
            }
        }