예제 #1
0
        private void ManagerMoreSettingPanel_Load(object sender, EventArgs e)
        {
            try
            {
                SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>();
                this.checkUseHardKeyboard.Checked = config.UseHardwareKeyboard;
                this.checkUseMask.Checked         = config.UseMaskPanel;
                this.checkAllowRfid.Checked       = config.UseRfid;
                this.checkVitualKeyboard.Checked  = config.UseVirtualKeyboard;
                this.txtUnOperationTime.Text      = config.UnOperationTime.ToString();
                this.cbProvince.DropDownStyle     = ComboBoxStyle.DropDownList;
                this.cbProvince.DataSource        = HiPiaoCache.GetProvince();
                this.cbProvince.DisplayMember     = "Name";
                this.cbProvince.Text          = config.Province;
                this.cbCity.Text              = config.City;
                this.cbCinema.Text            = config.Cinema;
                this.txtRefreshCacheTime.Text = config.UpdateMovieTime.ToString();
                this.cbPrinterType.Text       = config.PrinterType;
                this.txtFullScreenSecond.Text = config.FullScreenSecond.ToString();

                this.checkAllowNumberKeyboard.Checked = config.AllowNumberKeyboard;
                this.checkIsDingXin.Checked           = config.IsDingXin;
                this.txtAdSeconds.Text          = config.AdSeconds.ToString();
                this.txtFullScreenAddWidth.Text = config.FullScreenAddWidth.ToString();

                this.checkAllowFullScreen.Checked = config.AllowFullScreen;
            }
            catch
            {
            }
        }
예제 #2
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            //  bool allowSend = true;

            /*
             * if (pre != null)
             * {
             *  double times = System.DateTime.Now.Subtract(pre).TotalSeconds;
             *  if (times > 30)
             *  {
             *      allowSend = true;
             *  }
             *  else
             *  {
             *      allowSend = false;
             *  }
             *
             * }
             * */
            if (allowSend && this.txtMobile.Text.Length == 11)
            {
                this.lbHint.Text = string.Empty;
                // string content = "您的" + user.Name + "账户于" + System.DateTime.Now.ToString("M月d日") + "以" + user.Mobile + "成功消费" + fee + "元,账户余额" + user.Balance + "元。如有疑问请致电400-601-5566【哈票网】";
                string content = string.Format("本次验证码:{0},如有疑问请致电400-601-5566", RandomSmsHelper.GenerateNumberCode(6));
                bool   result  = HiPiaoCache.SmsMobileContent(this.txtMobile.Text.Trim(), content);
                this.timer1.Start();
                allowSend = false;
                this.pictureBox1.BackgroundImage = Properties.Resources.BindMobile_SendValidCode_NotActive;
                // this.lbHint = "验证码已发送,请查收!";
                //pre = System.DateTime.Now;
            }
        }
예제 #3
0
        private void btnSure_Click(object sender, EventArgs e)
        {
            string mobile = this.txtMobile.Text.Trim();

            if (!FT.Commons.Tools.ValidatorHelper.ValidateMobile(mobile, false))
            {
                GlobalTools.Pop("手机号码输入有误!");
                return;
            }
            if (RandomSmsHelper.IsRight(this.txtCode.Text))
            {
                if (HiPiaoCache.BindMobile(GlobalTools.GetLoginUser(), this.txtMobile.Text))
                {
                    GlobalTools.GetLoginUser().IsBindMobile = true;
                    GlobalTools.GetLoginUser().Mobile       = this.txtMobile.Text.Trim();
                    this.lbHint.Text = "绑定手机成功!";
                    //GlobalTools.Pop("绑定手机成功!");
                    GlobalTools.ChangePanel(this.FindForm(), new BindMobileSuccessPanel());
                    //this.FindForm().Close();
                }
                else
                {
                    this.lbHint.Text = "绑定手机失败!!";
                    //GlobalTools.Pop("绑定手机失败!");
                }
            }
            else
            {
                this.lbHint.Text = "验证码输入错误!";
                //GlobalTools.Pop("验证码输入错误!");
            }
        }
