示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = ConfigurationSettings.AppSettings.Get("urldata");
            width  = Request.QueryString["w"];
            lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]);

            int totalrecord = 0;

            if (lang == 0)
            {
                lnkXemThem.Text = "Nhac HOT";
                ltrGia.Text     = "(" + Resources.Resource.wThongBaoGia_KD + ConfigurationSettings.AppSettings.Get("ringtoneprice") + Resources.Resource.wDonViTien_KD + "/nhac chuong)";
            }
            else
            {
                ltrGia.Text = "(" + Resources.Resource.wThongBaoGia + ConfigurationSettings.AppSettings.Get("ringtoneprice") + Resources.Resource.wDonViTien + "/nhạc chuông)";
            }
            lnkXemThem.NavigateUrl = UrlProcess.GetRingToneHomeUrl(lang.ToString(), width);
            //Tải nhiều nhất
            DataTable dtHottest = RTController.GetAllRingToneByCategoryAndDisplayType(Session["telco"].ToString(), 4, (int)Constant.RingTone.Topdownload, pagesize, 1, out totalrecord);

            rptHottest.DataSource     = dtHottest;
            rptHottest.ItemDataBound += new RepeaterItemEventHandler(rptlastest_ItemDataBound);
            rptHottest.DataBind();
        }
示例#2
0
        /// <summary>
        /// Checks to see if there are any sensors that are not overriden
        /// calls the stop telescope function if it is not safe
        /// Returns true if the telescope is safe to operate
        /// Returns false if the telescope is not safe to operate
        /// </summary>
        public bool checkCurrentSensorAndOverrideStatus()
        {
            // loop through all the current sensors
            foreach (Sensor curSensor in Sensors)
            {
                // if the sensor is in the ALARM state
                if (curSensor.Status == SensorStatusEnum.ALARM)
                {
                    // check to see if there is an override for that sensor
                    if (ActiveOverrides.Find(i => i.Item == curSensor.Item) == null)
                    {
                        // if not, return false
                        // we should not be operating the telescope
                        logger.Fatal(Utilities.GetTimeStamp() + ": Telescope in DANGER due to fatal sensors");
                        safeTel = false;
                        RTController.ExecuteRadioTelescopeImmediateStop(MovementPriority.GeneralStop);
                        OverallSensorStatus = false;
                        return(false);
                    }
                }
            }

            if (safeTel == false)
            {
                logger.Info(Utilities.GetTimeStamp() + ": Telescope in safe state.");
                safeTel = true;
            }
            OverallSensorStatus = true;
            return(true);
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["LastPage"] = Request.RawUrl;
            lang = Request.QueryString["lang"];
            if (!IsPostBack)
            {
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";
                //

                //var advertisement = new Advertisement { Channel = "Home", Position = "HomeCenter", Param = 0, Lang = lang, Width = width.ToString() };
                //litAds.Text = advertisement.GetAds();

                var advertisement1 = new Advertisement {
                    Channel = "Home", Position = "UnderLinks", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds1.Text = advertisement1.GetAds();

                DataTable dtMusic = RTController.GetAllWap_RingTone_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageId")));
                if (dtMusic.Rows.Count > 0)
                {
                    rptRingTone.DataSource     = dtMusic;
                    rptRingTone.ItemDataBound += rptRingTone_ItemDataBound;
                    rptRingTone.DataBind();
                }
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = ConfigurationSettings.AppSettings.Get("urldata");
            width  = Request.QueryString["w"];
            lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["tpage"]))
            {
                tpage = ConvertUtility.ToInt32(Request.QueryString["tpage"]);
            }
            int totalrecord = 0;

            if (lang == 0)
            {
                ltrTaiNhieuNhat.Text = Resources.Resource.wTaiNhieuNhat_KD;
                ltrMoiNhat.Text      = Resources.Resource.wMoiCapNhat_KD;
            }
            else
            {
                ltrTaiNhieuNhat.Text = Resources.Resource.wTaiNhieuNhat;
                ltrMoiNhat.Text      = Resources.Resource.wMoiCapNhat;
            }
            //Tải nhiều nhất
            DataTable dtHottest = RTController.GetAllRingToneByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 4, (int)Constant.RingTone.Topdownload, pagesize, curpage, out totalrecord);

            rptHottest.DataSource     = dtHottest;
            rptHottest.ItemDataBound += new RepeaterItemEventHandler(rptlastest_ItemDataBound);
            rptHottest.DataBind();

            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"] + "&cpage=";

            //Mới nhất
            DataTable dtLatest = RTController.GetAllRingToneByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 17, (int)Constant.RingTone.Lastest, pagesize, tpage, out totalrecord);

            rptLastest.DataSource     = dtLatest;
            rptLastest.ItemDataBound += new RepeaterItemEventHandler(rptlastest_ItemDataBound);
            rptLastest.DataBind();

            Paging2.totalrecord  = totalrecord;
            Paging2.pagesize     = pagesize;
            Paging2.numberpage   = pagenumber;
            Paging2.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"];
            Paging2.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"] + "&tpage=";
            //Quảng cáo
            if (!IsPostBack)
            {
                var advertisementLevel2 = new VmgPortal.Modules.Adsvertising.Advertisement {
                    Channel = "Home", Position = "GameVT1", Param = 0, Lang = Request.QueryString["lang"], Width = width.ToString()
                };
                ltrAdvLevel2.Text = advertisementLevel2.GetAds();
            }
        }
示例#5
0
        private void SpinRoutine()
        {
            bool KeepAlive = KeepThreadAlive;

            while (KeepAlive)
            {
                Appointment NextAppointment = WaitForNextAppointment();

                if (NextAppointment != null)
                {
                    logger.Info("Starting appointment...");

                    // Calibrate telescope
                    if (NextAppointment.Type != AppointmentTypeEnum.FREE_CONTROL)
                    {
                        logger.Info("Calibrating RadioTelescope");
                        RTController.CalibrateRadioTelescope();
                    }

                    // Create movement thread
                    Thread AppointmentMovementThread = new Thread(() => PerformRadioTelescopeMovement(NextAppointment))
                    {
                        Name = "RTControllerIntermediateThread (ID=" + RadioTelescopeID.ToString() + ")"
                    };

                    // Start SpectraCyber
                    StartReadingData(NextAppointment);

                    // Start movement thread
                    AppointmentMovementThread.Start();

                    // End PLC thread & SpectraCyber
                    AppointmentMovementThread.Join();
                    StopReadingRFData();

                    // Stow Telescope
                    EndAppointment();

                    logger.Info("Appointment completed.");
                }
                else
                {
                    if (InterruptAppointmentFlag)
                    {
                        logger.Info("Appointment interrupted in loading routine.");
                        ManagementMutex.WaitOne();
                        InterruptAppointmentFlag = false;
                        ManagementMutex.ReleaseMutex();
                    }

                    logger.Info("Appointment does not have an orientation associated with it.");
                }

                KeepAlive = KeepThreadAlive;

                Thread.Sleep(100);
            }
        }
