Example #1
0
        private void btnBang_Click(object sender, EventArgs e)
        {
            val2 = double.Parse(txtDisplay.Text);
            double KQ;

            if (sign == "+") //Cong
            {
                KQ = val1 + val2;
                txtDisplay.Text = KQ.ToString();
            }
            else if (sign == "-") //Tru
            {
                KQ = val1 - val2;
                txtDisplay.Text = KQ.ToString();
            }
            else if (sign == "*")  //Nhan
            {
                KQ = val1 * val2;
                txtDisplay.Text = KQ.ToString();
            }
            else if (sign == "/") //Chia
            {
                KQ = val1 / val2;
                txtDisplay.Text = KQ.ToString();
            }
            else if (sign == "√") //Can
            {
                KQ = Math.Sqrt(val2);
                txtDisplay.Text = KQ.ToString();
            }
        }
Example #2
0
        //发布考勤
        public int publishAttendance(KQ kq)
        {
            string sql = "insert into KQ (CourseId,KQTime,EndTime) values (@CourseId,@KQTime,@EndTime)";

            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@CourseId", kq.CourseId),
                new SqlParameter("@KQTime", kq.KqTime),
                new SqlParameter("@EndTime", kq.EndTime)
            };
            return(new Helper.SQLHelper().update(sql, param, false));
        }
 public Object Get(string EmployeeNo)
 {
     using (SqlConnection con = new SqlConnection(_connectionString))
     {
         ResponseData data = new ResponseData();
         BllKQ        bll  = new BllKQ(con);
         KQ           kq   = bll.GetUserById(EmployeeNo);
         if (kq != null)
         {
             data.EmployeeName = kq.NAME;
         }
         return(data);
     }
 }
Example #4
0
        public static void Init(float musicVolume)
        {
            MusicVolume = musicVolume;

            foreach (string file in KQ.RetrieveFilePathForFilesInDirectory(@"content/audio/music", @"*.ogg|*.wav"))
            {
                var sound = new Sound(Library.Get <SoundBuffer>(file));
                //sound.OnComplete += LoopMusic;
                musics.Add(Path.GetFileNameWithoutExtension(file), sound);
            }

            foreach (string file in KQ.RetrieveFilePathForFilesInDirectory(@"content/audio/sounds", @"*.ogg|*.wav"))
            {
                sounds.Add(Path.GetFileNameWithoutExtension(file), new Sound(Library.Get <SoundBuffer>(file)));
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            DateTime KqTime  = DateTime.Now;
            int      minutes = Convert.ToInt32(TextBox1.Text.Trim());
            KQ       kq      = new KQ()
            {
                CourseId = Convert.ToInt32(Request.Params["CourseId"]),
                KqTime   = DateTime.Now,
                EndTime  = KqTime.AddMinutes(minutes)
            };
            int result = new KqManage().publishAttendance(kq);

            if (result > 0)
            {
                Response.Write("<script>window.alert('发布成功!');history.go(-2)</script>");
            }
        }
Example #6
0
        }//gan info A vao info T

        static public void Astart()
        {
            info X = new info()
            {
            };

            ganbang(X.S, G);
            X.g     = 0;
            X.h     = count(G);
            X.f     = X.h;
            X.go    = NO;
            X.num   = q;
            q       = q + 1;
            X.numgo = -1;
            O.them(X);
            while (O.n > 0)
            {
                info N = new info();
                int  k = 0;
                int  l = 0;
                N = O.timfnho();
                ganinfo(ref X, N);
                O.xoainfothua(X);
                C.them(X);
                if (sobang(X.S, S0))
                {
                    KQ.them(X);
                    KQ.n = 1;
                    return;
                }
                timotrong(X.S, ref k, ref l);

                //k>0 nên có thê Up được
                if (k > 0 && X.go != UP)
                {
                    info BK = new info();
                    ganbang(BK.S, X.S);
                    BK.go = DN;
                    Xulyke(X, BK, ref BK.go, k, l, ref O);
                }

                //k<2 nên có thê Down được
                if (k < 2 && X.go != DN)
                {
                    info BK = new info();
                    ganbang(BK.S, X.S);
                    BK.go = UP;
                    Xulyke(X, BK, ref BK.go, k, l, ref O);
                }

                //l>0 nên có thể Left được
                if (l > 0 && X.go != LT)
                {
                    info BK = new info();
                    ganbang(BK.S, X.S);
                    BK.go = RT;
                    Xulyke(X, BK, ref BK.go, k, l, ref O);
                }

                //l<2 nên có thể Right được
                if (l < 2 && X.go != RT)
                {
                    info BK = new info();
                    ganbang(BK.S, X.S);
                    BK.go = LT;
                    Xulyke(X, BK, ref BK.go, k, l, ref O);
                }
            }
            return;
        }
Example #7
0
 /// <summary>
 /// 发布考勤
 /// </summary>
 /// <param name="kq"></param>
 /// <returns></returns>
 public int publishAttendance(KQ kq)
 {
     return(new KqService().publishAttendance(kq));
 }