예제 #4
0
 private void PrintTask()
 {
     Thread.Sleep(3000);
     // GlobalTools.Pop(new SuccessBuyTicketPanel());
     if (HiPiaoCache.SmsUserFeeDetail(GlobalTools.GetLoginUser(), this.fee))
     {
         GlobalTools.Pop(new CosumeDetailPanel(this.lists, this.movieInfo, this.moviePlan));
     }
 }
예제 #5
0
 private void ThreadLoadSeat()
 {
     this.lbProcessHint.Visible = true;
     this.processPanel1.Visible = true;
     this.processPanel1.StartProcess();
     InitSeat(HiPiaoCache.GetSeatList(roomPlan.PlanId));
     this.processPanel1.StopProcess();
     this.lbProcessHint.Visible = false;
     this.processPanel1.Visible = false;
     this.loaded = true;
 }
예제 #6
0
        private void btnConfirmPay_Click_1(object sender, EventArgs e)
        {
            if (allowPay)
            {
#if DEBUG
                UserObject usertmp = GlobalTools.GetLoginUser();
                string     pwdtmp  = usertmp.Pwd;
#endif
                if (GlobalTools.GetLoginUser().Pwd.Length == 0)
                {
                    UserObject user = HiPiaoOperatorFactory.GetHiPiaoOperator().Login(GlobalTools.GetLoginUser().Name, this.txtUserPwd.Text);
                    if (user != null)
                    {
                        GlobalTools.loginUser = user;
                    }
                    else
                    {
                        this.lbMsg.Text = "密码输入错误!";
                        return;
                    }
                }
                if (this.txtUserPwd.Text != GlobalTools.GetLoginUser().Pwd)
                {
                    this.lbMsg.Text = "密码输入错误!";
                    return;
                }
                this.FindForm().Close();
                //string retCode="1";
                string retCode = HiPiaoCache.UserBuyTicket(GlobalTools.GetLoginUser(), this.lists);
                //<?xml version="1.0" encoding="utf-8"?><root><order res="0" stat="购票失败"  text="场次过期"  phone="4001-099-088" ></order></root>
                //订购成功
                if (retCode == "1")
                {
                    GlobalTools.GetLoginUser().NeedRefresh();
                    GlobalTools.ChangePanel(GlobalTools.MainForm, new WaitTicketPrintPanel(this.lists, this.movieInfo, this.moviePlan));
                    this.FindForm().Close();
                }
                //订购失败
                else if (retCode.StartsWith("0"))
                {
                    this.FindForm().Close();
                    GlobalTools.Pop(retCode.Substring(1));
                    //GlobalTools.PopNetError();
                }
                //座位已售出,重新刷座位图
                else if (retCode.StartsWith("2"))
                {
                    this.FindForm().Close();
                    this.lbMsg.Text = "座位已售出,重新选择座位!";
                    GlobalTools.ChangePanel(GlobalTools.MainForm, new MovieSeatSelectorPanel(this.roomPlan, this.movieInfo, this.moviePlan, dt));
                }
            }
        }
예제 #7
0
        private void cbProvince_TextChanged(object sender, EventArgs e)
        {
            string province = this.cbProvince.Text;

            if (province.Length > 0)
            {
                this.cbCity.DropDownStyle = ComboBoxStyle.DropDownList;
                this.cbCity.DataSource    = HiPiaoCache.GetCitys(province);
                this.cbCity.DisplayMember = "Name";
                this.cbCity.ValueMember   = "McityId";
            }
        }
예제 #8
0
        private void cbCity_TextChanged(object sender, EventArgs e)
        {
            string city = this.cbCity.Text;

            if (city.Length > 0)
            {
                string province = this.cbProvince.Text;
                this.cbCinema.DropDownStyle = ComboBoxStyle.DropDownList;
                this.cbCinema.DataSource    = HiPiaoCache.GetCinemas(province, city);
                this.cbCinema.DisplayMember = "Name";
                this.cbCinema.ValueMember   = "Cinemanumber";
            }
        }