示例#6
0
        /// <summary>
        /// Ends an appointment by returning the RT to the stow position.
        /// </summary>
        public void EndAppointment()
        {
            logger.Info(Utilities.GetTimeStamp() + ": Ending Appointment");
            endAppt = true;
            MovementResult result = RTController.MoveRadioTelescopeToOrientation(new Orientation(0, 90), MovementPriority.Appointment);

            if (result != MovementResult.Success)
            {
                logger.Error("Stowing telescope failed with message " + result);
            }
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }

            int is3g = 0;
            //string msisdn = MobileUtils.GetMSISDN(out is3g);

            string vnmnumber = MobileUtils.GetMSISDN(out is3g);

            IPList iplist = new IPList();

            iplist.Add("202.172.4.192", 26);
            iplist.Add("203.170.26.0", 24);
            iplist.Add("203.170.27.0", 24);
            iplist.Add("203.128.247.24", 30);
            iplist.Add("203.162.40.20", 30);
            if (iplist.CheckNumber(HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]))
            {
                showDL = true;
            }

            //if (!string.IsNullOrEmpty(vnmnumber) && MobileUtils.CheckOperator(vnmnumber, "vietnammobile") && (iplist.CheckNumber(HttpContext.Current.Request.UserHostAddress)))
            //    if (VietnamobileWap.Library.Component.Wap.WapController.W4A_Subscriber_IsActive(vnmnumber, 3)) showDL = true;

            //start category list
            int totalrecord = 0;
            //DataTable dtCat = RTController.GetAllRingToneByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(),110, (int)Constant.RingTone.Hot100, pagesize, curpage, out totalrecord);
            DataTable dtCat = RTController.VNM_GetAllRingToneByCategoryAndDisplayTypeHasCache(110, (int)Constant.RingTone.Hot100, pagesize, curpage, out totalrecord);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
            rptlstCategory.DataBind();
            Pagging1.totalrecord  = totalrecord;
            Pagging1.pagesize     = pagesize;
            Pagging1.numberpage   = pagenumber;
            Pagging1.defaultparam = "?lang=" + Request.QueryString["lang"];
            Pagging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&cpage=";
            //end category list
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            width = Request.QueryString["w"];
            key   = Request.QueryString["key"];
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            if (!IsPostBack)
            {
                if (lang == 1)
                {
                    ltrTenChuyenMuc.Text = "KẾT QUẢ TÌM KIẾM";
                }
            }
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = RTController.GetAllWap_RingTone_ItemByKey(Session["telco"].ToString(), key, pagesize, curpage, out totalrecord);

            rptResult.DataSource     = dtCat;
            rptResult.ItemDataBound += new RepeaterItemEventHandler(rptResult_ItemDataBound);
            rptResult.DataBind();
            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&key=" + Request.QueryString["key"] + "&id=" + Request.QueryString["id"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&key=" + Request.QueryString["key"] + "&id=" + Request.QueryString["id"] + "&cpage=";
            if (totalrecord == 0)
            {
                Paging1.Visible = false;
            }
            //end category list
            if (lang == 1)
            {
                ltrCount.Text = "Tìm thấy " + totalrecord + " nhạc chuông";
            }
            else
            {
                ltrCount.Text = "Tim thay " + totalrecord + " nhac chuong";
            }
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = ConfigurationSettings.AppSettings.Get("urldata");
            width  = Request.QueryString["w"];
            lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            catID  = ConvertUtility.ToInt32(Request.QueryString["catid"]);

            if (!IsPostBack)
            {
                DataTable catInfo = RTController.GetCategoryByCatIDHasCache(catID);
                if (lang == 1)
                {
                    lnkCateChannel.Text = catInfo.Rows[0]["Title_Unicode"].ToString().ToUpper();
                    lnkHomeChannel.Text = "NHẠC";
                }
                else
                {
                    lnkCateChannel.Text = catInfo.Rows[0]["Title"].ToString().ToUpper();
                }
                lnkCateChannel.NavigateUrl = UrlProcess.GetRingToneCategoryUrl(lang.ToString(), width, catID.ToString());
                lnkHomeChannel.NavigateUrl = UrlProcess.GetRingToneHomeUrl(lang.ToString(), width);
            }

            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = RTController.GetAllRingToneByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), catID, (int)Constant.RingTone.Category, pagesize, curpage, out totalrecord);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
            rptlstCategory.DataBind();
            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&cpage=";
            //end category list
        }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]).ToString();
         width  = Request.QueryString["w"];
         preurl = ConfigurationSettings.AppSettings.Get("urldata");
         DataTable dt = RTController.GetAllCategoryExeptCatIDHasCache(Session["telco"].ToString(), (int)Constant.RingTone.Category, 0);
         totalcat = dt.Rows.Count;
         rptCategory.DataSource     = dt;
         rptCategory.ItemDataBound += new RepeaterItemEventHandler(rptCategory_ItemDataBound);;
         rptCategory.DataBind();
         if (lang == "1")
         {
             ltrTheLoai.Text = Resources.Resource.rTheLoaiNhac;
             ltrGia.Text     = "(" + Resources.Resource.wThongBaoGia + ConfigurationSettings.AppSettings.Get("ringtoneprice") + Resources.Resource.wDonViTien + "/nhạc chuông)";
         }
         else
         {
             ltrTheLoai.Text = Resources.Resource.rTheLoaiNhac_KD;
             ltrGia.Text     = "(" + Resources.Resource.wThongBaoGia_KD + ConfigurationSettings.AppSettings.Get("ringtoneprice") + Resources.Resource.wDonViTien_KD + "/nhac chuong)";
         }
     }
 }
