Esempio n. 1
0
        private void initConfig()
        {
            pageLoad  = true;
            tque      = new TQueue();
            queCaller = new BQueueCaller();
            theme1    = new C1ThemeController();
            fEdit     = new Font(bqc.iniC.grdViewFontName, bqc.grdViewFontSize, FontStyle.Regular);

            foreach (String aaa in C1ThemeController.GetThemes())
            {
                rbTheme.Items.Add(aaa);
            }
            //rbTheme.SelectedItem.Description = "Office2016Colorful";

            //bqc.bquDB.queDateDB.setCboQueDate(cboStf, bqc.iniC.queuefixid, System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd"));
            bqc.bquDB.queDateDB.setCboQueDate1(cboQueDate, bqc.iniC.queuefixid, System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd"));
            //new LogWriter("d", "FrmQueueNext initConfig ");
            setControl();
            //cboStf.SelectedValueChanged += CboStf_SelectedValueChanged;
            cboQueDate.SelectedIndexChanged += CboQueDate_SelectedIndexChanged;
            btnQueNext.Click             += BtnQueNext_Click;
            chkQueSend.Click             += ChkQueSend_Click;
            btnQueSend.Click             += BtnQueSend_Click;
            chkQueVoid.Click             += ChkQueVoid_Click;
            btnQueVoid.Click             += BtnQueVoid_Click;
            btnCaller.Click              += BtnCaller_Click;
            rbTheme.Text                  = "VS2013Red";
            rbTheme.SelectedIndexChanged += RbTheme_SelectedIndexChanged;

            setTheme1(rbTheme.Text);
            pageLoad = false;
        }
Esempio n. 2
0
        private void initConfig()
        {
            tque              = new TQueue();
            tque.t_queue_id   = "t_queue_id";
            tque.queue_id     = "queue_id";
            tque.queue_date   = "queue_date";
            tque.row_1        = "row_1";
            tque.queue_active = "queue_active";
            //que.row_1 = "row_1";
            tque.active          = "active";
            tque.date_create     = "date_create";
            tque.date_modi       = "date_modi";
            tque.date_cancel     = "date_cancel";
            tque.user_create     = "user_create";
            tque.user_modi       = "user_modi";
            tque.user_cancel     = "user_cancel";
            tque.status_queue    = "status_queue";
            tque.queue_name      = "queue_name";
            tque.date_begin      = "date_begin";
            tque.date_finish     = "date_finish";
            tque.queue           = "queue";
            tque.queue_current   = "queue_current";
            tque.b_queue_date_id = "b_queue_date_id";
            tque.queue_call_id   = "queue_call_id";

            tque.table   = "t_queue";
            tque.pkField = "t_queue_id";
        }
Esempio n. 3
0
 public void initQueue(SolutionEventType type)
 {
     if(queues.ContainsKey(type)) {
         return;
     }
     queues[type] = new TQueue();
 }
Esempio n. 4
0
 private TQueue setQueue1(TQueue stf1)
 {
     stf1.t_queue_id      = "";
     stf1.queue_id        = "";
     stf1.queue_date      = "";
     stf1.queue_name      = "";
     stf1.date_create     = "";
     stf1.active          = "";
     stf1.date_modi       = "";
     stf1.date_cancel     = "";
     stf1.user_create     = "";
     stf1.user_modi       = "";
     stf1.user_cancel     = "";
     stf1.status_queue    = "";
     stf1.date_begin      = "";
     stf1.date_finish     = "";
     stf1.queue_active    = "";
     stf1.row_1           = "";
     stf1.queue_current   = "";
     stf1.queue           = "";
     stf1.b_queue_date_id = "";
     stf1.queue_call_id   = "";
     stf1.prefix          = "";
     stf1.code            = "";
     return(stf1);
 }
Esempio n. 5
0
        private void chkNull(TQueue 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.prefix_id = int.TryParse(p.prefix_id, out chk) ? chk.ToString() : "0";
            //p.posi_id = int.TryParse(p.posi_id, out chk) ? chk.ToString() : "0";
            //p.posi_id = int.TryParse(p.posi_id, out chk) ? chk.ToString() : "0";
            p.queue_date   = p.queue_date == null ? "" : p.queue_date;
            p.queue_name   = p.queue_name == null ? "" : p.queue_name;
            p.queue_date   = p.queue_date == null ? "" : p.queue_date;
            p.row_1        = p.row_1 == null ? "" : p.row_1;
            p.active       = p.active == null ? "" : p.active;
            p.status_queue = p.status_queue == null ? "" : p.status_queue;
            p.queue_active = p.queue_active == null ? "" : p.queue_active;
            p.date_begin   = p.date_begin == null ? "" : p.date_begin;
            p.date_finish  = p.date_finish == null ? "" : p.date_finish;
            //p.queue = p.queue == null ? "" : p.queue;

            p.queue_id        = long.TryParse(p.queue_id, out chk) ? chk.ToString() : "0";
            p.b_queue_date_id = long.TryParse(p.b_queue_date_id, out chk) ? chk.ToString() : "0";
            p.queue           = long.TryParse(p.queue, out chk) ? chk.ToString() : "0";
            p.queue_current   = long.TryParse(p.queue_current, out chk) ? chk.ToString() : "0";
            p.queue_call_id   = long.TryParse(p.queue_call_id, out chk) ? chk.ToString() : "0";
        }
Esempio n. 6
0
 private static void EnqueueChunks(List <Chunk> chunks, TQueue <Chunk> queue)
 {
     foreach (Chunk chunk in chunks)
     {
         queue.Enqueue(chunk);
     }
 }
Esempio n. 7
0
        private void BtnQueNext_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            String stfid = "", queid = "", prefix = "", code = "";

            //stfid = bqc.getIdCombo(cboStf, cboStf.Text);
            if (queCaller == null)
            {
                MessageBox.Show("ไม่พบ caller", "");
                return;
            }
            if (queCaller.queue_call_id == null)
            {
                MessageBox.Show("ไม่พบ caller", "");
                return;
            }
            if (queCaller.queue_call_id.Length <= 0)
            {
                MessageBox.Show("ไม่พบ caller", "");
                return;
            }

            btnQueNext.Enabled = false;
            //if (tque.t_queue_id == null)
            //{
            //    MessageBox.Show("ไม่พบเลขที่คิว", "");
            //    return;
            //}
            //if (tque.t_queue_id.Length <= 0)
            //{
            //    MessageBox.Show("ไม่พบเลขที่คิว", "");
            //    return;
            //}
            String date = System.DateTime.Now.Year + "-" + System.DateTime.Now.ToString("MM-dd");

            //que = bqc.bquDB.queDB.selectQueByStfQueDate(stfid, date);

            //เรียกคิว
            tque.t_queue_id = tque.t_queue_id == null ? "" : tque.t_queue_id;
            tque            = bqc.bquDB.tqueDB.LockQueue(bqued.b_queue_date_id, tque.t_queue_id, queCaller.queue_call_id);
            //tque = new TQueue();
            if (tque.t_queue_id.Equals("-1"))
            {
                lbStatus.Text = tque.queue_name;
            }
            else if (tque.t_queue_id.Length > 3)
            {
                lbStatus.Text = "OK";
            }
            code          = bqc.prefixQue(tque);
            bqued         = bqc.bquDB.queDateDB.selectByPk1(bqued.b_queue_date_id);
            lbQue.Text    = bqc.prefixQue1(bqued.queuecode, bqued.queueprefix, bqued.queue);
            lbQueCur.Text = tque.queue_current;
            lbTQueId.Text = tque.t_queue_id;
            //lbStatus.Text = "";
            chkQueSend.Checked = false;
            chkQueVoid.Checked = false;
            cboQueSend.Text    = "";
            playSound();
        }