예제 #9
0
        /// <summary>
        /// 定时刷新影片显示内容
        /// </summary>
        public static void RefreshMovieShowList()
        {
            lock (synObj)
            {
                try
                {
#if DEBUG
                    Console.WriteLine("定时刷新热门电影和广告缓存" + System.DateTime.Now.ToString());
#endif
                    SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>();

                    HiPiaoCache.RefreshHotMovie(config.Province, config.City);
                    HiPiaoCache.RefreshAdvertisement(config.Cinema);

                    /*
                     * MovieShowList.Clear();
                     * DirectoryInfo dir = new DirectoryInfo("MovieShows");
                     * if (dir != null)
                     * {
                     *  FileInfo[] files = dir.GetFiles();
                     *  MovieObject movie = null;
                     *  Image img = null;
                     *  for (int i = 0; i < files.Length; i++)
                     *  {
                     *
                     *      try
                     *      {
                     *          img = Image.FromFile(files[i].FullName);
                     *          movie = new MovieObject();
                     *          movie.AdImage = (Image)img.Clone();
                     *          movie.Name = files[i].Name;
                     *          MovieShowList.Add(movie);
                     *      }
                     *      catch (Exception ex)
                     *      {
                     *          //MessageBoxHelper.Show(ex.ToString());
                     *      }
                     *  }
                     * }
                     * */
                }
                catch (Exception ex)
                {
                    GlobalTools.Log(ex);
                    Console.WriteLine("定时刷新出现异常:" + ex.ToString());
                    GlobalTools.PopNetError();
                }
            }
            //FileInfo
        }
예제 #10
0
        private void ThreadGetPlan()
        {
            this.lbProcessHint.Visible = true;
            this.processPanel1.Visible = true;
            this.processPanel1.StartProcess();


            SystemConfig    config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>();
            MoviePlanObject plan   = HiPiaoCache.GetMoviePlanVii(config.Province, config.City, movie.Id, config.CinemaId, planDt);

            this.SetMoviePlan(plan);
            this.processPanel1.StopProcess();
            this.lbProcessHint.Visible = false;
            this.processPanel1.Visible = false;
            this.loaded = true;
        }
예제 #11
0
 public Form1()
 {
     InitializeComponent();
     //SetStyle(ControlStyles.smo
     this.DoubleBuffered = true;                         //设置本窗体
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
     SetStyle(ControlStyles.DoubleBuffer, true);         // 双缓冲
     this.UpdateStyles();
     //this.WindowState = FormWindowState.Maximized;
     this.Width  = 1280;
     this.Height = 960;
     HiPiaoCache.DeSerializedCache();
     GlobalTools.InitAll(this);
     GlobalTools.MaskFormKeyDown(this);
     //HiPiaoCache.DeSerializedCache();
     //SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
     //UpdateStyles();
 }