示例#11
0
        /// <summary>
        /// Starts movement of the RT by updating the appointment status and
        /// then calling the RT controller to move the RT to the orientation
        /// it needs to go to.
        /// </summary>
        /// <param name="NextAppointment"> The appointment that is currently running. </param>
        private void PerformRadioTelescopeMovement(Appointment NextAppointment)
        {
            NextAppointment._Status = AppointmentStatusEnum.IN_PROGRESS;
            DatabaseOperations.UpdateAppointment(NextAppointment);

            // send message to appointment's user
            SNSMessage.sendMessage(NextAppointment.User, MessageTypeEnum.APPOINTMENT_STARTED);


            logger.Info(Utilities.GetTimeStamp() + ": Appointment _Type: " + NextAppointment._Type);

            // Loop through each second or minute of the appointment (depending on appt type)
            TimeSpan length   = NextAppointment.end_time - NextAppointment.start_time;
            double   duration = NextAppointment._Type == AppointmentTypeEnum.FREE_CONTROL ? length.TotalSeconds : length.TotalMinutes;

            for (int i = 0; i <= (int)duration; i++)
            {
                // before we move, check to see if it is safe
                if (checkCurrentSensorAndOverrideStatus())
                {
                    // Get orientation for current datetime
                    DateTime datetime = NextAppointment._Type == AppointmentTypeEnum.FREE_CONTROL ? NextAppointment.start_time.AddSeconds(i) : NextAppointment.start_time.AddMinutes(i);
                    NextObjectiveOrientation = RTController.CoordinateController.CalculateOrientation(NextAppointment, datetime);

                    // Wait for datetime
                    while (DateTime.UtcNow < datetime)
                    {
                        if (InterruptAppointmentFlag)
                        {
                            logger.Info(Utilities.GetTimeStamp() + ": Interrupted appointment [" + NextAppointment.Id.ToString() + "] at " + DateTime.Now.ToString());
                            break;
                        }

                        //logger.Debug(datetime.ToString() + " vs. " + DateTime.UtcNow.ToString());
                        Thread.Sleep(1000);
                    }

                    if (InterruptAppointmentFlag)
                    {
                        break;
                    }

                    // Move to orientation
                    if (NextObjectiveOrientation != null)
                    {
                        // Kate - removed the check for azumith < 0 in the below if statement due to Todd's request
                        // Reason being, we should not have an azimuth below 0 be given to us. That check is in the
                        // method calling this!
                        if (NextObjectiveOrientation.Elevation < 0)
                        {
                            logger.Warn(Utilities.GetTimeStamp() + ": Invalid Appt: Az = " + NextObjectiveOrientation.Azimuth + ", El = " + NextObjectiveOrientation.Elevation);
                            InterruptAppointmentFlag = true;
                            break;
                        }

                        logger.Info(Utilities.GetTimeStamp() + ": Moving to Next Objective: Az = " + NextObjectiveOrientation.Azimuth + ", El = " + NextObjectiveOrientation.Elevation);

                        MovementResult apptMovementResult = RTController.MoveRadioTelescopeToOrientation(NextObjectiveOrientation, MovementPriority.Appointment);

                        // If the movement result was anything other than success, it means the movement failed and something is wrong with
                        // the hardware.
                        // TODO: Talk to Todd about thresholds for this. (issue #388) Right now, it is cancelling the appointment if the movement
                        // returns back any single error. See the MovementResult enum for a list of the different errors.
                        if (apptMovementResult != MovementResult.Success)
                        {
                            logger.Info($"{Utilities.GetTimeStamp()}: Appointment movement FAILED with the following error message: {apptMovementResult.ToString()}");
                            InterruptAppointmentFlag = true;
                        }

                        if (InterruptAppointmentFlag)
                        {
                            break;
                        }

                        Thread.Sleep(100);

                        NextObjectiveOrientation = null;
                    }
                }
                else
                {
                    logger.Info(Utilities.GetTimeStamp() + ": Telescope stopped movement.");
                    i--;
                }
            }

            // Set email sender
            string emailSender = "*****@*****.**";

            if (InterruptAppointmentFlag)
            {
                logger.Info(Utilities.GetTimeStamp() + ": Interrupted appointment [" + NextAppointment.Id.ToString() + "] at " + DateTime.Now.ToString());
                NextAppointment._Status = AppointmentStatusEnum.CANCELED;
                DatabaseOperations.UpdateAppointment(NextAppointment);
                NextObjectiveOrientation = null;
                InterruptAppointmentFlag = false;

                // send message to appointment's user
                SNSMessage.sendMessage(NextAppointment.User, MessageTypeEnum.APPOINTMENT_CANCELLED);

                string subject = MessageTypeExtension.GetDescription(MessageTypeEnum.APPOINTMENT_CANCELLED);
                string text    = MessageTypeExtension.GetDescription(MessageTypeEnum.APPOINTMENT_CANCELLED);

                EmailNotifications.sendToUser(NextAppointment.User, subject, text, emailSender);
            }
            else
            {
                NextAppointment._Status = AppointmentStatusEnum.COMPLETED;
                DatabaseOperations.UpdateAppointment(NextAppointment);

                // send message to appointment's user
                SNSMessage.sendMessage(NextAppointment.User, MessageTypeEnum.APPOINTMENT_COMPLETION);

                // Gather up email data
                string subject        = MessageTypeExtension.GetDescription(MessageTypeEnum.APPOINTMENT_COMPLETION);
                string text           = MessageTypeExtension.GetDescription(MessageTypeEnum.APPOINTMENT_COMPLETION);
                string attachmentPath = "";

                string fname       = System.DateTime.Now.ToString("yyyyMMddHHmmss");
                string currentPath = AppDomain.CurrentDomain.BaseDirectory;

                List <RFData> data = (List <RFData>)NextAppointment.RFDatas;
                try
                {
                    attachmentPath = Path.Combine(currentPath, $"{fname}.csv");
                    DataToCSV.ExportToCSV(data, fname);
                }
                catch (Exception e)
                {
                    Console.Out.WriteLine($"Could not write data! Error: {e}");
                }

                EmailNotifications.sendToUser(NextAppointment.User, subject, text, emailSender, attachmentPath, true);

                // Clean up after yourself, otherwise you'll just fill up our storage space
                DataToCSV.DeleteCSVFileWhenDone(attachmentPath);
            }
        }