Esempio n. 8
0
        public static void IEnumerable_Testing <TQueue>()
            where TQueue : IQueue <int>, new()
        {
            {             // enqueue only
                int[]        values = { 0, 1, 2, 3, 4, 5, };
                IQueue <int> queue  = new TQueue();
                values.Stepper(i => queue.Enqueue(i));
#pragma warning disable CA1829 // Use Length/Count property instead of Count() when available
                Assert.IsTrue(System.Linq.Enumerable.Count(queue) == values.Length);
#pragma warning restore CA1829 // Use Length/Count property instead of Count() when available
                ISet <int> set = SetHashLinked.New <int>();
                values.Stepper(i => set.Add(i));
                foreach (int i in queue)
                {
                    Assert.IsTrue(set.Contains(i));
                    set.Remove(i);
                }
                Assert.IsTrue(set.Count == 0);
            }
            {             // enqueue + dequeue
                int[]        values         = { 0, 1, 2, 3, 4, 5, };
                int[]        expectedValues = { 2, 3, 4, 5, };
                IQueue <int> queue          = new TQueue();
                values.Stepper(i => queue.Enqueue(i));
                queue.Dequeue();
                queue.Dequeue();
#pragma warning disable CA1829 // Use Length/Count property instead of Count() when available
                Assert.IsTrue(System.Linq.Enumerable.Count(queue) == expectedValues.Length);
#pragma warning restore CA1829 // Use Length/Count property instead of Count() when available
                ISet <int> set = SetHashLinked.New <int>();
                expectedValues.Stepper(i => set.Add(i));
                foreach (int i in queue)
                {
                    Assert.IsTrue(set.Contains(i));
                    set.Remove(i);
                }
                Assert.IsTrue(set.Count == 0);
            }
            {             // enqueue + dequeue
                int[]        values = { 0, 1, 2, 3, 4, 5, };
                IQueue <int> queue  = new TQueue();
                values.Stepper(i => queue.Enqueue(i));
                values.Stepper(i =>
                {
                    queue.Dequeue();
                    queue.Enqueue(i);
                });
#pragma warning disable CA1829 // Use Length/Count property instead of Count() when available
                Assert.IsTrue(System.Linq.Enumerable.Count(queue) == values.Length);
#pragma warning restore CA1829 // Use Length/Count property instead of Count() when available
                ISet <int> set = SetHashLinked.New <int>();
                values.Stepper(i => set.Add(i));
                foreach (int i in queue)
                {
                    Assert.IsTrue(set.Contains(i));
                    set.Remove(i);
                }
                Assert.IsTrue(set.Count == 0);
            }
        }
        public BQueue selectBQueueByPk(String tqueid)
        {
            TQueue stf1 = new TQueue();
            BQueue que  = new BQueue();

            stf1 = bquDB.tqueDB.selectByPk(tqueid);
            que  = bquDB.queDB.selectByPk(stf1.queue_id);
            return(que);
        }