예제 #12
0
        static void Main(string[] args)
        {
            for (int i = 0; i < 10; i++)
            {
                Console.WriteLine("随机产生6位随机码:" + HiPiaoInterface.RandomSmsHelper.GenerateNumberCode(6));
            }
            //HiPiaoInterface.HipiaoTcpHelper.GetTicket();
            HiPiaoCache.GetDingXinTicket();
            // DingXinResponseObject.Parse("");
            Console.ReadLine();

            /*
             * 拼装字符串=MEMBERID26c52c2e-69ae-102e-8c3d-001a4beef7e4fromclientHPMACHINEmobile13911139181normal2planIdb8695e80-065b-11e2-a9dc-001bb97ef1a4seatids4b45e880-f01f-11e0-98ca-001bb97ef1a4,4b711730-f01f-11e0-98ca-001bb97ef1a4
             * 密码+卡号加密=f56174a3de82dd6016bd5dff2d770682
             * 最终加密md5(r2+r1)=53d1205f9fddc1a3a1fc21f3880a4c84
             */
            string rr1 = "f56174a3de82dd6016bd5dff2d770682";
            string rr2 = "MEMBERID26c52c2e-69ae-102e-8c3d-001a4beef7e4fromclientHPMACHINEmobile13911139181normal2planIdb8695e80-065b-11e2-a9dc-001bb97ef1a4seatids4b45e880-f01f-11e0-98ca-001bb97ef1a4,4b711730-f01f-11e0-98ca-001bb97ef1a4";

            // string rr2   = "MEMBERID26c52c2e-69ae-102e-8c3d-001a4beef7e4fromclientHPMACHINEmobile13911139181normal2planidb8695e80-065b-11e2-a9dc-001bb97ef1a4seatids4b45e880-f01f-11e0-98ca-001bb97ef1a4,4b711730-f01f-11e0-98ca-001bb97ef1a4";
            //MEMBERID26c52c2e-69ae-102e-8c3d-001a4beef7e4fromclientHPMACHINEmobile13911139181normal2planIdb8695e80-065b-11e2-a9dc-001bb97ef1a4seatids4b45e880-f01f-11e0-98ca-001bb97ef1a4,4b711730-f01f-11e0-98ca-001bb97ef1a4

            Console.WriteLine("最终加密结果rr1+rr2为:" + Encrypt(rr2 + rr1));
            ISecurity md5 = new MD5Security();

            //1b8dc01720fc2b67ad19a3c526c7bca2
            Console.WriteLine("最终加密结果为:" + Encrypt("789001"));
            string menberid   = "26c52c2e-69ae-102e-8c3d-001a4beef7e4";
            string mobile     = "18618237773";
            string count      = "4";
            string planid     = "c81f8af0-fb63-11e1-a9dc-001bb97ef1a4@@6";
            string seatv      = "9be8e070-8acb-11e1-b245-001bb97ef1a4,9be81d20-8acb-11e1-b245-001bb97ef1a4,9be86b40-8acb-11e1-b245-001bb97ef1a4,9be9cad0-8acb-11e1-b245-001bb97ef1a4";
            string fromclient = "ANDROID";
            string pwd        = "789001";
            string hipiaocard = "26c52c2e69";
            String r1         = "MEMBERID" + menberid +
                                "fromclient" + fromclient +
                                "mobile" + mobile +
                                "normal" + count +
                                "planId" + planid +
                                "seatids" + seatv

            ;

            //String r2 = md5.Encrypt(md5.Encrypt(md5.Encrypt(pwd)) +hipiaocard);
            //String r3 = md5.Encrypt(r1 + r2);
            Console.WriteLine("r1==" + r1);
            String r2 = Encrypt(Encrypt(Encrypt(pwd)) + hipiaocard);

            Console.WriteLine("r2==" + r2);
            String tmp = r1 + r2;

            Console.WriteLine("tmp==" + tmp);
            //MD5Tester tester = new MD5Tester();
            // Console.WriteLine("临时加密结果为:" + MD5Tester.Encrypt(tmp,32));
            Console.WriteLine("临时加密结果为:" + md5One(tmp));
            String r3 = Encrypt(r1 + r2);

            Console.WriteLine("r3==" + r3);
            String r4 = "MEMBERID=" + menberid + "&mobile="
                        + mobile + "&normal="
                        + count + "&planId="
                        + planid + "&seatids=" + seatv
                        + "&fromclient" + fromclient;
            //String query = r4 + "&pass="******"&pass="******"yyyy-MM-dd HH:mm:ss") + "发送购票内容为:" + query);
#endif
            //9457ea0b240e8dfaa85622d371330f89
            //MEMBERID=&mobile=18618237773&normal=4&planId=&seatids=&fromclient&pass=

            // TestConnection2(10000);

            /*
             * 3D3514F23F37E13A 丰大驾校
             * 4D64496ADCEF53E0 安泰驾校
             * 13EE4553EEF0DF7E 市驾培中心
             * A59B773F9C3AA159 惠东平安
             * C4FA4E8E43E6A92F 惠东怡辉
             * 70C1D30CC159B03B 博罗鸿信
             * A60793889949C6F6 光大驾校
             * 23762878906B059C 亮丽驾校
             * AD8045BF9592308E 博罗鸿信
             * 3D00BF143CC95448 环球驾校
             * F1844D78F2236926 宏达驾校
             * 50B4238104DABA1C
             * E48EF54511ED7D4F 市驾培中心
             * 7D66505102C8DB25 隆辉驾校
             * 84A883D2309E661D 隆辉驾校
             * DCA698218706CA2B 博罗鸿信
             * C3F979CF15706C39 金峰驾校
             *
             *
             *
             *
             * ComputerMonitorHelper helper = new ComputerMonitorHelper();
             * helper.CheckIsOpenPort(3389);
             * helper.CheckIsOpenPort("192.168.1.10",3389);
             * //FT.Commons.WindowsService.BaseWindowService serv = new FT.Commons.WindowsService.ExDiskPluginMonitorService("CDEF", 1000);
             * //FT.Commons.WindowsService.BaseWindowService serv = new FT.Commons.WindowsService.NetworkMonitorService( 1000);
             * // FT.Commons.WindowsService.BaseWindowService serv = new FT.Commons.WindowsService.SystemServiceMonitorService(30000);
             * // FT.Commons.WindowsService.BaseWindowService serv = new FT.Commons.WindowsService.ProcessMonitorService(30000);
             *
             * //  serv.DoTask();
             * //ComputerInitHelper.InitFolderMd5("Windows Xp","Sp3","D:\\自助终端","D:\\自助终端");
             * // ComputerInitHelper.InitSystemServices();
             * //ComputerInitHelper.InitSystemNetworkCard();
             * Console.ReadLine();
             */
            //ISecurity md5 = new MD5Security();
            ISecurity sec = FT.Commons.Security.SecurityFactory.GetSecurity();
            //string hardwarecode=FT.Commons.Tools.HardwareManager.GetMachineCode();
            // string hardwarecode = "C3F979CF15706C39";
            Console.WriteLine("请输入机器码并回车:");
            string hardwarecode = Console.ReadLine();

            //一友驾校
            //E7A7CA598DDDAFA6
            // string company = "金峰驾校";
            Console.WriteLine("请输入授权用户名称并回车:");
            string company = Console.ReadLine();
            Console.WriteLine("注册码生成结果为->" + md5.Encrypt(sec.Encrypt(hardwarecode + company + hardwarecode)));

            /*  string path = Environment.CurrentDirectory + "//success.wav";
             * SystemDefine.PlaySound(path, 0, SystemDefine.SND_ASYNC | SystemDefine.SND_FILENAME);//播放音乐
             * //FT.Commons.Tools.WindowsPrinterHelper.LoopPrinter();
             * string printer = @"\\192.168.1.150\Brother DCP-7030 Printer";
             * // Console.WriteLine("打印机状态为:"+FT.Commons.Tools.WindowsPrinterHelper.GetPrinterStat(printer).ToString());
             *
             * string cmd = ""+(char)(27)+(char)(33)+(char)(10)+"模";
             * byte[] mybyte = System.Text.Encoding.Default.GetBytes(cmd);
             * for (int i = 0; i < mybyte.Length; i++)
             * {
             *  Console.WriteLine(i+"="+mybyte[i]);
             * }
             *  Console.ReadLine();
             * */
            Console.ReadLine();
        }