示例#12
0
        private void SpinRoutine()
        {
            bool KeepAlive = KeepThreadAlive;

            while (KeepAlive)
            {
                NextAppointment = WaitForNextAppointment();

                //Compares the ID of each appointment to see if they have changed
                if (NextAppointment != null && NextAppointment.Equals(OldAppointment))
                {
                    logger.Info(Utilities.GetTimeStamp() + ": Waiting for next Appointment");
                }


                if (NextAppointment != null)
                {
                    logger.Info(Utilities.GetTimeStamp() + ": Starting appointment...");
                    endAppt = false;

                    // Calibrate telescope
                    if (NextAppointment._Type != AppointmentTypeEnum.FREE_CONTROL)
                    {
                        logger.Info(Utilities.GetTimeStamp() + ": Thermal Calibrating RadioTelescope");
                        RTController.ThermalCalibrateRadioTelescope(MovementPriority.Appointment);

                        // If the temperature is low and there's precipitation, dump the dish
                        if (RTController.RadioTelescope.WeatherStation.GetOutsideTemp() <= 40.00 && RTController.RadioTelescope.WeatherStation.GetTotalRain() > 0.00)
                        {
                            RTController.SnowDump(MovementPriority.Appointment);
                        }
                    }

                    // Create movement thread
                    Thread AppointmentMovementThread = new Thread(() => PerformRadioTelescopeMovement(NextAppointment))
                    {
                        Name = "RTControllerIntermediateThread (ID=" + RadioTelescopeID.ToString() + ")"
                    };

                    // Start SpectraCyber if the next appointment is NOT an appointment created by the control form
                    // This is to allow for greater control of the spectra cyber output from the control form
                    if (NextAppointment._Type != AppointmentTypeEnum.FREE_CONTROL)
                    {
                        StartReadingData(NextAppointment);
                    }

                    // Start movement thread
                    AppointmentMovementThread.Start();

                    if (NextAppointment._Type != AppointmentTypeEnum.FREE_CONTROL)
                    {
                        // End PLC thread & SpectraCyber
                        AppointmentMovementThread.Join();
                        StopReadingRFData();
                        // Stow Telescope
                        EndAppointment();
                    }
                    else
                    {
                        while (endAppt == false)
                        {
                            ;
                        }
                    }

                    logger.Info(Utilities.GetTimeStamp() + ": Appointment completed.");
                }
                else
                {
                    if (InterruptAppointmentFlag)
                    {
                        logger.Info(Utilities.GetTimeStamp() + ": Appointment interrupted in loading routine.");
                        ManagementMutex.WaitOne();
                        InterruptAppointmentFlag = false;
                        ManagementMutex.ReleaseMutex();
                    }

                    if (NextAppointment != null && NextAppointment.Equals(OldAppointment))
                    {
                        logger.Info(Utilities.GetTimeStamp() + ": Appointment does not have an orientation associated with it.");
                    }
                }

                KeepAlive = KeepThreadAlive;

                OldAppointment = NextAppointment;

                Thread.Sleep(100);
            }
        }
示例#13
0
 /// <summary>
 /// Ends an appointment by returning the RT to the stow position.
 /// </summary>
 public void EndAppointment()
 {
     logger.Info(Utilities.GetTimeStamp() + ": Ending Appointment");
     endAppt = true;
     RTController.MoveRadioTelescopeToOrientation(new Orientation(0, 90), MovementPriority.Appointment);
 }
示例#14
0
 /// <summary>
 /// Ends an appointment by returning the RT to the stow position.
 /// </summary>
 private void EndAppointment()
 {
     logger.Info("Ending Appointment");
     RTController.MoveRadioTelescopeToOrientation(new Orientation(0, 90));
 }
示例#15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     preurl = ConfigurationSettings.AppSettings.Get("urldata");
     width  = Request.QueryString["w"];
     lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]);
     id     = ConvertUtility.ToInt32(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         if (ConvertUtility.ToInt32(Request.QueryString["g"]) == 1)
         {
             txtSoDienThoaiTang.Focus();
         }
         //Detail
         DataTable dtDetail = RTController.GetRingToneDetailByIDHasCache(Session["telco"].ToString(), id);
         //end detail
         lnkCateChannel.NavigateUrl = UrlProcess.GetRingToneCategoryUrl(lang.ToString(), width, dtDetail.Rows[0]["W_RTCategoryID"].ToString());
         lnkHomeChannel.NavigateUrl = UrlProcess.GetRingToneHomeUrl(lang.ToString(), width);
         if (dtDetail.Rows.Count > 0)
         {
             price = ConfigurationSettings.AppSettings.Get("ringtoneprice");;
             if (lang == 1)
             {
                 lnkHomeChannel.Text = "NHẠC";
                 lnkCateChannel.Text = dtDetail.Rows[0]["Title_Unicode"].ToString().ToUpper();
                 ltrTenAnh.Text      = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                 ltrCasy.Text        = Resources.Resource.wCaSy + dtDetail.Rows[0]["ArtistNameUnicode"].ToString();
                 if (dtDetail.Rows[0]["AlbumNameUnicode"].ToString() != "unknown")
                 {
                     ltrNhom.Text = "Album: " + dtDetail.Rows[0]["AlbumNameUnicode"].ToString();
                 }
                 //ltrLuottai.Text = Resources.Resource.wLuotTai + dtDetail.Rows[0]["Download"].ToString().ToUpper();
                 ltrGiaTai.Text = Resources.Resource.wGiaTai + price + Resources.Resource.wDonViTien;
                 //ltrGiaTang.Text = Resources.Resource.wGiaTang + price + Resources.Resource.wDonViTien;
                 lnkTai.Text         = "<span class=\"bold\">" + Resources.Resource.wTaiVe + "</span>";
                 ltrGuiTang.Text     = Resources.Resource.wGuiTang;
                 ltrCungTheLoai.Text = Resources.Resource.rNhacCungTheLoai;
             }
             else
             {
                 lnkCateChannel.Text = dtDetail.Rows[0]["Title"].ToString().ToUpper();
                 ltrTenAnh.Text      = dtDetail.Rows[0]["SongName"].ToString();
                 ltrCasy.Text        = Resources.Resource.wCaSy_KD + dtDetail.Rows[0]["ArtistName"].ToString();
                 if (dtDetail.Rows[0]["AlbumName"].ToString() != "unknown")
                 {
                     ltrNhom.Text = "Album: " + dtDetail.Rows[0]["AlbumName"].ToString();
                 }
                 //ltrLuottai.Text = Resources.Resource.wLuotTai_KD + dtDetail.Rows[0]["Download"].ToString().ToUpper();
                 ltrGiaTai.Text = Resources.Resource.wGiaTai_KD + price + Resources.Resource.wDonViTien_KD;
                 //ltrGiaTang.Text = Resources.Resource.wGiaTang_KD + price + Resources.Resource.wDonViTien_KD;
                 lnkTai.Text         = "<span class=\"bold\">" + Resources.Resource.wTaiVe_KD + "</span>";
                 ltrGuiTang.Text     = Resources.Resource.wGuiTang_KD;
                 ltrCungTheLoai.Text = Resources.Resource.rNhacCungTheLoai_KD;
             }
             lnkTai.NavigateUrl = "../Download.aspx?id=" + dtDetail.Rows[0]["W_RTItemID"].ToString() + "&lang=" + lang + "&w=" + width;
             //Other
             if (!string.IsNullOrEmpty(Request.QueryString["tpage"]))
             {
                 tpage = ConvertUtility.ToInt32(Request.QueryString["tpage"]);
             }
             int       totaltopdownload = 0;
             DataTable dtltopdownload   = RTController.GetAllRingToneByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), ConvertUtility.ToInt32(dtDetail.Rows[0]["W_RTCategoryID"]), 0, pagesize, tpage, out totaltopdownload);
             rptCungTheLoai.DataSource     = dtltopdownload;
             rptCungTheLoai.ItemDataBound += new RepeaterItemEventHandler(rptTopdownload_ItemDataBound);
             rptCungTheLoai.DataBind();
             Paging1.totalrecord  = totaltopdownload;
             Paging1.pagesize     = pagesize;
             Paging1.numberpage   = pagenumber;
             Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&id=" + Request.QueryString["id"];
             Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&id=" + Request.QueryString["id"] + "&tpage=";
         }
     }
 }