Esempio n. 10
0
        private void GrfQueToday_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            if (grfQueToday.Row <= 0)
            {
                return;
            }
            if (grfQueToday.Col <= 0)
            {
                return;
            }
            try
            {
                bool chk = false;
                if (bqc.iniC.statusQueueNameHide.Equals("0") && (grfQueToday.Col == colQueName))
                {
                    chk = true;
                }
                else if (bqc.iniC.statusQueueNameHide.Equals("1") && (grfQueToday.Col == colTodayQue))
                {
                    chk = true;
                }
                else
                {
                    chk = false;
                }
                if (chk)
                {
                    DataTable dt   = new DataTable();
                    String    date = "";
                    date          = DateTime.Now.Year + DateTime.Now.ToString("-MM-dd");
                    lbStatus.Text = grfQueToday.Col.ToString();
                    String id = "", name = "", num = "", todayid = "";
                    tqueid  = "";
                    todayid = grfQueToday[grfQueToday.Row, colTodayId] != null ? grfQueToday[grfQueToday.Row, colTodayId].ToString() : "";
                    id      = grfQueToday[grfQueToday.Row, colTodayqueid] != null ? grfQueToday[grfQueToday.Row, colTodayqueid].ToString() : "";
                    name    = grfQueToday[grfQueToday.Row, colTodayQueName] != null ? grfQueToday[grfQueToday.Row, colTodayQueName].ToString() : "";
                    num     = grfQueToday[grfQueToday.Row, colTodayQuCurr] != null ? grfQueToday[grfQueToday.Row, colTodayQuCurr].ToString() : "";
                    String re = bqc.bquDB.queDateDB.QueuetNext(id, date, todayid);
                    tqueid = re;
                    tque   = new TQueue();
                    //new LogWriter("d", "FrmQueueDate printDocument1_PrintQueue tqueid " + tqueid);
                    tque = bqc.bquDB.tqueDB.selectByPk1(tqueid);

                    setGrfQueToday1();
                    if (bqc.iniC.statusPrintQue.Equals("1"))
                    {
                        printQueue();
                    }
                }
            }
            catch (Exception ex)
            {
                new LogWriter("d", "FrmQueueDate GrfQueToday_Click  " + ex.Message);
            }
        }