예제 #13
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     HiPiaoCache.SerializedCache();
 }
예제 #14
0
        void adShowTimer_Tick(object sender, EventArgs e)
        {
            adShowTimer.Stop();
            try
            {
                if (this.Visible)
                {
                    SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig<SystemConfig>();
                    List<AdvertisementObject> lists = HiPiaoCache.GetAdvertisement(config.Cinema);
                    int len = lists.Count;
                    if (len == 0)
                    {

                        return;
                    }
                    int currentIndex = 0;
            #if DEBUG
                    //Console.WriteLine("当前广告对象的Tag内容为:" + this.Tag);
            #endif
                    if (this.Tag == null)
                    {
                        //this.BackgroundImage = lists[0].AdvPic;
                        currentIndex = 0;
                    }
                    else
                    {
                        currentIndex = Convert.ToInt32(this.Tag.ToString());
                        if (currentIndex == lists.Count - 1)
                        {
                            currentIndex = 0;
                        }
                       // else if (currentIndex != 0)
                        else
                        {
                            currentIndex += 1;
                        }
                    }

            #if DEBUG
                    //Console.WriteLine("当前广告起始的索引为:" + currentIndex);
            #endif
                    int count = 0;
                    int countindex=0;
                    for (int i = 0; i < lists.Count; i++)
                    {
                        if (lists[i].AdvWeizhiOne == adType)
                        {
                            count++;
                            countindex = i;
                        }
                    }
                    if (count == 0)
                    {
                        this.BackgroundImage = lists[0].AdvPic;
                        this.Tag ="0";
                    }
                    else if (count == 1)
                    {
                        this.BackgroundImage = lists[countindex].AdvPic;
                        this.Tag = countindex.ToString();
                    }
                    else if (count > 1)
                    {
                        for (int i = currentIndex; i < lists.Count; i++)
                        {
                            //if (true)
                            if (i > 0 && i == lists.Count - 1 && lists[i].AdvWeizhiOne != adType)
                            {
            #if DEBUG
                                Console.WriteLine(System.DateTime.Now.ToString() + "最后一个广告索引都不是位置:" + adType);
            #endif
                                i = 0;

                                continue;
                            }
                            if (lists[i].AdvWeizhiOne == adType)
                            {
                                this.BackgroundImage = lists[i].AdvPic;
                                this.Tag = i.ToString();
                                break;
                            }
                        }
                    }
                }
            }
            catch
            {

            }
            adShowTimer.Start();
        }