示例#16
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;
            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = RTController.GetRingToneDetailByIDHasCache(Session["telco"].ToString(), id);

            chitietGiaodich = "Nhạc: " + dtDetail.Rows[0]["SongNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            if (thuchien)
            {
                DataTable dtKhuyenMai = RTController.GetRingToneDetailRandom(Session["telco"].ToString(), id);
                string    khuyenmaiID = ConvertUtility.ToString(dtKhuyenMai.Rows[0]["W_RTItemID"]);
                lnkKhuyenMai.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", khuyenmaiID, SecurityMethod.MD5Encrypt(khuyenmaiID));
                if (lang == "1")
                {
                    ltrTieuDe.Text    = linkStr;
                    lblTen.Text       = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkDownload.Text  = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text   = Resources.Resource.wMuaThanhCong + " bản nhạc " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkKhuyenMai.Text = "Nhạc tặng: " + dtKhuyenMai.Rows[0]["SongNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text    = linkStr_KD;
                    lblTen.Text       = dtDetail.Rows[0]["SongName"].ToString();
                    lnkDownload.Text  = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text   = Resources.Resource.wMuaThanhCong_KD + " ban nhac " + dtDetail.Rows[0]["SongName"].ToString();
                    lnkKhuyenMai.Text = "Nhac tang: " + dtKhuyenMai.Rows[0]["SongName"].ToString();
                };
                lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));

                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 2);
                RTController.SetDownloadCounter(Session["telco"].ToString(), id);
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = linkStr + " » " + Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 2, messageReturn);

                //--Thông báo lỗi thanh toán
            }
            //log charging
            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN:" + Session["msisdn"].ToString());
            logger.Debug("Dich vu: Nhac chuong - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["SongName"].ToString() + " - id: " + id);
            logger.Debug("Nhac chuong Url:" + lnkDownload.NavigateUrl);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            price      = ConfigurationSettings.AppSettings.Get("ringtoneprice");
            lang       = Request.QueryString["lang"];
            width      = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id         = ConvertUtility.ToInt32(Request.QueryString["id"]);
            SoDT       = Request.QueryString["sdt"];
            telCo      = Session["telco"].ToString();
            linkStr    = "<a href=\"../" + UrlProcess.GetRingToneHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >NHẠC<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetRingToneHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >NHAC<a>";

            if (!IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                //Nếu số điện thoại không hợp lệ thì hướng dẫn
                if (!MobileUtils.IsMobileNumber(SoDT))
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = Resources.Resource.wSoDienThoaiKhongHopLe;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = Resources.Resource.wSoDienThoaiKhongHopLe_KD;
                    }
                    return;
                }

                DataTable dtDetail = RTController.GetRingToneDetailByID(Session["telco"].ToString(), id);
                if (telCo == Constant.T_Mobifone)
                {
                    Session["soguitang"] = SoDT;
                    string content = Session["cpid"].ToString() + "&" + Constant.nhacchuong + id.ToString() + "&" + price + "&" + Session["transactionid"].ToString();
                    Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                }
                //
                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("ringtonecode") + " " + dtDetail.Rows[0]["Code"].ToString() + " " + SoDT + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("ringtonecommandcode") + "</b> để gửi tặng bản nhạc <b>" + dtDetail.Rows[0]["SongNameUnicode"].ToString() + "</b>" + Resources.Resource.wChon3G;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("ringtonecode") + " " + dtDetail.Rows[0]["Code"].ToString() + " " + SoDT + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("ringtonecommandcode") + "</b> de gui tang ban nhac <b>" + dtDetail.Rows[0]["SongName"].ToString() + "</b>" + Resources.Resource.wChon3G_KD;
                    }
                }
                else
                {
                    pnlThongBao.Visible = true;
                    if (lang == "1")
                    {
                        ltrTitle.Text = linkStr + " » " + Resources.Resource.wThongBao;
                        //ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu.Replace("xxx", price);
                        ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu + "nhạc chuông " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                        btnCo.Text       = Resources.Resource.btnCo;
                        btnKhong.Text    = Resources.Resource.btnKhong;
                    }
                    else
                    {
                        ltrTitle.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                        //ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu_KD.Replace("xxx", price);
                        ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu_KD + "nhac chuong " + dtDetail.Rows[0]["SongName"].ToString();
                        btnCo.Text       = Resources.Resource.btnCo_KD;
                        btnKhong.Text    = Resources.Resource.btnKhong_KD;
                    }
                }
            }
        }