Esempio n. 11
0
 public static void Stepper_Testing <TQueue>()
     where TQueue : IQueue <int>, new()
 {
     {             // enqueue only
         int[]        values = { 0, 1, 2, 3, 4, 5, };
         IQueue <int> queue  = new TQueue();
         values.Stepper(i => queue.Enqueue(i));
         Assert.IsTrue(queue.Count == values.Length);
         ISet <int> set = SetHashLinked.New <int>();
         values.Stepper(i => set.Add(i));
         queue.Stepper(i =>
         {
             Assert.IsTrue(set.Contains(i));
             set.Remove(i);
         });
         Assert.IsTrue(set.Count == 0);
     }
     {             // enqueue + dequeue
         int[]        values         = { 0, 1, 2, 3, 4, 5, };
         int[]        expectedValues = { 2, 3, 4, 5, };
         IQueue <int> queue          = new TQueue();
         values.Stepper(i => queue.Enqueue(i));
         queue.Dequeue();
         queue.Dequeue();
         Assert.IsTrue(queue.Count == expectedValues.Length);
         ISet <int> set = SetHashLinked.New <int>();
         expectedValues.Stepper(i => set.Add(i));
         queue.Stepper(i =>
         {
             Assert.IsTrue(set.Contains(i));
             set.Remove(i);
         });
         Assert.IsTrue(set.Count == 0);
     }
     {             // enqueue + dequeue
         int[]        values = { 0, 1, 2, 3, 4, 5, };
         IQueue <int> queue  = new TQueue();
         values.Stepper(i => queue.Enqueue(i));
         values.Stepper(i =>
         {
             queue.Dequeue();
             queue.Enqueue(i);
         });
         Assert.IsTrue(queue.Count == values.Length);
         ISet <int> set = SetHashLinked.New <int>();
         values.Stepper(i => set.Add(i));
         queue.Stepper(i =>
         {
             Assert.IsTrue(set.Contains(i));
             set.Remove(i);
         });
         Assert.IsTrue(set.Count == 0);
     }
 }
Esempio n. 12
0
    private static List <Chunk> DequeueChunks(TQueue <Chunk> queue)
    {
        List <Chunk> chunks = new List <Chunk>();

        while (queue.Count > 0)
        {
            chunks.Add(queue.Dequeue());
        }

        return(chunks);
    }
Esempio n. 13
0
 public SMNatives(NativeData nativeData)
 {
     Globals     = new TGlobals(nativeData);
     Application = new TApplication(nativeData);
     Control     = new TControl(nativeData);
     ElWind      = new TElWind(nativeData);
     SMMain      = new TSMMain(nativeData);
     Database    = new TDatabase(nativeData);
     Registry    = new TRegistry(Database, nativeData);
     FileSpace   = new TFileSpace(Database, nativeData);
     Queue       = new TQueue(nativeData);
 }
Esempio n. 14
0
        /// <summary>
        /// When the program first starts go out and find the pool, and
        /// set up the queue. Make sure the pools Capacity matches up with
        /// the list or else throw an error.
        /// </summary>
        private void Awake()
        {
            labelPool    = GetComponent <IObjectPool <ILabel> >();
            scrollRect   = GetComponent <ScrollRect>();
            items        = new TQueue <string>(Capacity);
            activeLabels = new List <ILabel>();

            //Do the capacitys match?
            if (labelPool.Capacity != Capacity)
            {
                throw new Exception(string.Format("{0} pool capacity does not match capacity", gameObject.name));
            }
        }
Esempio n. 15
0
        public String insertQueue(TQueue p, String userId)
        {
            String re = "";

            if (p.queue_id.Equals(""))
            {
                re = insert(p, "");
            }
            else
            {
                re = update(p, "");
            }
            return(re);
        }
