public String insert(FoodsType p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            int chk = 0;

            chkNull(p);
            sql = "Insert Into " + fooT.table + " set " +
                  " " + fooT.foods_type_code + " = '" + p.foods_type_code + "'" +
                  "," + fooT.foods_type_name + " = '" + p.foods_type_name.Replace("'", "''") + "'" +
                  "," + fooT.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + fooT.date_create + " = now()" +
                  "," + fooT.active + " = '1'" +
                  "," + fooT.user_create + " = '" + userId + "' " +
                  "," + fooT.host_id + " = '" + p.host_id + "' " +
                  "," + fooT.branch_id + " = '" + p.branch_id + "' " +
                  "," + fooT.device_id + " = '" + p.device_id + "' " +
                  //"," + fooC.status_aircondition + " = '" + p.status_aircondition + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
        public String update(FoodsType p, String userId)
        {
            String re  = "";
            String sql = "";
            int    chk = 0;

            chkNull(p);
            sql = "Update " + fooT.table + " Set " +
                  " " + fooT.foods_type_code + " = '" + p.foods_type_code + "'" +
                  "," + fooT.foods_type_name + " = '" + p.foods_type_name.Replace("'", "''") + "'" +
                  "," + fooT.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + fooT.date_modi + " = now()" +
                  "," + fooT.user_modi + " = '" + userId + "' " +
                  "," + fooT.host_id + " = '" + p.host_id + "' " +
                  "," + fooT.branch_id + " = '" + p.branch_id + "' " +
                  "," + fooT.device_id + " = '" + p.device_id + "' " +
                  //"," + fooC.status_aircondition + " = '" + p.status_aircondition + "' " +

                  "Where " + fooT.pkField + "='" + p.foods_type_id + "'"
            ;

            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
        private void initConfig()
        {
            fooT   = new FoodsType();
            fEdit  = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize, FontStyle.Regular);
            fEditB = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize, FontStyle.Bold);

            //C1ThemeController.ApplicationTheme = mposC.iniC.themeApplication;
            theme1.Theme = mposC.iniC.themeApplication;
            theme1.SetTheme(sB, "BeigeOne");
            foreach (Control c in panel3.Controls)
            {
                theme1.SetTheme(c, mposC.iniC.themeApplication);
            }

            bg = txtAreaCode.BackColor;
            fc = txtAreaCode.ForeColor;
            ff = txtAreaCode.Font;
            txtPasswordVoid.KeyUp += TxtPasswordVoid_KeyUp;

            initGrfFoodsType();
            setGrfFoodsType();
            setControlEnable(false);
            setFocusColor();
            sB1.Text = "";
            btnVoid.Hide();
            txtPasswordVoid.Hide();
            stt = new C1SuperTooltip();
            sep = new C1SuperErrorProvider();
            //stt.BackgroundGradient = C1.Win.C1SuperTooltip.BackgroundGradient.Gold;
        }
 private void setControl(String posiId)
 {
     fooT                  = mposC.mposDB.footDB.selectByPk1(posiId);
     txtID.Value           = fooT.foods_type_id;
     txtAreaCode.Value     = fooT.foods_type_code;
     txtFooTNameT.Value    = fooT.foods_type_name;
     txtRemark.Value       = fooT.remark;
     txtPasswordVoid.Value = "";
     chkVoid.Checked       = false;
     //if (fooT.status_aircondition.Equals("1"))
     //{
     //    chkStatusAirCondition.Checked = true;
     //}
     //else
     //{
     //    chkStatusAirCondition.Checked = false;
     //}
     //if (area.status_embryologist.Equals("1"))
     //{
     //    chkEmbryologist.Checked = true;
     //}
     //else
     //{
     //    chkEmbryologist.Checked = false;
     //}
 }
        private FoodsType setArea1(DataTable dt)
        {
            FoodsType dept1 = new FoodsType();

            if (dt.Rows.Count > 0)
            {
                dept1.foods_type_id   = dt.Rows[0][fooT.foods_type_id].ToString();
                dept1.foods_type_name = dt.Rows[0][fooT.foods_type_name].ToString();
            }

            return(dept1);
        }
        public FoodsType selectByPk1(String copId)
        {
            FoodsType cop1 = new FoodsType();
            DataTable dt   = new DataTable();
            String    sql  = "select sex.* " +
                             "From " + fooT.table + " sex " +
                             //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " +
                             "Where sex." + fooT.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            cop1 = setFoodsType(dt);
            return(cop1);
        }
        public String insertFoodsType(FoodsType p, String userId)
        {
            String re = "";

            if (p.foods_type_id.Equals(""))
            {
                re = insert(p, "");
            }
            else
            {
                re = update(p, "");
            }

            return(re);
        }
        public void getlArea()
        {
            //lDept = new List<Position>();
            lfooT.Clear();
            DataTable dt = new DataTable();

            dt = selectAll();
            foreach (DataRow row in dt.Rows)
            {
                FoodsType itm1 = new FoodsType();
                itm1.foods_type_id   = row[fooT.foods_type_id].ToString();
                itm1.foods_type_name = row[fooT.foods_type_name].ToString();

                lfooT.Add(itm1);
            }
        }
        private FoodsType setFoodsType(DataTable dt)
        {
            FoodsType dept1 = new FoodsType();

            if (dt.Rows.Count > 0)
            {
                dept1.foods_type_id   = dt.Rows[0][fooT.foods_type_id].ToString();
                dept1.foods_type_code = dt.Rows[0][fooT.foods_type_code].ToString();
                dept1.foods_type_name = dt.Rows[0][fooT.foods_type_name].ToString();
                //dept1.posi_name_e = dt.Rows[0][area.posi_name_e] != null ? dt.Rows[0][area.posi_name_e].ToString() : "";
                //dept1.status_doctor = dt.Rows[0][area.status_doctor] != null ? dt.Rows[0][area.status_doctor].ToString() : "";
                dept1.remark      = dt.Rows[0][fooT.remark] != null ? dt.Rows[0][fooT.remark].ToString() : "";
                dept1.date_create = dt.Rows[0][fooT.date_create] != null ? dt.Rows[0][fooT.date_create].ToString() : "";
                dept1.date_modi   = dt.Rows[0][fooT.date_modi] != null ? dt.Rows[0][fooT.date_modi].ToString() : "";
                dept1.date_cancel = dt.Rows[0][fooT.date_cancel] != null ? dt.Rows[0][fooT.date_cancel].ToString() : "";
                dept1.user_create = dt.Rows[0][fooT.user_create] != null ? dt.Rows[0][fooT.user_create].ToString() : "";
                dept1.user_modi   = dt.Rows[0][fooT.user_modi] != null ? dt.Rows[0][fooT.user_modi].ToString() : "";
                dept1.user_cancel = dt.Rows[0][fooT.user_cancel] != null ? dt.Rows[0][fooT.user_cancel].ToString() : "";
                dept1.active      = dt.Rows[0][fooT.active] != null ? dt.Rows[0][fooT.active].ToString() : "";
                dept1.sort1       = dt.Rows[0][fooT.sort1] != null ? dt.Rows[0][fooT.sort1].ToString() : "";
                //dept1.status_aircondition = dt.Rows[0][fooC.status_aircondition] != null ? dt.Rows[0][fooC.status_aircondition].ToString() : "";
            }
            else
            {
                dept1.foods_type_id   = "";
                dept1.foods_type_code = "";
                dept1.foods_type_name = "";
                //posi.dept_parent_id = "dept_parent_id";
                dept1.remark      = "";
                dept1.date_create = "";
                dept1.date_modi   = "";
                dept1.date_cancel = "";
                dept1.user_create = "";
                dept1.user_modi   = "";
                dept1.user_cancel = "";
                dept1.active      = "";
                dept1.sort1       = "";
                //dept1.status_aircondition = "";
                //dept1.status_embryologist = "";
            }

            return(dept1);
        }
        private void chkNull(FoodsType p)
        {
            long chk = 0;

            p.date_modi   = p.date_modi == null ? "" : p.date_modi;
            p.date_cancel = p.date_cancel == null ? "" : p.date_cancel;
            p.user_create = p.user_create == null ? "" : p.user_create;
            p.user_modi   = p.user_modi == null ? "" : p.user_modi;
            p.user_cancel = p.user_cancel == null ? "" : p.user_cancel;

            p.foods_type_name = p.foods_type_name == null ? "" : p.foods_type_name;
            p.foods_type_code = p.foods_type_code == null ? "" : p.foods_type_code;

            //p.status_aircondition = p.status_aircondition == null ? "0" : p.status_aircondition;

            p.host_id   = long.TryParse(p.host_id, out chk) ? chk.ToString() : "0";
            p.branch_id = long.TryParse(p.branch_id, out chk) ? chk.ToString() : "0";
            p.device_id = long.TryParse(p.device_id, out chk) ? chk.ToString() : "0";
        }
        private void initConfig()
        {
            lfooT = new List <FoodsType>();
            fooT  = new FoodsType();
            fooT.foods_type_id   = "foods_type_id";
            fooT.foods_type_code = "foods_type_code";
            fooT.foods_type_name = "foods_type_name";
            fooT.active          = "active";
            fooT.remark          = "remark";
            fooT.sort1           = "sort1";
            fooT.date_cancel     = "date_cancel";
            fooT.date_create     = "date_create";
            fooT.date_modi       = "date_modi";
            fooT.user_cancel     = "user_cancel";
            fooT.user_create     = "user_create";
            fooT.user_modi       = "user_modi";
            fooT.host_id         = "host_id";
            fooT.branch_id       = "branch_id";
            fooT.device_id       = "device_id";
            //fooC.status_aircondition = "status_aircondition";

            fooT.pkField = "foods_type_id";
            fooT.table   = "b_foods_type";
        }