示例#18
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = RTController.GetRingToneDetailByID(Session["telco"].ToString(), id);

            chitietGiaodich = "Nhạc: " + dtDetail.Rows[0]["SongNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            SoDT            = MobileUtils.ToSTDMobileNumber(SoDT);
            if (thuchien)
            {
                DataTable dtKhuyenMai = RTController.GetRingToneDetailRandom(Session["telco"].ToString(), id);
                string    khuyenmaiID = ConvertUtility.ToString(dtKhuyenMai.Rows[0]["W_RTItemID"]);
                lnkKhuyenMai.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", khuyenmaiID, SecurityMethod.MD5Encrypt(khuyenmaiID));
                if (lang == "1")
                {
                    ltrTieuDe.Text = linkStr;
                    lblTen.Text    = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text   = Resources.Resource.wTangThanhCong + " bản nhạc " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkKhuyenMai.Text = "Nhạc tặng: " + dtKhuyenMai.Rows[0]["SongNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text = linkStr_KD;
                    lblTen.Text    = dtDetail.Rows[0]["SongName"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text   = Resources.Resource.wTangThanhCong_KD + " ban nhac " + dtDetail.Rows[0]["SongName"].ToString();
                    lnkKhuyenMai.Text = "Nhac tang: " + dtKhuyenMai.Rows[0]["SongName"].ToString();
                };
                string url    = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                MTInfo mtInfo = new MTInfo();
                Random random = new Random();
                //Thông báo cho người được tặng
                mtInfo.User_ID       = SoDT;
                mtInfo.Service_ID    = ConfigurationSettings.AppSettings.Get("ringtonecommandcode");
                mtInfo.Command_Code  = ConfigurationSettings.AppSettings.Get("ringtonecode");
                mtInfo.Message_Type  = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtInfo.Total_Message = 1;
                mtInfo.Message_Index = 0;
                mtInfo.IsMore        = 0;
                mtInfo.Content_Type  = 0;
                mtInfo.Message_Type  = (int)Constant.MessageType.FREE;
                mtInfo.Message       = "Ban nhan duoc qua tang nhac chuong " + dtDetail.Rows[0]["Code"].ToString() + " tu so dien thoai " + "0" + Session["msisdn"].ToString().Remove(0, 2);
                MTController.SMS_MTInsert(mtInfo);

                //MT thong bao cho nguoi gui tang biet
                mtInfo.Content_Type = 0;
                mtInfo.User_ID      = Session["msisdn"].ToString();
                mtInfo.Message      = "Ban da gui tang thanh cong nhac chuong " + dtDetail.Rows[0]["Code"].ToString() + " toi so dt " + SoDT;
                mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                MTController.SMS_MTInsert(mtInfo);

                //Build waplink send to customer and insert to MT table
                mtInfo.User_ID      = SoDT;
                mtInfo.Message      = "Tai nhac chuong duoc tang theo dia chi: " + url;
                mtInfo.Content_Type = 8;
                mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                MTController.SMS_MTInsert(mtInfo);

                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 2);
                RTController.SetDownloadCounter(Session["telco"].ToString(), id);
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = linkStr + " » " + Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 2, messageReturn);
                //--Thông báo lỗi thanh toán
            }
            //log charging
            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN: " + Session["msisdn"].ToString());
            logger.Debug("So gui tang: " + SoDT);
            logger.Debug("Dich vu: Nhac chuong - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["SongName"].ToString() + " - id: " + id);
            logger.Debug("Nhac chuong Url:" + lnkDownload.NavigateUrl);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
示例#19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["LastPage"] = Request.RawUrl;
            lang = Request.QueryString["lang"];
            if (!IsPostBack)
            {
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";
                //
                var advertisement = new Advertisement {
                    Channel = "Home", Position = "HomeCenter", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds.Text = advertisement.GetAds();

                var advertisement1 = new Advertisement {
                    Channel = "Home", Position = "UnderLinks", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds1.Text = advertisement1.GetAds();
            }
            if (string.IsNullOrEmpty(Request.QueryString["display"]))
            {
                display = "home";
            }
            else
            {
                display = Request.QueryString["display"];
            }

            string telCo = "Vietnamobile";
            string id    = Request.QueryString["id"];

            Literal title   = new Literal();
            Literal ltrEnd  = new Literal();
            Literal ltrEnd1 = new Literal();

            try
            {
                string wapHomeURL = "http://wap.vietnamobile.com.vn";


                DataTable dtMusic = RTController.GetAllWap_RingTone_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageId")));
                title.Text = "<style type=\"text/css\">body {font-family:Verdana, Arial, Helvetica; font-size:12px;} .mainmenu {display:block;width: 100%;background-color: #de60cb;color:#fff;text-align:center;line-height:25px;} .mainmenu a{color:#fff;} a:link, a:visited {text-decoration:none;}</style>";
                if (lang == "1")
                {
                    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chào mừng bạn đến với dịch vụ nhạc chuông  <b style=\"color:blue\">(Miễn Phí)</b> của Vietnamobile" + "</div>";
                }
                else
                {
                    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chao mung ban den voi dich vu nhac chuong  <b style=\"color:blue\">(Mien Phi)</b> cua Vietnamobile" + "</div>";
                }
                //title.Text += "<div style=\"padding-left:5px;margin:5px 0 5px 0;\">Click để tải:";
                plList.Controls.Add(title);

                Literal ltr = new Literal();
                ltr.Text = "<br />";
                plList.Controls.Add(ltr);
                foreach (DataRow row in dtMusic.Rows)
                {
                    string ringtonepath = row["Path"].ToString();
                    if (!string.IsNullOrEmpty(ringtonepath))
                    {
                        HyperLink lnkfile = new HyperLink();
                        ltr      = new Literal();
                        ltr.Text = "<img style=\"padding-left:10px\"  class=\"thumblist\" alt=\"thumb\" src=\"../img/b-ring.gif\">";
                        if (lang == "1")
                        {
                            lnkfile.Text = row["SongName"].ToString();
                        }
                        else
                        {
                            lnkfile.Text = UnicodeUtility.UnicodeToKoDau(row["SongName"].ToString());
                        }
                        string ext = ringtonepath.Split('.')[ringtonepath.Split('.').Length - 1];
                        lnkfile.NavigateUrl = "http://media.xzone.vn/" + ringtonepath.Replace("~/", "");
                        lnkfile.Attributes.Add("style", "color:#006CBF;padding-left:15px;padding-top:3px;padding-bottom:3px;display:block");
                        lnkfile.Attributes.Add("class", "bold");
                        plList.Controls.Add(ltr);
                        plList.Controls.Add(lnkfile);
                        ltr      = new Literal();
                        ltr.Text = "<div class=\"clearfix\"></div>";
                        plList.Controls.Add(ltr);
                    }
                }
                //Khuyen mai
                //ltrEnd1.Text = "</div><div style=\"border-bottom: 1px solid #790083;height: 7px; margin: 5px 0 10px 0; width: 100%;\"></div>";

                ltrEnd1.Text = "</div><div style=\"height: 7px; margin: 5px 0 0px 0; width: 100%;\"></div>";

                ltrEnd.Text += "<div style=\"background-color: #EA6A00;  color: #FFFFFF;  display: block;  line-height: 25px; text-align: center; width: 100%;\">";
                //ltrEnd.Text += "<a style=\"color:#fff\" href=\"" + wapHomeURL + "\">Trang chủ</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Game/Default.aspx?lang=1&display=home&hotro=0\">Game</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Music/Default.aspx?lang=1&display=home\">Nhạc</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Thethao/Default.aspx?lang=1&display=home\">Bóng đá</a></div>";
                plList.Controls.Add(ltrEnd);
                plList.Controls.Add(ltrEnd1);
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang = Request.QueryString["lang"];
            if (string.IsNullOrEmpty(lang))
            {
                Response.Redirect("/Music/NhacHot.aspx?w=320&lang=1");
            }

            Session["LastPage"] = Request.RawUrl;

            if (!IsPostBack)
            {
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";
                //
                var advertisement = new Advertisement {
                    Channel = "Home", Position = "HomeCenter", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds.Text = advertisement.GetAds();

                var advertisement1 = new Advertisement {
                    Channel = "Home", Position = "UnderLinks", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds1.Text = advertisement1.GetAds();

                #region TU DONG DK SUB NHACCHUONG

                if (!Page.IsPostBack)
                {
                    if (Session["msisdn"] == null)
                    {
                        int    is3g;
                        string msisdn = MobileUtils.GetMSISDN(out is3g);
                        if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                        {
                            Session["telco"]  = Constant.T_Vietnamobile;
                            Session["msisdn"] = msisdn;
                        }
                        else
                        {
                            Session["msisdn"] = null;
                            Session["telco"]  = Constant.T_Undefined;
                        }
                    }

                    //string url = UrlProcess.GetMusicHomeUrl("1", "320");
                    if (Session["msisdn"] != null)
                    {
                        string   value = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", "DK NC");//ANDY Service S2_94x
                        string[] res   = value.Split('|');
                        if (res.Length > 0)
                        {
                            if (res[0] == "1")//DK THANH CONG
                            {
                                pnlThongBao.Visible = true;
                            }
                        }
                    }
                }

                #endregion
            }
            if (string.IsNullOrEmpty(Request.QueryString["display"]))
            {
                display = "home";
            }
            else
            {
                display = Request.QueryString["display"];
            }

            //string telCo = "Vietnamobile";
            //string id = Request.QueryString["id"];

            Literal title   = new Literal();
            Literal ltrEnd  = new Literal();
            Literal ltrEnd1 = new Literal();
            try
            {
                //string wapHomeURL = "http://wap.vietnamobile.com.vn";


                DataTable dtMusic = RTController.GetAllWap_RingTone_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageId")));
                title.Text = "<style type=\"text/css\">body {font-family:Verdana, Arial, Helvetica; font-size:12px;} .mainmenu {display:block;width: 100%;background-color: #de60cb;color:#fff;text-align:center;line-height:25px;} .mainmenu a{color:#fff;} a:link, a:visited {text-decoration:none;}</style>";
                if (lang == "1")
                {
                    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chào mừng bạn đến với dịch vụ nhạc chuông  <b style=\"color:blue\">(Miễn Phí)</b> của Vietnamobile" + "</div>";
                }
                else
                {
                    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chao mung ban den voi dich vu nhac chuong  <b style=\"color:blue\">(Mien Phi)</b> cua Vietnamobile" + "</div>";
                }

                plList.Controls.Add(title);

                Literal ltr = new Literal();
                ltr.Text = "<br />";
                plList.Controls.Add(ltr);
                foreach (DataRow row in dtMusic.Rows)
                {
                    string ringtonepath = row["Path"].ToString();
                    if (!string.IsNullOrEmpty(ringtonepath))
                    {
                        HyperLink lnkfile = new HyperLink();
                        ltr      = new Literal();
                        ltr.Text = "<img style=\"padding-left:10px\"  class=\"thumblist\" alt=\"thumb\" src=\"../img/b-ring.gif\">";
                        if (lang == "1")
                        {
                            lnkfile.Text = row["SongName"].ToString();
                        }
                        else
                        {
                            lnkfile.Text = UnicodeUtility.UnicodeToKoDau(row["SongName"].ToString());
                        }
                        string ext = ringtonepath.Split('.')[ringtonepath.Split('.').Length - 1];
                        lnkfile.NavigateUrl = "http://media.xzone.vn/" + ringtonepath.Replace("~/", "");
                        lnkfile.Attributes.Add("style", "color:#006CBF;padding-left:15px;padding-top:3px;padding-bottom:3px;display:block");
                        lnkfile.Attributes.Add("class", "bold");
                        plList.Controls.Add(ltr);
                        plList.Controls.Add(lnkfile);
                        ltr      = new Literal();
                        ltr.Text = "<div class=\"clearfix\"></div>";
                        plList.Controls.Add(ltr);
                    }
                }

                ltrEnd1.Text = "</div><div style=\"height: 7px; margin: 5px 0 0px 0; width: 100%;\"></div>";

                ltrEnd.Text += "<div style=\"background-color: #EA6A00;  color: #FFFFFF;  display: block;  line-height: 25px; text-align: center; width: 100%;\">";
                plList.Controls.Add(ltrEnd);
                plList.Controls.Add(ltrEnd1);
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
示例#21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            price      = ConfigurationSettings.AppSettings.Get("ringtoneprice");
            lang       = Request.QueryString["lang"];
            width      = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id         = ConvertUtility.ToInt32(Request.QueryString["id"]);
            telCo      = Session["telco"].ToString();
            linkStr    = "<a href=\"../" + UrlProcess.GetRingToneHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >NHẠC<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetRingToneHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >NHAC<a>";

            if (!IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";
                if (Session["transactionid_old"] != null)
                {// Nếu có transactionid_old >> thuê bao mobifone đã thực hiện thanh toán
                    messageReturn = ConvertUtility.ToString(Session["debit_status"]);
                    if (ConvertUtility.ToString(Session["debit_status"]) == "0")
                    {// Thanh toán thành công >> trả nội dung
                        HienThiNoiDung(true);
                    }
                    else
                    {// Thanh toán không thành công >> thông báo lỗi
                        HienThiNoiDung(false);
                    }
                    Session["transactionid_old"] = null;
                }
                else
                {
                    DataTable dtDetail = RTController.GetRingToneDetailByIDHasCache(Session["telco"].ToString(), id);
                    if (telCo == Constant.T_Mobifone)
                    {
                        string content = Session["cpid"].ToString() + "&" + Constant.nhacchuong + id.ToString() + "&" + price + "&" + Session["transactionid"].ToString();
                        Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                    }
                    //
                    if (telCo == "Undefined")
                    {
                        pnlSMS.Visible = true;
                        if (lang == "1")
                        {
                            ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                            ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("ringtonecode") + " " + dtDetail.Rows[0]["Code"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("ringtonecommandcode") + "</b> để tải bản nhạc <b>" + dtDetail.Rows[0]["SongNameUnicode"].ToString() + "</b> về máy" + Resources.Resource.wChon3G;
                        }
                        else
                        {
                            ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                            ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("ringtonecode") + " " + dtDetail.Rows[0]["Code"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("ringtonecommandcode") + "</b> de tai ban nhac <b>" + dtDetail.Rows[0]["SongName"].ToString() + "</b> ve may" + Resources.Resource.wChon3G_KD;
                        }
                    }
                    else
                    {
                        pnlThongBao.Visible = true;
                        if (lang == "1")
                        {
                            ltrTitle.Text = linkStr + " » " + Resources.Resource.wThongBao;
                            //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu.Replace("xxx", price);
                            ltrThongBao.Text = Resources.Resource.wXacNhanDichVu + "nhạc chuông " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                            btnCo.Text       = Resources.Resource.btnCo;
                            btnKhong.Text    = Resources.Resource.btnKhong;
                        }
                        else
                        {
                            ltrTitle.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                            //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD.Replace("xxx", price);
                            ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD + "nhac chuong " + dtDetail.Rows[0]["SongName"].ToString();
                            btnCo.Text       = Resources.Resource.btnCo_KD;
                            btnKhong.Text    = Resources.Resource.btnKhong_KD;
                        }
                    }
                }
            }
        }
示例#22
0
        /// <summary>
        /// Starts movement of the RT by updating the appointment status and
        /// then calling the RT controller to move the RT to the orientation
        /// it needs to go to.
        /// </summary>
        /// <param name="NextAppointment"> The appointment that is currently running. </param>
        private void PerformRadioTelescopeMovement(Appointment NextAppointment)
        {
            NextAppointment.Status = AppointmentStatusEnum.IN_PROGRESS;
            DatabaseOperations.UpdateAppointment(NextAppointment);

            logger.Info("Appointment Type: " + NextAppointment.Type);

            // Loop through each second or minute of the appointment (depending on appt type)
            TimeSpan length   = NextAppointment.EndTime - NextAppointment.StartTime;
            double   duration = NextAppointment.Type == AppointmentTypeEnum.FREE_CONTROL ? length.TotalSeconds : length.TotalMinutes;

            for (int i = 0; i <= (int)duration; i++)
            {
                // Get orientation for current datetime
                DateTime datetime = NextAppointment.Type == AppointmentTypeEnum.FREE_CONTROL ? NextAppointment.StartTime.AddSeconds(i) : NextAppointment.StartTime.AddMinutes(i);
                NextObjectiveOrientation = RTController.CoordinateController.CalculateOrientation(NextAppointment, datetime);

                // Wait for datetime
                while (DateTime.UtcNow < datetime)
                {
                    if (InterruptAppointmentFlag)
                    {
                        logger.Info("Interrupted appointment [" + NextAppointment.Id.ToString() + "] at " + DateTime.Now.ToString());
                        break;
                    }

                    //logger.Debug(datetime.ToString() + " vs. " + DateTime.UtcNow.ToString());
                    Thread.Sleep(1000);
                }

                if (InterruptAppointmentFlag)
                {
                    break;
                }

                // Move to orientation
                if (NextObjectiveOrientation != null)
                {
                    if (NextObjectiveOrientation.Azimuth < 0 || NextObjectiveOrientation.Elevation < 0)
                    {
                        logger.Warn("Invalid Appt: Az = " + NextObjectiveOrientation.Azimuth + ", El = " + NextObjectiveOrientation.Elevation);
                        InterruptAppointmentFlag = true;
                        break;
                    }

                    logger.Info("Moving to Next Objective: Az = " + NextObjectiveOrientation.Azimuth + ", El = " + NextObjectiveOrientation.Elevation);
                    RTController.MoveRadioTelescopeToOrientation(NextObjectiveOrientation);

                    // Wait until telescope reaches destination
                    Orientation currentOrientation;
                    do
                    {
                        if (InterruptAppointmentFlag)
                        {
                            break;
                        }

                        //currentOrientation = RTController.GetCurrentOrientation();
                        //logger.Info("Progress Towards Objective: Az = " + currentOrientation.Azimuth + ", El = " + currentOrientation.Elevation);
                        Thread.Sleep(100);
                    }while (!RTController.finished_exicuting_move());

                    NextObjectiveOrientation = null;
                }
            }

            if (InterruptAppointmentFlag)
            {
                logger.Info("Interrupted appointment [" + NextAppointment.Id.ToString() + "] at " + DateTime.Now.ToString());
                NextAppointment.Status = AppointmentStatusEnum.CANCELLED;
                DatabaseOperations.UpdateAppointment(NextAppointment);
                NextObjectiveOrientation = null;
                InterruptAppointmentFlag = false;
            }
            else
            {
                NextAppointment.Status = AppointmentStatusEnum.COMPLETED;
                DatabaseOperations.UpdateAppointment(NextAppointment);
            }

            DatabaseOperations.UpdateAppointment(NextAppointment);
        }