Esempio n. 16
0
        private void BtnQueVoid_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            String re  = bqc.bquDB.tqueDB.voidQueue(tque.t_queue_id, "");
            int    chk = 0;

            if (int.TryParse(re, out chk))
            {
                lbStatus.Text = "ยกเลิกคิวเรียบร้อย";
                tque          = new TQueue();
                lbTQueId.Text = "";
                lbQue.Text    = "";
                lbQueCur.Text = "";
            }
        }
Esempio n. 17
0
    static void Main()
    {
        var q       = new TQueue();
        var threads = Enumerable.
                      Range(1, 5).
                      Select(x => new Thread(() => {
            q.Wait(x);
        })).ToList();

        threads.ForEach(x => x.Start());
        Console.WriteLine();
        threads.ForEach(x => {
            q.Signal();
        });
    }
Esempio n. 18
0
    private static List <Chunk> GetChunksNotOnTheBorderInQueue(TQueue <Chunk> queue)
    {
        List <Chunk> chunks = new List <Chunk>();

        while (queue.Count > 0)
        {
            Chunk chunk = queue.Dequeue();
            if (!chunk.IsOnTheBorder)
            {
                chunks.Add(chunk);
            }
        }

        return(chunks);
    }
Esempio n. 19
0
        public TQueue selectQueNextByQueDateId(String quedateid)
        {
            String    re   = "0";
            int       chk  = 0;
            TQueue    stf1 = new TQueue();
            DataTable dt   = new DataTable();
            String    sql  = "select tque.*   " +
                             "From " + tque.table + " tque " +
                             "Where  tque." + tque.b_queue_date_id + " = '" + quedateid + "' " +
                             "Order By " + tque.pkField + " asc limit 1,1";

            dt   = conn.selectData(conn.conn, sql);
            stf1 = setQueue(dt);

            return(stf1);
        }