Exemple #12
0
    void Update()
    {
        if (_receiveEpAck != true)
        {
            return;
        }

        if (Time.time <= m_lastTime + 1.0f)
        {
            return;
        }

        m_lastTime = Time.time;

        ulong serverTime = sdGlobalDatabase.Instance.ServerBeginTime +
                           sdGlobalDatabase.Instance.TimeFromServerBeginTime;
        DateTime time = sdConfDataMgr.Instance().ConvertServerTimeToClientTime(serverTime);

        m_dirt = false;

        if (time.Hour >= 14)
        {
            _chickenEated = true;
        }

        if (time.Hour >= 20)
        {
            _cakeEated = true;
        }

        if (time.Hour >= 12 && time.Hour <= 13)
        {
            if (_chickenEated)
            {
                _foodsType = FoodsType.FOODS_TYPE_EMPTY;
            }
            else
            {
                _foodsType = FoodsType.FOODS_TYPE_CHICKEN;
                m_dirt     = true;
            }
        }
        else if (time.Hour >= 18 && time.Hour <= 19)
        {
            if (_cakeEated)
            {
                _foodsType = FoodsType.FOODS_TYPE_EMPTY;
            }
            else
            {
                _foodsType = FoodsType.FOODS_TYPE_CAKE;
                m_dirt     = true;
            }
        }
        else
        {
            _foodsType = FoodsType.FOODS_TYPE_EMPTY;
        }

        if (m_goWndRoot == null)
        {
            return;
        }

        if (_foodsType == FoodsType.FOODS_TYPE_EMPTY)
        {
            //m_goWndRoot.transform.FindChild("EverydayFoods/Time").GetComponent<UILabel>().color =
            //	new Color(200.0f/255.0f, 200.0f/255.0f, 150.0f/255.0f);

            if (!_chickenEated)
            {
                int hour   = 11 - time.Hour;
                int minute = 59 - time.Minute;
                int second = 59 - time.Second;

                m_goWndRoot.transform.FindChild("EverydayFoods/Time").GetComponent <UILabel>().text =
                    hour.ToString("D2") + ":" + minute.ToString("D2") + ":" + second.ToString("D2") + " 后可享用";
            }
            else if (!_cakeEated)
            {
                int hour   = 17 - time.Hour;
                int minute = 59 - time.Minute;
                int second = 59 - time.Second;

                m_goWndRoot.transform.FindChild("EverydayFoods/Time").GetComponent <UILabel>().text =
                    hour.ToString("D2") + ":" + minute.ToString("D2") + ":" + second.ToString("D2") + " 后可享用";
            }
            else
            {
                m_goWndRoot.transform.FindChild("EverydayFoods/Time").GetComponent <UILabel>().text =
                    "请明天在来!";
            }

            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/Empty").gameObject.SetActive(true);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullCake").gameObject.SetActive(false);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullChicken").gameObject.SetActive(false);
            _eatBtn.gameObject.SetActive(false);

            m_goWndRoot.transform.FindChild("EverydayFoods/Title/Text").GetComponent <UILabel>().text = "大餐正在准备中";
        }
        else if (_foodsType == FoodsType.FOODS_TYPE_CHICKEN)
        {
            m_goWndRoot.transform.FindChild("EverydayFoods/Time").GetComponent <UILabel>().text = "";
            _eatBtn.gameObject.SetActive(true);

            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/Empty").gameObject.SetActive(false);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullCake").gameObject.SetActive(false);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullChicken").gameObject.SetActive(true);

            m_goWndRoot.transform.FindChild("EverydayFoods/Title/Text").GetComponent <UILabel>().text = "美味鸡腿已上桌";
        }
        else if (_foodsType == FoodsType.FOODS_TYPE_CAKE)
        {
            m_goWndRoot.transform.FindChild("EverydayFoods/Time").GetComponent <UILabel>().text = "";
            _eatBtn.gameObject.SetActive(true);

            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/Empty").gameObject.SetActive(false);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullCake").gameObject.SetActive(true);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullChicken").gameObject.SetActive(false);

            m_goWndRoot.transform.FindChild("EverydayFoods/Title/Text").GetComponent <UILabel>().text = "美味蛋糕已上桌";
        }
    }