예제 #15
0
        private void InitMovies(DateTime dt)
        {
            SystemConfig       config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>();
            List <MovieObject> all    = HiPiaoCache.GetHotMovie(config.Province, config.City);

            List <MovieObject> lists = HiPiaoCache.GetDayMovie(config.City, config.CinemaId, dt, all);

            if (lists == null || lists.Count == 0)
            {
                //274, 42
                //745, 374
                PictureBox pic = new PictureBox();
                pic.BackgroundImage = Properties.Resources.BuyTick_No_Plan;
                pic.Width           = 745;
                pic.Height          = 374;
                pic.Location        = new Point(274, 42);
                this.panelContent.Controls.Clear();
                //this.panelContent.Controls.Add(pic);
                WindowFormDelegate.AddControlTo(this.panelContent, pic);
                //this.picShowNoPlanHint.Visible = true;
            }

            else if (lists != null && lists.Count > 0)
            {
                this.panelContent.Controls.Clear();
                int x         = 100;
                int y         = 0;
                int col       = 0;
                int row       = 0;
                int linecount = 6;
                for (int i = 0; i < lists.Count; i++)
                {
                    PictureBox pc = new PictureBox();
                    pc.Width  = picWid;
                    pc.Height = picHeight;
                    pc.Tag    = lists[i];
                    if (lists[i].AdImagePath.Length > 0)
                    {
                        pc.Image = Image.FromFile(lists[i].AdImagePath);
                    }
                    pc.Location = new Point(x + (i % linecount) * (picWid + colSep), y + (i / linecount) * (picHeight + rowSep));
                    Label lb = new Label();
                    lb.Tag      = lists[i];
                    lb.AutoSize = false;
                    lb.Width    = picWid;
                    //lb.BackColor = Color.Red;
                    lb.Height    = 28;
                    lb.Location  = new Point(pc.Location.X, pc.Location.Y + picHeight);
                    lb.ForeColor = Color.FromArgb(69, 68, 68);
                    lb.TextAlign = ContentAlignment.MiddleCenter;
                    lb.Font      = new Font("方正兰亭纤黑简体", 18, FontStyle.Bold);
                    //string name = "很长的测试电影名字如果爱琴海岛上没有海盗";
                    string name = lists[i].Name;
                    if (name.Length > 6)
                    {
                        lb.Text = name.Substring(0, 6);
                    }
                    else
                    {
                        lb.Text = name;
                    }
                    lb.MouseHover += new EventHandler(lb_MouseHover);

                    pc.Click      += new EventHandler(pc_Click);
                    pc.MouseHover += new EventHandler(lb_MouseHover);
                    WindowFormDelegate.AddControlTo(this.panelContent, pc);
                    WindowFormDelegate.AddControlTo(this.panelContent, lb);
                    //this.panelContent.Controls.Add(pc);
                    //this.panelContent.Controls.Add(lb);
                }
            }
        }