Esempio n. 20
0
        public TQueue LockQueue(String queue_date_id, String t_que_id_old, String queue_call_id)
        {
            String re = "", sql = "";
            TQueue stf1 = new TQueue();

            try
            {
                MySqlCommand cmd = new MySqlCommand("lock_queue", conn.conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.Parameters.Add(new MySqlParameter("?t_que_id_old", MySqlDbType.VarChar));
                cmd.Parameters.Add(new MySqlParameter("?queue_call_id1", MySqlDbType.VarChar));
                //cmd.Parameters.Add(new MySqlParameter("?queue_date1", MySqlDbType.VarChar));
                cmd.Parameters.Add(new MySqlParameter("?b_queue_date_id1", MySqlDbType.VarChar));
                //cmd.Parameters.Add(new MySqlParameter("?ret", MySqlDbType.VarChar));
                cmd.Parameters["?t_que_id_old"].Direction   = ParameterDirection.Input;
                cmd.Parameters["?t_que_id_old"].Value       = t_que_id_old;
                cmd.Parameters["?queue_call_id1"].Direction = ParameterDirection.Input;
                cmd.Parameters["?queue_call_id1"].Value     = queue_call_id;
                //cmd.Parameters["?queue_date1"].Direction = ParameterDirection.Input;
                //cmd.Parameters["?queue_date1"].Value = quedate;
                cmd.Parameters["?b_queue_date_id1"].Direction = ParameterDirection.Input;
                cmd.Parameters["?b_queue_date_id1"].Value     = queue_date_id;
                //cmd.Parameters["?ret"].Direction = ParameterDirection.Output;
                conn.conn.Open();
                //cmd.ExecuteNonQuery();
                //re = ((String)cmd.Parameters["?ret"].Value).ToString();
                MySqlDataAdapter adap = new MySqlDataAdapter(cmd);
                DataTable        dt   = new DataTable();
                adap.Fill(dt);
                stf1 = setQueue(dt);
                //stf1 = selectByPk(re);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                //new LogWriter("TQueueDB LockQueue " + sql);
                //new LogWriter("e", "TQueueDB LockQueue err " + sql);
                new LogWriter("e", "TQueueDB LockQueue " + sql);
                stf1.t_queue_id = "-1";
                stf1.queue_name = sql;
            }
            finally
            {
                conn.conn.Close();
            }
            return(stf1);
        }
Esempio n. 21
0
        public TQueue selectByPk1(String tqueid)
        {
            String    re   = "0";
            int       chk  = 0;
            TQueue    stf1 = new TQueue();
            DataTable dt   = new DataTable();
            String    sql  = "select tque.* ,que.queue_code, que.queue_prefix  " +
                             "From " + tque.table + " tque " +
                             "Inner Join b_queue que on tque.queue_id = que.queue_id " +
                             "Where  tque." + tque.pkField + " = '" + tqueid + "'  " +
                             "Order By " + tque.pkField + " asc limit 0,1";

            dt   = conn.selectData(conn.conn, sql);
            stf1 = setQueue(dt);

            return(stf1);
        }
        public String prefixQue(TQueue tque)
        {
            String code = "", prefix = "";
            BQueue que = new BQueue();

            que    = bquDB.queDB.selectByTQueId(tque.t_queue_id);
            prefix = que.queue_prefix.Length > 0 ? que.queue_prefix : "";
            if (que.queue_code.Length > 0)
            {
                for (int i = 0; i < que.queue_code.Length; i++)
                {
                    code += "0";
                }
                code = code + tque.queue;
                code = code.Substring(tque.queue.Length);
            }
            return(prefix + code);
        }
Esempio n. 23
0
        public TQueue setQueue(DataTable dt)
        {
            TQueue stf1 = new TQueue();

            if (dt.Rows.Count > 0)
            {
                try
                {
                    stf1.t_queue_id      = dt.Rows[0][tque.t_queue_id].ToString();
                    stf1.queue_id        = dt.Rows[0][tque.queue_id].ToString();
                    stf1.queue_date      = dt.Rows[0][tque.queue_date].ToString();
                    stf1.row_1           = dt.Rows[0][tque.row_1].ToString();
                    stf1.queue_active    = dt.Rows[0][tque.queue_active].ToString();
                    stf1.date_create     = dt.Rows[0][tque.date_create].ToString();
                    stf1.date_modi       = dt.Rows[0][tque.date_modi].ToString();
                    stf1.date_cancel     = dt.Rows[0][tque.date_cancel].ToString();
                    stf1.user_create     = dt.Rows[0][tque.user_create].ToString();
                    stf1.user_modi       = dt.Rows[0][tque.user_modi].ToString();
                    stf1.user_cancel     = dt.Rows[0][tque.user_cancel].ToString();
                    stf1.status_queue    = dt.Rows[0][tque.status_queue].ToString();
                    stf1.active          = dt.Rows[0][tque.active].ToString();
                    stf1.queue_name      = dt.Rows[0][tque.queue_name].ToString();
                    stf1.date_begin      = dt.Rows[0][tque.date_begin].ToString();
                    stf1.date_finish     = dt.Rows[0][tque.date_finish].ToString();
                    stf1.queue_current   = dt.Rows[0][tque.queue_current].ToString();
                    stf1.queue           = dt.Rows[0][tque.queue].ToString();
                    stf1.b_queue_date_id = dt.Rows[0][tque.b_queue_date_id].ToString();
                    stf1.queue_call_id   = dt.Rows[0][tque.queue_call_id].ToString();
                    stf1.prefix          = dt.Rows[0]["queue_prefix"].ToString();
                    stf1.code            = dt.Rows[0]["queue_code"].ToString();
                }
                catch (Exception ex)
                {
                }
                finally
                {
                }
            }
            else
            {
                setQueue1(stf1);
            }
            return(stf1);
        }
Esempio n. 24
0
        public String insert(TQueue p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);

            sql = "Insert Into " + tque.table + " set " +
                  //" " + que.queue_date + "= now() " +
                  //" " + que.row_1 + "='" + p.row_1 + "' " +
                  " " + tque.active + "='1' " +
                  //"," + que.staff_id + "='" + p.staff_id.Replace("'", "''") + "' " +
                  //"," + que.status_queue + "='1' " +
                  //"," + que.staff_name + "='" + p.staff_name.Replace("'", "''") + "' " +
                  "," + tque.date_create + "= now() " +
                  "," + tque.user_create + "='" + userId.Replace("'", "''") + "' " +
                  "," + tque.queue_call_id + "='" + p.queue_call_id.Replace("'", "''") + "' " +
                  "," + tque.queue_date + "='" + p.queue_date.Replace("'", "''") + "' " +
                  "," + tque.row_1 + "='" + p.row_1.Replace("'", "''") + "' " +
                  "," + tque.queue_active + "='" + p.queue_active.Replace("'", "''") + "' " +
                  "," + tque.status_queue + "='" + p.status_queue.Replace("'", "''") + "' " +
                  "," + tque.queue_name + "='" + p.queue_name.Replace("'", "''") + "' " +
                  "," + tque.date_begin + "='" + p.date_begin.Replace("'", "''") + "' " +
                  "," + tque.date_finish + "='" + p.date_finish.Replace("'", "''") + "' " +
                  "," + tque.b_queue_date_id + "='" + p.b_queue_date_id.Replace("'", "''") + "' " +
                  "," + tque.queue + "='" + p.queue.Replace("'", "''") + "' " +
                  "," + tque.queue_current + "='" + p.queue_current.Replace("'", "''") + "' " +
                  "";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Esempio n. 25
0
        public String FinishAndNewQueue(String t_que_id, String que_date_id, String user_id, String queue_call_id)
        {
            String re = "", sql = "";
            TQueue stf1 = new TQueue();

            try
            {
                MySqlCommand cmd = new MySqlCommand("finishque_newque", conn.conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.Parameters.Add(new MySqlParameter("?t_que_id", MySqlDbType.VarChar));
                cmd.Parameters.Add(new MySqlParameter("?user_id1", MySqlDbType.VarChar));
                cmd.Parameters.Add(new MySqlParameter("?queue_date_id1", MySqlDbType.VarChar));
                cmd.Parameters.Add(new MySqlParameter("?queue_call_id", MySqlDbType.VarChar));
                cmd.Parameters.Add(new MySqlParameter("?ret", MySqlDbType.VarChar));
                cmd.Parameters["?t_que_id"].Direction       = ParameterDirection.Input;
                cmd.Parameters["?t_que_id"].Value           = t_que_id;
                cmd.Parameters["?queue_date_id1"].Direction = ParameterDirection.Input;
                cmd.Parameters["?queue_date_id1"].Value     = que_date_id;
                cmd.Parameters["?user_id1"].Direction       = ParameterDirection.Input;
                cmd.Parameters["?user_id1"].Value           = user_id;
                cmd.Parameters["?queue_call_id"].Direction  = ParameterDirection.Input;
                cmd.Parameters["?queue_call_id"].Value      = queue_call_id;
                cmd.Parameters["?ret"].Direction            = ParameterDirection.Output;
                conn.conn.Open();
                cmd.ExecuteNonQuery();
                re = ((String)cmd.Parameters["?ret"].Value).ToString();
                //MySqlDataAdapter adap = new MySqlDataAdapter(cmd);
                //DataTable dt = new DataTable();
                //adap.Fill(dt);
                //stf1 = setQueue(dt);
                //stf1 = selectByPk(re);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                new LogWriter("e", "TQueduDB FinishAndNewQueue " + sql);
            }
            finally
            {
                conn.conn.Close();
            }
            return(re);
        }
Esempio n. 26
0
        private void initConfig()
        {
            try
            {
                InitializeComponent();
                this.Size     = new System.Drawing.Size(1224, 768);
                fEdit         = new Font(bqc.iniC.grdQueTodayFontName, bqc.grdQueTodayFontSize, FontStyle.Regular);
                fEditPrintQue = new Font(bqc.iniC.printerQueueFontName, int.Parse(bqc.iniC.printerQueueFontSize), FontStyle.Regular);
                theme1        = new C1ThemeController();
                tque          = new TQueue();
                comp          = new Company();

                this.Text            = "Run-time Controls";
                this.FormBorderStyle = FormBorderStyle.FixedDialog;
                this.StartPosition   = FormStartPosition.CenterParent;
                //this.StartPosition = FormStartPosition.CenterParent;

                timer          = new Timer();
                timer.Interval = bqc.timerImgScanNew;
                timer.Enabled  = false;
                timer.Tick    += Timer_Tick;

                comp = bqc.bquDB.compDB.selectByCode1("000");
                initGrfQueToday();
                setGrfQueToday();
                theme1.SetTheme(pn1, bqc.iniC.themeApplication);
                theme1.SetTheme(sB1, bqc.iniC.themeApplication);
                //this.ResumeLayout(false);
                //this.PerformLayout();

                this.StartPosition = FormStartPosition.CenterScreen;
                btnStatus.Click   += BtnStatus_Click;
            }
            catch (Exception ex)
            {
                new LogWriter("e", "FrmQueueDate initConfig err " + ex.Message);
            }
        }
Esempio n. 27
0
        public String update(TQueue p, String userId)
        {
            String re  = "";
            String sql = "";
            int    chk = 0;

            chkNull(p);
            sql = "Update " + tque.table + " Set " +
                  " " + tque.queue_date + "='" + p.queue_date + "' " +
                  //"," + que.row_1 + "='" + p.row_1 + "' " +
                  "," + tque.active + "='" + p.active + "' " +
                  "," + tque.date_modi + "=now() " +
                  "," + tque.user_modi + "='" + userId.Replace("'", "''") + "' " +
                  //"," + que.staff_name + "='" + p.staff_name.Replace("'", "''") + "' " +
                  //"," + que.date_begin + "='" + p.date_begin.Replace("'", "''") + "' " +
                  //"," + que.date_finish + "='" + p.date_finish.Replace("'", "''") + "' " +
                  "," + tque.queue_date + "='" + p.queue_date.Replace("'", "''") + "' " +
                  "," + tque.row_1 + "='" + p.row_1.Replace("'", "''") + "' " +
                  "," + tque.queue_active + "='" + p.queue_active.Replace("'", "''") + "' " +
                  "," + tque.status_queue + "='" + p.status_queue.Replace("'", "''") + "' " +
                  "," + tque.queue_name + "='" + p.queue_name.Replace("'", "''") + "' " +
                  "," + tque.date_begin + "='" + p.date_begin.Replace("'", "''") + "' " +
                  "," + tque.date_finish + "='" + p.date_finish.Replace("'", "''") + "' " +
                  "Where " + tque.pkField + "='" + p.t_queue_id + "'"
            ;

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

            return(re);
        }
Esempio n. 28
0
 public void flushQueue()
 {
     queue = new TQueue();
 }
Esempio n. 29
0
    private static List<Chunk> DequeueChunks(TQueue<Chunk> queue)
    {
        List<Chunk> chunks = new List<Chunk>();
        while (queue.Count > 0)
        {
            chunks.Add(queue.Dequeue());
        }

        return chunks;
    }
Esempio n. 30
0
 /// <summary>
 /// Pulls in the currently executing thread so we
 /// always have a reference back to it.
 /// </summary>
 private void Awake()
 {
     actionQueue  = new TQueue <Action>();
     mainThead    = Thread.CurrentThread;
     EngineTicker = GetComponent <IGameEngineTicker>();
 }
Esempio n. 31
0
 private static void EnqueueChunks(List<Chunk> chunks, TQueue<Chunk> queue)
 {
     foreach (Chunk chunk in chunks)
     {
         queue.Enqueue(chunk);
     }
 }
Esempio n. 32
0
    private static List<Chunk> GetChunksNotOnTheBorderInQueue(TQueue<Chunk> queue)
    {
        List<Chunk> chunks = new List<Chunk>();
        while (queue.Count > 0)
        {
            Chunk chunk = queue.Dequeue();
            if (!chunk.IsOnTheBorder)
            {
                chunks.Add(chunk);
            }
        }

        return chunks;
    }
Esempio n. 33
0
 public CustomIterator(TQueue <T> queue)
 {
     _queue   = queue;
     _index   = queue._queueHead - 1;
     _version = _queue.Version;
 }
Esempio n. 34
0
 public void initQueue(SolutionEventType type)
 {
     if(queues.ContainsKey(type)) {
         return;
     }
     queues[type] = new TQueue();
 }
 public void flushQueue()
 {
     queue = new TQueue();
 }
Esempio n. 36
0
 public GameUser()
     : base(AccessLevel.ReadWrite)
 {
     UserExtend = new GameUserExtend();
     GrayCrystalList = new CacheList<GrayCrystal>();
     SportsCombatQueue = new TQueue<SportsCombat>(SportsCombatMax);
     PropertyInfo = new CacheList<GuildAbility>();
     HeritageList = new CacheList<GeneralHeritage>();
     SweepPool = new SweepPoolInfo();
     OpenFun = new List<UserFunction>();
 }