Ejemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     TimeManagerCall = GameObject.Find("TimeManager").GetComponent <TimeManager>();
     SalesValueCall  = GameObject.Find("SalesManager").GetComponent <SalesValue>();
     GoodsRecipeCall = GameObject.Find("BaseSystem").GetComponent <GoodsRecipe>();
     Initializinig();
 }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        BaseSystem         = GameObject.Find("BaseSystem");
        ObjectActCall      = gameObject.GetComponent <InstallableObjectAct>();
        CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>();
        GoodsValueCall     = CompanyManagerCall.GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        SalesValueCall     = GameObject.Find("SalesManager").GetComponent <SalesValue>();

        MoverDetector     = transform.GetChild(2).GetChild(0).GetChild(0).gameObject;
        WarehouseDetector = transform.GetChild(2).GetChild(1).GetChild(0).gameObject;

        isInitialized = false;
    }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        CompanyManagerCall = GameObject.Find("CompanyManager").GetComponent <CompanyManager>();
        GoodsValueCall     = CompanyManagerCall.GetPlayerCompanyValue().GetGoodsValue().GetComponent <GoodsValue>();
        SalesValueCall     = GameObject.Find("SalesManager").GetComponent <SalesValue>();
        ObjectActCall      = gameObject.GetComponent <InstallableObjectAct>();
        Goods            = GameObject.Find("Goods");
        DummyBeltActCall = DummyBelt.GetComponent <BeltAct>();

        MoverDetector     = transform.GetChild(2).GetChild(0).GetChild(0).gameObject;
        WarehouseDetector = transform.GetChild(2).GetChild(1).GetChild(0).gameObject;

        TargetGoodsName = "None";
    }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        CompanyValueCall = transform.parent.gameObject.GetComponent <CompanyValue>();
        GoodsValueCall   = CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>();
        TimaManagerCall  = GameObject.Find("TimeManager").GetComponent <TimeManager>();
        SalesValueCall   = GameObject.Find("SalesManager").GetComponent <SalesValue>();

        List <string> ItemList  = new List <string>();
        List <int>    PriceList = new List <int>();

        CompanyValueCall.GetGoodsValue().GetComponent <GoodsValue>().TotalCapacity = 9999999;

        switch (Name)
        {
        case "General Industry Co.":
            ItemList.Add("Paper roll");
            PriceList.Add(1);
            Initializing(ItemList, PriceList);
            break;

        case "Federal Agency of Industry":
            ItemList.Add("Plastic mass"); ItemList.Add("Silicon mass");
            PriceList.Add(2); PriceList.Add(3);
            Initializing(ItemList, PriceList);
            break;
            // case "Sasio" :
            //     ItemList.Add("Packaged Calculator"); ItemList.Add("Calculator"); ItemList.Add("Calculating Circuit");
            //     List<string> NameList = new List<string>();
            //     NameList.Add("Packaged Cal-100"); NameList.Add("Cal-100"); NameList.Add("CM100");
            //     PriceList.Add(18); PriceList.Add(13); PriceList.Add(10);
            //     GoodsRecipe GoodsRecipeCall = GameObject.Find("BaseSystem").GetComponent<GoodsRecipe>();
            //     TechValue TechValueCall = CompanyValueCall.GetTechValue().GetComponent<TechValue>();
            //     for(int i = 0; i < ItemList.Count; i++)
            //     {
            //         for(int j = 0; j < GoodsRecipeCall.RecipeArray.Count; j++)
            //         {
            //             if(GoodsRecipeCall.RecipeArray[j].OutputName == ItemList[i])
            //             {
            //                 GoodsRecipeCall.MakeCustomRecipe(ItemList[i], NameList[i], GoodsRecipeCall.RecipeArray[j].InputName, GoodsRecipeCall.RecipeArray[j].Attractiveness, Name);
            //                 SalesValueCall.AddSales(NameList[i], Name, PriceList[i]);
            //             }
            //         }
            //     }
            //     break;
        }

        StockManage();
    }
Ejemplo n.º 5
0
        public String SalesGratuityToday(string paymentType, string orderstatus) //SalesToday
        {
            string SQL_str = "select Convert(nvarchar(10), " +
                             "DatePart(year, dCreatedDate)) + '-' + Convert(nvarchar(10), " +
                             "DatePart(month, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(day, dCreatedDate))" +
                             " OrderDate,COALESCE(sum(dOrderServiceFee),0) SalesGratuity,sum(dOrderTax) Tax" +
                             " from pos_orderheader" +
                             " where vOrderStatus='" + orderstatus + "' and Convert(nvarchar(10), DatePart(year, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(month, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(day, dCreatedDate)) ='" + System.DateTime.Today.ToString("yyyy-M-d") + "'" +
                             "group by Convert(nvarchar(10), DatePart(year, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(month, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(day, dCreatedDate))";


            //Connect to database and retrieve
            SqlCEDataAccess POSdbAccess = new SqlCEDataAccess();

            DataSet   ResultSet;
            DataTable ResultTable;

            ResultSet   = POSdbAccess.dsGetData(SQL_str, "POSsalesTipsToday");
            ResultTable = ResultSet.Tables[0];
            String  RtnString;
            Decimal SalesValue, TaxValue;

            //    SalesValue = (from DataRow dr in ResultTable.Rows where dr["Sales"] == EnvironmentVariableTarget select (int)dr["id"].FirstOrDefault);
            if (ResultTable.Rows.Count > 0 && ResultTable.Rows != null)
            {
                if (ResultTable.Rows[0]["SalesGratuity"] != null)
                {
                    SalesValue = (Decimal)ResultTable.Rows[0]["SalesGratuity"];
                }
                else
                {
                    SalesValue = 0;
                }
                TaxValue = (Decimal)ResultTable.Rows[0]["Tax"];
                //  SalesValue = SalesValue; // + TaxValue; Tax is included in dOrderAmount......5/8/16
                RtnString = "$ " + SalesValue.ToString("##,##.00");
            }
            else
            {
                RtnString = "$ 0.00";
            }
            return(RtnString);
        }
Ejemplo n.º 6
0
        public String YTDSales() //MonthlyAvg
        {
            string SQL_str = "select " +
                             "Convert(nvarchar(10), " +
                             "DatePart(year, dCreatedDate))" +
                             " OrderDate,sum(dOrderAmount) Sales,sum(dOrderTax) Tax" +
                             " from pos_orderheader" +
                             " where Convert(nvarchar(10), DatePart(year, dCreatedDate)) ='" + System.DateTime.Today.Year + "'" +
                             "group by Convert(nvarchar(10), DatePart(year, dCreatedDate)) ";
            Int16 MonthCount = (Int16)System.DateTime.Today.Month;

            //Connect to database and retrieve
            SqlCEDataAccess POSdbAccess = new SqlCEDataAccess();

            DataSet   ResultSet;
            DataTable ResultTable;

            ResultSet   = POSdbAccess.dsGetData(SQL_str, "POSytdSales");
            ResultTable = ResultSet.Tables[0];
            String  RtnString;
            Decimal SalesValue, TaxValue;

            //    SalesValue = (from DataRow dr in ResultTable.Rows where dr["Sales"] == EnvironmentVariableTarget select (int)dr["id"].FirstOrDefault);
            if (ResultTable.Rows.Count > 0 && ResultTable.Rows != null)
            {
                SalesValue = (Decimal)ResultTable.Rows[0]["Sales"];
                TaxValue   = (Decimal)ResultTable.Rows[0]["Tax"];
                //    SalesValue = SalesValue + TaxValue; //tax included in dOrderAmount. 5/8/16 saa

                RtnString = "$ " + SalesValue.ToString("##,##.00");
            }
            else
            {
                RtnString = "$ 0.00";
            }
            return(RtnString);
        }
Ejemplo n.º 7
0
        public String TransactionList() //Transaction List.
        {
            string SQL_str = "select Convert(nvarchar(10), " +
                             "DatePart(year, dCreatedDate)) + '-' + Convert(nvarchar(10), " +
                             "DatePart(month, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(day, dCreatedDate))" +
                             " OrderDate,sum(dOrderAmount) Sales,sum(dOrderTax) Tax" +
                             " from pos_orderheader" +
                             " where Convert(nvarchar(10), DatePart(year, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(month, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(day, dCreatedDate)) ='" + System.DateTime.Today.ToString("yyyy-M-dd") + "'" +
                             "and vOrderStatus='Pending' group by Convert(nvarchar(10), DatePart(year, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(month, dCreatedDate)) + '-' + Convert(nvarchar(10), DatePart(day, dCreatedDate))";


            //Connect to database and retrieve
            SqlCEDataAccess POSdbAccess = new SqlCEDataAccess();

            DataSet   ResultSet;
            DataTable ResultTable;

            ResultSet   = POSdbAccess.dsGetData(SQL_str, "POSsalesPendingToday");
            ResultTable = ResultSet.Tables[0];
            String  RtnString;
            Decimal SalesValue, TaxValue;

            //    SalesValue = (from DataRow dr in ResultTable.Rows where dr["Sales"] == EnvironmentVariableTarget select (int)dr["id"].FirstOrDefault);
            if (ResultTable.Rows.Count > 0 && ResultTable.Rows != null)
            {
                SalesValue = (Decimal)ResultTable.Rows[0]["Sales"];
                TaxValue   = (Decimal)ResultTable.Rows[0]["Tax"];
                //    SalesValue = SalesValue + TaxValue;//tax included in dOrderAmount. 5/8/16 saa
                RtnString = "$ " + SalesValue.ToString("##,##.00");
            }
            else
            {
                RtnString = "$ 0.00";
            }
            return(RtnString);
        }