Наследование: MonoBehaviour
Пример #1
0
    private void Awake()
    {
        // Master
        MasterView viewMaster = Instantiate( masterView );
        viewMaster.Initialize( gameSetting.masterSetting );
        Master master = new Master( viewMaster );
        MasterAIControl masterControl = new MasterAIControl( master );

        // AI
        List<AIControl> AIControlList = new List<AIControl>();
        List<Character> AICharacter = new List<Character>();
        for ( int i = 0; i < AINumber; ++i )
        {
            CharacterView view = Instantiate( characterPrefab );
            view.Initialize( gameSetting.characterSetting );
            Character character = new Character( view );
            AIControl aiControl = new AIControl( gameSetting.AIControlSetting, character, master );
            AIControlList.Add( aiControl );
            AICharacter.Add( character );
        }

        // Player
        CharacterView playerView = Instantiate( characterPrefab );
        playerView.Initialize( gameSetting.characterSetting );
        Character player = new Character( playerView );
        PlayerControl playerControl = new PlayerControl( player, AICharacter );

        GameTime gameTime = new GameTime();
        controllerManager = new ControllerManager(playerControl, AIControlList, masterControl);
        gameManager = new GameManager( gameTime, controllerManager, player, AICharacter, master );

        successPanel.SetGameTime( gameTime );
    }
Пример #2
0
        public static void Main(string[] args)
        {
            string inputname = args[0];
            string outputname = args[1];

            string[] lines = File.ReadAllLines(inputname);

            int ncases = int.Parse(lines[0]);
            IList<string> results = new List<string>();
            Master master = new Master();

            for (int k = 0; k < ncases; k++)
            {
                int nline = k + 1;
                string line = lines[nline];
                IList<int> numbers = line.Trim().Split(' ').Select(s => int.Parse(s)).ToList();
                var solution = master.Solve(numbers[0], numbers[1], numbers[2]);

                results.Add(string.Format("Case #{0}:", k + 1));

                if (solution is IList<string>)
                {
                    var lns = (IList<string>)solution;

                    foreach (var ln in lns)
                        results.Add(ln);
                }
                else
                    results.Add(solution.ToString());
            }

            File.WriteAllLines(outputname, results.ToArray());
        }
Пример #3
0
 public bool DeleteMaster(Master master)
 {
     if (master == null) return false;
     _unitOfWork.MasterRepository.Delete(master);
     _unitOfWork.Save();
     return true;
 }
Пример #4
0
        public async Task MasterElectionIntegrationTest()
        {
            var nodeA = new Master("A", 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(10));
            var nodeB = new Master("B", 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(10));
            var nodeC = new Master("C", 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(10));
            Link(nodeA, nodeB, nodeC);
            var A = nodeA.GetMaster();
            var B = nodeB.GetMaster();
            var C = nodeC.GetMaster();
            await A; await B; await C;
            //sometimes two different masters get elected for the first two rounds
            //when two nodes startup very close together so wait until we've checked
            //the master a second time
            A = nodeA.GetMaster();
            B = nodeB.GetMaster();
            C = nodeC.GetMaster();
            Assert.AreEqual(await A, await B);
            Assert.AreEqual(await B, await C);

            var master = await A;

            DateTime start = DateTime.UtcNow;
            while (DateTime.UtcNow.Subtract(start) < TimeSpan.FromSeconds(30))
            {
                await Task.Delay(200);
                MastersLive(master, nodeA, nodeB, nodeC);
                Console.WriteLine("Correct At: " + DateTime.UtcNow.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ssK"));
            }
        }
Пример #5
0
 public Tower(int type, Vector3 position, Master master)
 {
     this.type = type;
     this.loader = master.towerLoader;
     this.upgradeLevel = 0;
     GameObject test = loader.towerMapping[type];
     this.gameObject = (GameObject) GameObject.Instantiate(test, position, new Quaternion());
 }
Пример #6
0
 /// <summary>
 /// Изменяет данные объекта класса Запись
 /// </summary>
 /// <param name="date">Дата исполнения услуги</param>
 /// <param name="service">Исполняемая услуга</param>
 /// <param name="master">Мастер, исполняющий услугу</param>
 /// <param name="client">Клиент, использующий услугу</param>
 public void change(Service service, Master master, Client client, DateTime day, int hour)
 {
     this.service = service;
     this.master = master;
     this.client = client;
     this.day = day;
     this.hour = hour;
 }
Пример #7
0
 public MasterForm(MainForm mainForm, bool edit, Master master)
 {
     InitializeComponent();
     serviceNames = new List<String>();
     this.mainController = mainForm.mainController;
     this.edit = edit;
     inputMaster = master;
 }
Пример #8
0
 private static void LoopMasterShape(Master master)
 {
     foreach (Shape shp in master.Shapes)
     {
         RenameShape(shp);
         DeleteText(shp);
     }
 }
Пример #9
0
    // Use this for initialization
    protected void init()
    {
        this.master = GameObject.FindGameObjectWithTag("GameController").GetComponent<Master>();
        this._settings = this.gameObject.GetComponent<Settings>();

        this.useGUI = true;
        currentState = BaseMenuStates.Hidden;
    }
Пример #10
0
 public ShapeForm(Master master,Shape shape)
     : this()
 {
     this.shape = shape;
     this.txtShapeID.Text = "-1";
     this.txtShapeName.Text = master.Shapes[0].NameU;
     this.txtMasterName.Text = master.NameU;
     this.DisplaysShapeProperies(master.Shapes[0].XForm);
 }
Пример #11
0
 /// <summary>
 /// Создание записи в салоне
 /// </summary>
 /// <param name="date">дата записи</param>
 /// <param name="service">выбранная клиентом услуга</param>
 /// <param name="master">мастер</param>
 /// <param name="client">клиент</param>
 public Record addRecord(Service service, Master master, Client client, DateTime day, int hour)
 {
     Record newRecord = new Record(service, master, client, day, hour);
     recordList.Add(newRecord);
     service.linkRecord(newRecord);
     master.linkRecord(newRecord);
     client.linkRecord(newRecord);
     return newRecord;
 }
Пример #12
0
 void Awake()
 {
     if (master == null) {
         DontDestroyOnLoad(gameObject);
         master = this;
     } else if (master != this) {
         Destroy(gameObject);
     }
 }
Пример #13
0
 public Record(Service service, Master master, Client client, DateTime day, int hour)
 {
     this.service = service;
     this.master = master;
     this.client = client;
     status = false;
     this.day = day;
     this.hour = hour;
 }
        // Create master
        public static Master CreateMaster(int masterId, string name, string masterImage)
        {
            // Set master properties
            Master master = new Master();
            master.ID = masterId;
            master.Name = name;
            master.IconSize = IconSizeValue.Normal;
            master.AlignName = AlignNameValue.AlignTextCenter;
            master.MatchByName = BOOL.True;
            master.IconUpdate = BOOL.True;
            master.UniqueID = Guid.NewGuid();
            master.BaseID = Guid.NewGuid();
            master.PatternFlags = 1;
            master.Hidden = BOOL.False;

            // Set master's shape properties
            Shape shape = new Shape();
            master.Shapes.Add(shape);

            double width = 0.5443889263424177;
            double height = 0.432916947568133;
            shape.ID = 5;
            shape.Type = TypeValue.Foreign;
            shape.XForm.PinX.Value = 0.2221944631712089;
            shape.XForm.PinY.Value = 0.1666458473784065;
            shape.XForm.Width.Value = width;
            shape.XForm.Height.Value = height;
            shape.XForm.LocPinX.Ufe.F = "Width*0.5";
            shape.XForm.LocPinY.Ufe.F = "Height*0.5";
            shape.XForm.ResizeMode.Value = 0;
            shape.TextXForm.TxtPinY.Ufe.F = "-TxtHeight/2";
            shape.TextXForm.TxtWidth.Ufe.F = "TEXTWIDTH(TheText)";
            shape.TextXForm.TxtHeight.Ufe.F = "TEXTHEIGHT(TheText, TxtWidth)";

            // Set connection properties
            Connection connection = new Connection();
            shape.Connections.Add(connection);

            connection.ID = 1;
            connection.NameU = "All";
            connection.X.Value = 0.22;
            connection.X.Ufe.F = "Width*0.5";
            connection.Y.Value = 0.16;
            connection.Y.Ufe.F = "Height*0.5";
            connection.DirX.Value = 0;
            connection.DirY.Value = 0;
            connection.Type.Value = 0;
            connection.AutoGen.Value = BOOL.False;
            connection.Prompt.Ufe.F = "No Formula";

            shape.ForeignData.ForeignType = ForeignType.Bitmap;
            shape.ForeignData.CompressionType = CompressionType.PNG;
            shape.ForeignData.Value = ReadImageFile(masterImage); // EncodedImage.getBytes();

            return master;
        }
Пример #15
0
    public GameManager( GameTime gameTime, ControllerManager controllerManager, Character player, List<Character> aiCharacterList, Master master )
    {
        this.gameTime = gameTime;
        this.controllerManager = controllerManager;
        this.player = player;
        this.aiCharacterList = aiCharacterList;
        this.master = master;

        remainAINumber = aiCharacterList.Count;
    }
Пример #16
0
Файл: Part.cs Проект: nanase/ux
        /// <summary>
        /// パートの属するマスタークラスを指定して新しい Part クラスのインスタンスを初期化します。
        /// </summary>
        /// <param name="master">このパートが属するマスタークラス。</param>
        public Part(Master master)
        {
            this.envelope = new Envelope(master.SamplingFreq);
            this.buffer = new float[0];
            this.Reset();

            this.ExtendBuffers(0);
            this.SampleDeltaTime = 1.0 / master.SamplingFreq;
            this.master = master;
        }
Пример #17
0
	// Use this for initialization
	void Awake () {
        get = this;
        master = new Master();
        user = SaveDataJsonUtility.Load<User>("savedata");
        master.LoadData();
        foreach(var i in master.Characters.list)
        {
            Debug.Log(i.name);
        }
	}
Пример #18
0
        public static void Main(string[] args)
        {
            //use ROS remapping spec for setting uri by command line
            for (int i = 0; i < args.Length; i++)
                if (args[i].Contains(":=")) {
                    string[] chunks = args[i].Split(new[]{":="},StringSplitOptions.RemoveEmptyEntries);
                    if (chunks.Length == 2)
                        switch (chunks[0]) {
                            case "__master": ROS.ROS_MASTER_URI = chunks[1].Trim(); break;
                            case "__hostname": ROS.ROS_HOSTNAME = chunks[1].Trim(); break;
                        }
                }

            //if wasn't passed in with __master:=_______, then check environment variable
            if (string.IsNullOrEmpty(ROS.ROS_MASTER_URI))
            {
                IDictionary _vars;

                //check user env first, then machine if user doesn't have uri defined.
                if ((_vars = Environment.GetEnvironmentVariables(EnvironmentVariableTarget.User)).Contains("ROS_MASTER_URI")
                    || (_vars = Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Machine)).Contains("ROS_MASTER_URI"))
                    ROS.ROS_MASTER_URI = (string)_vars["ROS_MASTER_URI"];
                else
                    //apparently it's not defined, so take a shot in the dark.
                    ROS.ROS_MASTER_URI = "http://localhost:11311";
            }

            if (string.IsNullOrEmpty(ROS.ROS_HOSTNAME))
            {
                IDictionary _vars;

                //check user env first, then machine if user doesn't have uri defined.
                if ((_vars = Environment.GetEnvironmentVariables(EnvironmentVariableTarget.User)).Contains("ROS_HOSTNAME")
                    || (_vars = Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Machine)).Contains("ROS_HOSTNAME"))
                    ROS.ROS_HOSTNAME = (string)_vars["ROS_HOSTNAME"];
                else
                    //apparently it's not defined, so take a shot in the dark.
                    ROS.ROS_HOSTNAME = "localhost";
            }

            Console.WriteLine("RosMaster initializing...");
            Console.WriteLine("ROS_MASTER_URI = "+ROS.ROS_MASTER_URI);
            Console.WriteLine("ROS_HOSTNAME = " + ROS.ROS_HOSTNAME);

            Master master = new Master();
            master.start();

            while (master.ok())
            {
                Thread.Sleep(10);
            }

            master.stop();
        }
Пример #19
0
 public async Task TestMasterElection()
 {
     var nodeA = new Master("A", 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(20));
     var nodeB = new Master("B", 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(20));
     var nodeC = new Master("C", 3, TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(20));
     Link(nodeA, nodeB, nodeC);
     var A = nodeA.GetMaster();
     var B = nodeB.GetMaster();
     var C = nodeC.GetMaster();
     Assert.AreEqual(await A, await B);
     Assert.AreEqual(await B, await C);
     MastersMatch(nodeA, nodeB, nodeC);
 }
Пример #20
0
        public B*****b(Master master, Slave slave)
        {
            Punish = new PunishMulti();
            Master = master;
            History = new List<PartName>();
            BlowJobType = Master.Personality.BlowJobType;
            SucksLeft = BlowJobType.Sucks.Value;
            if (BlowJobType.Rest.Have)
                SucksLeftToRest = BlowJobType.Rest.SuckToRest.Value;

            if (BlowJobType.Behavior != null)
                BlowJobType.Behavior.B*****b = this;
            Punish = BlowJobType.Punish;
        }
Пример #21
0
 void Start()
 {
     master = Master.instance;
     controlable = true;
     switch(planeAxes)
     {
     case Axes.XY:
         plane = new Plane(Vector3.forward, 0);
         break;
     case Axes.XZ:
         plane = new Plane(Vector3.up, 0);
         break;
     }
 }
Пример #22
0
        public void SolveImpossibleCases()
        {
            Master master = new Master();

            Assert.AreEqual("Impossible", master.Solve(2, 1, 1));
            Assert.AreEqual("Impossible", master.Solve(5, 5, 23));
            Assert.AreEqual("Impossible", master.Solve(2, 2, 1));
            Assert.AreEqual("Impossible", master.Solve(2, 10, 1));
            Assert.AreEqual("Impossible", master.Solve(10, 2, 1));

            Assert.AreNotEqual("Impossible", master.Solve(4, 7, 3));
            Assert.AreNotEqual("Impossible", master.Solve(3, 1, 1));
            Assert.AreNotEqual("Impossible", master.Solve(5, 3, 2));
        }
Пример #23
0
 void Awake()
 {
     Get = this;
     master = new Master();
     Resource = transform.FindChild("ResourceManager").GetComponent<ResourceManager>();
     Resource.Initialize();
     
     user = SaveDataJsonUtility.Load<User>("savedata");
     master.LoadData();
     if(user== null)
     {
         user = new User(new List<Character>(), 0);
     }
     SaveDataJsonUtility.Save<User>(user, "savedata");
 }
        public static IJedi CreateJedi(string name)
        {
            char type = name[0];
            Jedi jedi;

            switch (type)
            {
                case 'm': jedi = new Master(name); break;
                case 'k': jedi = new Knight(name); break;
                case 'p': jedi = new Padawan(name); break;
                default: jedi = null; break;
            }

            return jedi;
        }
Пример #25
0
 void Awake()
 {
     if(_instance == null)
     {
         //If I am the first instance, make me the Singleton
         _instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         //If a Singleton already exists and you find
         //another reference in scene, destroy it!
         if(this != _instance)
             Destroy(this.gameObject);
     }
 }
Пример #26
0
        private void Submit_Click(object sender, EventArgs e)
        {
            DataTable dt;
            dt = db.Displaygrid("select * from LoginMaster where UserName='******' and Password='******'");
            if (dt.Rows.Count > 0)
            {
                this.Hide();
                Master m = new Master();
                m.Show();

            }
            else
            {
                db.message("Wrong Username and Password");
            }
        }
Пример #27
0
        public void SolveSampleCaseOne()
        {
            Master master = new Master();

            var result = master.Solve(3, 1, 1);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(IList<string>));

            var lines = (IList<string>)result;

            Assert.AreEqual(3, lines.Count);
            Assert.AreEqual("c", lines[0]);
            Assert.AreEqual(".", lines[1]);
            Assert.AreEqual("*", lines[2]);
        }
Пример #28
0
        public void SolveSampleCaseTwo()
        {
            Master master = new Master();

            var result = master.Solve(4, 7, 3);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(IList<string>));

            var lines = (IList<string>)result;

            Assert.AreEqual(4, lines.Count);
            Assert.AreEqual("c......", lines[0]);
            Assert.AreEqual(".......", lines[1]);
            Assert.AreEqual("......*", lines[2]);
            Assert.AreEqual(".....**", lines[3]);
        }
Пример #29
0
 protected override void OnRecordChanged(FormRecordUpdateEventArgs e)
 {
     base.OnRecordChanged(e);
         Master recordRow = new Master();
         switch (e.DataState)
         {
             case FormDataStates.New:
                 recordRow.Save();
                 break;
             case FormDataStates.Edited:
                 Master oldRecord = Master.FetchByID(recordRow.MasterID);
                 oldRecord.Name = recordRow.Name;
                 oldRecord.GroupID = recordRow.GroupID;
                 oldRecord.Note = recordRow.Note;
                 oldRecord.GroupID = recordRow.GroupID;
                 break;
             case FormDataStates.Deleted:
                 Master.Delete(recordRow.MasterID);
                 break;
         }
 }
Пример #30
0
 // Use this for initialization
 void Start()
 {
     master = Master.instance;
         //nameInputField.onSubmit.AddListener((value) => SubmitName(value));
     InputField[] components = GetComponentsInChildren<InputField>();
     x = components[0];
     y = components[1];
     z = components[2];
     x.onValueChange.AddListener((input) => setX(input));
     y.onValueChange.AddListener((input) => setY(input));
     z.onValueChange.AddListener((input) => setZ(input));
     /*
     Text[] components = new Text[3];
     for (int i=0; i < transform.childCount; i++) {
         components[i] = transform.GetChild(i).FindChild("Text").GetComponent<Text>();
     }
     x = components[0];
     y = components[1];
     z = components[2];
     Debug.Log (x.name + ", " + y + ", " + z);
     */
 }
Пример #31
0
        public override async Task <RepositoryResponse <bool> > SaveSubModelsAsync(MixPage parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
        {
            var result = new RepositoryResponse <bool> {
                IsSucceed = true
            };
            var saveTemplate = await View.SaveModelAsync(true, _context, _transaction);

            ViewModelHelper.HandleResult(saveTemplate, ref result);

            if (result.IsSucceed && Master != null)
            {
                var saveLayout = Master.SaveModel(true, _context, _transaction);
                ViewModelHelper.HandleResult(saveLayout, ref result);
            }
            if (result.IsSucceed && UrlAliases != null)
            {
                foreach (var item in UrlAliases)
                {
                    if (result.IsSucceed)
                    {
                        item.SourceId       = parent.Id.ToString();
                        item.Type           = UrlAliasType.Page;
                        item.Specificulture = Specificulture;
                        var saveResult = await item.SaveModelAsync(false, _context, _transaction);

                        ViewModelHelper.HandleResult(saveResult, ref result);
                    }
                    else
                    {
                        break;
                    }
                }
            }
            if (result.IsSucceed)
            {
                foreach (var item in ModuleNavs)
                {
                    item.PageId = parent.Id;

                    if (item.IsActived)
                    {
                        var saveResult = await item.SaveModelAsync(false, _context, _transaction);

                        ViewModelHelper.HandleResult(saveResult, ref result);
                    }
                    else
                    {
                        var saveResult = await item.RemoveModelAsync(false, _context, _transaction);

                        ViewModelHelper.HandleResult(saveResult, ref result);
                    }
                }
            }

            //if (result.IsSucceed)
            //{
            //    foreach (var item in ParentNavs)
            //    {
            //        item.Id = parent.Id;
            //        if (item.IsActived)
            //        {
            //            var saveResult = await item.SaveModelAsync(false, _context, _transaction);
            //            ViewModelHelper.HandleResult(saveResult, ref result);
            //        }
            //        else
            //        {
            //            var saveResult = await item.RemoveModelAsync(false, _context, _transaction);
            //            ViewModelHelper.HandleResult(saveResult, ref result);
            //        }
            //    }
            //}

            if (result.IsSucceed)
            {
                // Save Attributes
                result = await SaveAttributeAsync(parent.Id, _context, _transaction);
            }
            //if (result.IsSucceed)
            //{
            //    foreach (var item in ChildNavs)
            //    {
            //        item.ParentId = parent.Id;
            //        if (item.IsActived)
            //        {
            //            var saveResult = await item.SaveModelAsync(false, _context, _transaction);
            //            ViewModelHelper.HandleResult(saveResult, ref result);
            //        }
            //        else
            //        {
            //            var saveResult = await item.RemoveModelAsync(false, _context, _transaction);
            //            ViewModelHelper.HandleResult(saveResult, ref result);
            //        }
            //    }
            //}
            return(result);
        }
Пример #32
0
 protected void UrlRootInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralUrlRoot", "PxWebAdminFeaturesApiGeneralUrlRootInfo");
 }
Пример #33
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Page.IsPostBack != true)
            {
                if (Session["AppUserName"] != "")
                {
                    AuthenticationManager Authentiaction = new AuthenticationManager();
                    if (Authentiaction.HasFunctionRight(ApplicationAccess.FacilitySetup, FunctionAccess.Add, (DataTable)Session["UserRight"]) == false &&
                        Authentiaction.HasFunctionRight(ApplicationAccess.FacilitySetup, FunctionAccess.Update, (DataTable)Session["UserRight"]) == false)
                    {
                        btnSave.Enabled   = false;
                        btnCancel.Enabled = false;
                    }
                }
                else
                {
                    btnExit.Enabled = false;
                }
                ViewState["FacilityId"] = Convert.ToInt32(Request.QueryString["FacilityId"]);
                if (Convert.ToInt32(ViewState["FacilityId"]) < 1)
                {
                    //(Master.FindControl("lblheader") as Label).Text = "Add Facility";
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "Add Facility";
                    lblForm.Text = "Add Facility";
                }
                else
                {
                    //(Master.FindControl("lblheader") as Label).Text = "Edit Facility";
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false;
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text  = "Edit Facility";
                    lblForm.Text = "Edit Facility";
                }
                //(Master.FindControl("lblMark") as Label).Visible = false;
                ViewState["FacilityDS"] = (DataSet)Session["FacilityDS"];
                //Session.Remove("FacilityDS");

                txtPEPFAR_Fund.Attributes.Add("onkeyup", "DateFormat(this,this.value,event,false,'3')");
                txtPEPFAR_Fund.Attributes.Add("OnBlur", "DateFormat(this,this.value,event,true,'3')");
                Init_Form();
                Fill_Details();
                if (Convert.ToInt32(ViewState["FacilityId"]) == 0)
                {
                    btnSave.Text     = "Save";
                    ddStatus.Enabled = false;
                    IQCareMsgBox.ShowConfirm("FacilitySaveRecord", btnSave);
                }
                else
                {
                    btnSave.Text = "Update";
                    IQCareMsgBox.ShowConfirm("FacilityUpdateRecord", btnSave);
                }
            }

            Page.EnableViewState = true;
        }
        catch (Exception err)
        {
            MsgBuilder theBuilder = new MsgBuilder();
            theBuilder.DataElements["MessageText"] = err.Message.ToString();
            IQCareMsgBox.Show("#C1", theBuilder, this);
        }
    }
Пример #34
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["EMAILID"] != null)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "doHourglass", "doHourglass();", true);
                Master.OnDoEventShowGraph += new advancegraphs.DoEventShowGraph(buttonShowGraph_Click);
                Master.OnDoEventShowGrid  += new advancegraphs.DoEventShowGrid(buttonShowGrid_Click);
                Master.OnDoEventRemoveSelectedIndicatorGraph += new advancegraphs.DoEventRemoveSelectedIndicatorGraph(buttonRemoveSelectedIndicatorGraph_Click);
                Master.OnDoEventShowSelectedIndicatorGraph   += new advancegraphs.DoEventShowSelectedIndicatorGraph(buttonShowSelectedIndicatorGraph_Click);
                if (!IsPostBack)
                {
                    ViewState["VALUATION_DATA"] = null;

                    ManagePanels();

                    Master.textboxFromDate.Text  = "";
                    Master.textboxToDate.Text    = DateTime.Today.ToString("yyyy-MM-dd");
                    Master.textboxToDate.Enabled = false;

                    Master.LoadPortfolioMF();

                    ViewState["CURRENT_PORTFOLIO_ROW_ID"] = null;
                    if ((Session["MFPORTFOLIONAME"] != null) && (Session["MFPORTFOLIOMASTERROWID"] != null))
                    {
                        ViewState["CURRENT_PORTFOLIO_ROW_ID"]    = Session["MFPORTFOLIOMASTERROWID"].ToString();
                        Master.dropdownPortfolioMF.SelectedValue = Session["MFPORTFOLIOMASTERROWID"].ToString();
                        Master.LoadPortfolioFundNameList();
                        //Master.dropdownFundNameList.SelectedIndex = 0;
                        Master.textbox_selectedFundName.Text   = "";
                        Master.textbox_selectedSchemeCode.Text = "";


                        //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "doHourglass1", "document.body.style.cursor = 'wait';", true);
                        //ClientScript.RegisterStartupScript(this.GetType(), "doHourglass", "doHourglass();", true);
                        //now show the backtest graph
                        ShowLineValuation();
                        //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "resetCursor", "document.body.style.cursor = 'standard';", true);
//                        ClientScript.RegisterStartupScript(this.GetType(), "resetCursor", "resetCursor();", true);
                    }
                    //fillGraphList();

                    this.Title = "Porfolio valuation graph";
                }

                if (Master.panelWidth.Value != "" && Master.panelHeight.Value != "")
                {
                    //ShowGraph(scriptName);
                    chartPortfolioValuation.Visible = true;
                    chartPortfolioValuation.Width   = int.Parse(Master.panelWidth.Value);
                    chartPortfolioValuation.Height  = int.Parse(Master.panelHeight.Value);
                }
                ClientScript.RegisterStartupScript(this.GetType(), "resetCursor", "resetCursor();", true);
            }
            else
            {
                //Response.Write("<script language=javascript>alert('" + common.noLogin + "')</script>");
                Page.ClientScript.RegisterStartupScript(GetType(), "myScript", "alert('" + common.noLogin + "');", true);
                Server.Transfer("~/Default.aspx");
                //Response.Redirect("~/Default.aspx");
            }
        }
Пример #35
0
    public static void Read(string Path)
    {
        var filestream = new System.IO.FileStream(Path,
                                                  System.IO.FileMode.Open,
                                                  System.IO.FileAccess.Read,
                                                  System.IO.FileShare.ReadWrite);
        var file = new System.IO.StreamReader(filestream, System.Text.Encoding.UTF8, true, 128);

        bool Found_Tracks_Header = false;

        Master.Measure_Length  = 0;
        Master.Measure_Lengths = new List <int>();
        bool Pattern_Read = false;
        //int PatternNo = 0;
        List <byte> Instrument_Order  = new List <byte>();
        List <byte> Instrument_Macros = new List <byte>();

        Master.Macros = new List <List <byte> >();
        Master.Instrument_Envelopes = new List <List <byte> >();
        for (int i = 0; i < Constants.Sound_Channels; i++)
        {
            Master.Measure_Order[i] = new List <byte>();
            Master.Final_Note[i]    = new List <byte>();
        }
        Master.Linear_Data = new List <byte>();
        for (int i = 0; i < Master.Measures.Length; i++)
        {
            Master.Measures[i] = new List <SequenceLine[]>();
        }

        List <SequenceLine>[] EntireMeasure;

        EntireMeasure = new List <SequenceLine> [Constants.Sound_Channels];
        for (int i = 0; i < EntireMeasure.Length; i++)
        {
            EntireMeasure[i] = new List <SequenceLine>();
        }

        string lineOfText;

        while ((lineOfText = file.ReadLine()) != null)
        {
            if (lineOfText == "# Tracks")
            {
                Found_Tracks_Header = true;
                continue;
            }
            else if (lineOfText.Contains("ORDER"))
            {
                int position = 11;
                for (int i = 0; i < Constants.Sound_Channels; i++)
                {
                    if (position >= lineOfText.Length)
                    {
                        break;
                    }
                    Master.Measure_Order[i].Add(Master.getByteFromText(lineOfText, position));
                    position += 3;
                }
            }
            else if (lineOfText.Contains("MACRO "))
            {
                int position = 6;
                if (Master.getByteFromDecimalText(lineOfText, ref position) == 0)
                {
                    position  = lineOfText.IndexOf(":");
                    position += 2;
                    byte        decimal_value = Master.getByteFromDecimalText(lineOfText, ref position);
                    List <byte> Macro_Values  = new List <byte>();
                    while (position < lineOfText.Length)
                    {
                        Macro_Values.Add(decimal_value);
                        decimal_value = Master.getByteFromDecimalText(lineOfText, ref position);
                    }
                    byte final_value = Macro_Values[Macro_Values.Count - 1];
                    for (int i = Macro_Values.Count; i < 0x100; i++)
                    {
                        Macro_Values.Add(final_value);                                                                  //continue to extend the volume envelope if the note continues.
                    }
                    Master.Macros.Add(Macro_Values);
                }
            }
            else if (lineOfText.Contains("INST2A03"))
            {
                int position = 8;
                Instrument_Order.Add(Master.getByteFromDecimalText(lineOfText, ref position));
                Instrument_Macros.Add(Master.getByteFromDecimalText(lineOfText, ref position));
            }
            else if (lineOfText.Contains("TRACK"))
            {
                string[] Splitted = lineOfText.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                Master.Speed = int.Parse(Splitted[2]);
            }
            else if (Found_Tracks_Header && !Pattern_Read)
            {
                if (lineOfText.Contains("PATTERN "))
                {
                    int Length = "PATTERN ".Length;
                    //PatternNo = MyConvert.HexToDec(lineOfText.Substring(Length, lineOfText.Length - Length));
                    Master.Measure_Length = 0;
                    Pattern_Read          = true;
                    continue;
                }
            }
            else if (Pattern_Read)
            {
                if (!string.IsNullOrEmpty(lineOfText))
                {
                    string[] Splitted_ = lineOfText.Split(new[] { " : " }, StringSplitOptions.RemoveEmptyEntries);
                    string[] Splitted  = new string[Splitted_.Length - 1];

                    Array.Copy(Splitted_, 1, Splitted, 0, Splitted.Length);
                    Splitted_ = null;

                    int SoundChannel = 0;
                    foreach (string Entry in Splitted)
                    {
                        string[]      Section = Entry.Split(' ');
                        string        Note = "", Instrument = "", Volume = "";
                        List <Effect> l_effect = new List <Effect>();
                        for (int i = 0; i < Section.Length; i++)
                        {
                            string Index = Section[i];
                            switch (i)
                            {
                            case 0:
                                Note = Index.Contains(".") ? "" : Index;
                                break;

                            case 1:
                                Instrument = Index.Contains(".") ? "" : Index;
                                break;

                            case 2:
                                Volume = Index.Contains(".") ? "" : Index;
                                break;

                            default:
                                string EffectName, Argument;
                                if (Section[i] != "...")
                                {
                                    EffectName = Index[0].ToString();
                                    Argument   = Index.Substring(1);
                                    l_effect.Add(new Effect(EffectName, Argument));
                                }
                                break;
                            }
                        }
                        EntireMeasure[SoundChannel++].Add(new SequenceLine(Note, Instrument, Volume, l_effect));
                        foreach (Effect sfx in l_effect)
                        {
                            if (sfx.Effect_Prefix == "D")
                            {
                                Pattern_Read = false;
                            }
                            if (sfx.Effect_Prefix == "B")
                            {
                                Master.Final_Loop_Measure = (byte)sfx.Argument;
                            }
                        }
                    }
                    Master.Measure_Length++;
                }
                else
                {
                    Pattern_Read = false;
                }
                if (!Pattern_Read)
                {
                    int sc = 0;
                    foreach (List <SequenceLine> s in EntireMeasure)
                    {
                        Master.Measures[sc++].Add(s.ToArray());
                    }
                    EntireMeasure = new List <SequenceLine> [Constants.Sound_Channels];
                    for (int i = 0; i < EntireMeasure.Length; i++)
                    {
                        EntireMeasure[i] = new List <SequenceLine>();
                    }
                    Pattern_Read = false;
                    Master.Measure_Lengths.Add(Master.Measure_Length);
                }
            }
        }
        for (int i = 0; i < Instrument_Order.Count; i++)
        {
            for (int j = 0; j < Instrument_Order.Count; j++)
            {
                if (Instrument_Order[j] == i)
                {
                    Master.Instrument_Envelopes.Add(Master.Macros[Instrument_Macros[j]]);
                    break;
                }
            }
        }
    }
Пример #36
0
    /// <summary>
    /// 文章列表 文章浏览 公告栏 新闻栏
    /// </summary>
    /// <param name="num"></param>
    public void WriteSiteMap(int num)
    {
        Master.FindControl("Panel1").Visible = false;
        System.Web.UI.HtmlControls.HtmlGenericControl div = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Panel2");
        string str = div.InnerHtml;

        div.Visible = true;
        //Style sty = new Style();
        div.Style.Add(HtmlTextWriterStyle.Display, "''");
        //Tunnel.Model.Tunnel_SelType model = new Tunnel_SelType();
        //Tunnel.BLL.SelType stBll;
        //Tunnel.BLL.Tunnel_bum tbBll = new Tunnel.BLL.Tunnel_bum();
        //string temp = "";

        //stBll = new Tunnel.BLL.SelType();
        //model = stBll.GetModel(typeId);
        //if (model != null)
        //{
        //    temp = model.TypeName;

        //}
        //div.InnerHtml = "<font class='titlfontson'><span><a title='首页' href='/Index.aspx'>首页</a></span>"
        //    + "<span> &gt; </span>"
        //    + "<span><a title='" + model.BumName + "-" + tbBll.GetModel(bum_id).b_name + "' href='/" + model.Url + "?bum_id=" + bum_id + "'>" + model.BumName + "-" + tbBll.GetModel(bum_id).b_name + "</a></span>"
        //    + "<span> &gt; </span>"
        //    + "<span>" + temp + "</span>"
        //    + "</font>";
        string temp = "";

        if (typeId == 1)
        {
            temp = "生产日志";
        }
        else if (typeId == 2)
        {
            temp = "基地动态";
        }

        Tunnel.Model.Tunnel_xjbType xjbType = new Tunnel.BLL.Tunnel_xjbType().GetModel(bum_id);
        div.InnerHtml = "<font class='titlfontson'><span><a title='首页' href='/Index.aspx'>首页</a></span>"
                        + "<span> &gt; </span>"
                        + "<span><a title='厂(基地)项经部' href='/N_Index/xjb.aspx?bum_id=" + bum_id + "'>厂(基地)项经部</a></span>"
                        + "<span> &gt; </span>"
                        + "<span><a title='" + xjbType.Typename.Trim() + "' href='/N_Index/xjb.aspx?bum_id=" + bum_id + "'>" + xjbType.Typename.Trim() + "</a></span>"
                        + "<span> &gt; </span>"
                        + "<span>" + temp + "</span>"
                        + "</font>";
    }
Пример #37
0
        private void SetMaster(Master master)
        {
            string json = ConvertToJson(master);

            _ttsControl.MasterControl = json;
        }
Пример #38
0
    protected void TimerVoteChange_Tick(object sender, EventArgs e)
    {
        _ypos       = Cursor.Position.Y;
        poslbl.Text = _ypos.ToString();



        System.Web.UI.HtmlControls.HtmlGenericControl masterBody = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("masterBody");
        masterBody.Attributes.Add("style", "background-color: black");
    }
Пример #39
0
 protected void LimiterTimespanInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralLimiterTimespan", "PxWebAdminFeaturesApiGeneralLimiterTimespanInfo");
 }
Пример #40
0
 protected void ShowQueryInformation(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralShowQueryInformation", "PxWebAdminFeaturesApiGeneralShowQueryInformationInfo");
 }
Пример #41
0
    protected void OnButtonCommand(object sender, CommandEventArgs e)
    {
        //Event handler for command button clicked
        //Change view to Viewer and reset to clear existing data
        Master.Viewer.Reset();

        //Get parameters for the query
        string _client   = Master.ClientNumber;
        string _division = Master.Division;
        string _agent    = Master.AgentNumber;
        string _region   = Master.Region;
        string _district = Master.District;
        string _store    = Master.StoreNumber;
        string _start    = Master.StartDate;
        string _end      = Master.EndDate;

        //Initialize control values
        LocalReport report = Master.Viewer.LocalReport;

        report.DisplayName          = REPORT_NAME;
        report.EnableExternalImages = true;
        EnterpriseGateway enterprise = new EnterpriseGateway();
        DataSet           ds         = enterprise.FillDataset(USP_REPORT, TBL_REPORT, new object[] { _client, _division, _agent, _region, _district, _store, _start, _end });

        if (ds.Tables[TBL_REPORT].Rows.Count >= 0)
        {
            switch (e.CommandName)
            {
            case "Run":
                //Set local report and data source
                System.IO.Stream stream = Master.GetReportDefinition(REPORT_SRC);
                report.LoadReportDefinition(stream);
                report.DataSources.Clear();
                report.DataSources.Add(new ReportDataSource(REPORT_DS, ds.Tables[TBL_REPORT]));

                //Set the report parameters for the report
                ReportParameter clientName = new ReportParameter("ClientName", Master.ClientName);
                ReportParameter client     = new ReportParameter("ClientNumber", _client);
                ReportParameter division   = new ReportParameter("Division", _division);
                ReportParameter agent      = new ReportParameter("AgentNumber", _agent);
                ReportParameter region     = new ReportParameter("Region", _region);
                ReportParameter district   = new ReportParameter("District", _district);
                ReportParameter store      = new ReportParameter("StoreNumber", _store);
                ReportParameter start      = new ReportParameter("StartDate", _start);
                ReportParameter end        = new ReportParameter("EndDate", _end);
                report.SetParameters(new ReportParameter[] { client, division, agent, region, district, store, start, end, clientName });

                //Update report rendering with new data
                report.Refresh();
                if (!Master.Viewer.Enabled)
                {
                    Master.Viewer.CurrentPage = 1;
                }
                break;

            case "Data":
                //Set local export report and data source
                report.LoadReportDefinition(Master.CreateExportRdl(ds, REPORT_DS, "RGXSQLR.TSORT"));
                report.DataSources.Clear();
                report.DataSources.Add(new ReportDataSource(REPORT_DS, ds.Tables[TBL_REPORT]));
                report.Refresh(); break;

            case "Excel":
                //Create Excel mime-type page
                Response.ClearHeaders();
                Response.Clear();
                Response.Charset = "";
                Response.AddHeader("Content-Disposition", "inline; filename=DeliveryWindowSummaryByStore.xls");
                Response.ContentType = "application/vnd.ms-excel";      //application/octet-stream";
                System.IO.StringWriter       sw = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw);
                DataGrid dg = new DataGrid();
                dg.DataSource = ds.Tables[TBL_REPORT];
                dg.DataBind();
                dg.RenderControl(hw);
                Response.Write(sw.ToString());
                Response.End();
                break;
            }
        }
        else
        {
            Master.Status = "There were no records found.";
        }
    }
Пример #42
0
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     (Master.FindControl("lblTitle") as Label).Text = "ÏêϸÐÅÏ¢";
 }
Пример #43
0
 public SaletypeEntry(SalePurchaseOrderSimpleformate salePurchaseOrderSimpleformate, Master master, TabControl tabControl, string activecontroal)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.salePurchaseOrderSimpleformate = salePurchaseOrderSimpleformate;
     this.master         = master;
     this.tabControl     = tabControl;
     this.activecontroal = activecontroal;
     bindgroup();
     bindtaxtype();
     label11.Visible = false;
     pvc             = activecontroal;
 }
Пример #44
0
 protected void FetchCellLimitInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralFetchCellLimit", "PxWebAdminFeaturesApiGeneralFetchCellLimitInformationInfo");
 }
Пример #45
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request["pg"] != null)
        {
            if (int.Parse(Request["pg"]) > -1)
            {
                // first, grab the pageID
                int page = Int32.Parse(Request["pg"]);

                // then site id
                int site = Int32.Parse(Request["siteId"]);

                tblPages pages = new tblPages();
                pages.Where.PageId.Value = page;

                pages.Query.Load();

                tblMasterPages master = new tblMasterPages();
                master.LoadByPrimaryKey(pages.MasterPageId);

                Page.MasterPageFile = "~/App_MasterPages/" + master.MasterPageTitle;

                // find the place holders
                tblContentPanes panes = new tblContentPanes();
                panes.Where.MasterPageId.Value = pages.MasterPageId;
                panes.Query.Load();

                do
                {
                    tblPageXControl pgx = new tblPageXControl();

                    pgx.Where.PageId.Value        = page;
                    pgx.Where.ContentPaneId.Value = panes.ContentPaneId;

                    pgx.Query.Load();

                    if (pgx.RowCount > 0)
                    {
                        pgx.Rewind();
                        do
                        {
                            ContentPlaceHolder ph1 = (ContentPlaceHolder)Master.FindControl(panes.ContentPaneTitle);

                            tblControls control = new tblControls();
                            control.LoadByPrimaryKey(pgx.ControlId);
                            ph1.Controls.Add(Page.LoadControl("~/App_Controls/" + control.ControlLocation));
                        } while (pgx.MoveNext());
                    }
                } while (panes.MoveNext());

                tblSites ts = new tblSites();
                ts.LoadByPrimaryKey(site);
                tblPagesXLanguage pg = new tblPagesXLanguage();
                pg.Where.PageId.Value     = page;
                pg.Where.LanguageId.Value = Convert.ToInt32(Request["langid"]);
                pg.Query.Load();

                Page.Title = ts.SiteTitle + " - " + pg.PageFriendlyName;
            }
        }
    }
Пример #46
0
        protected void btn_addNewOrg_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                // Find Label on MasterPage
                var    lbl_masterSalesID  = (Label)Master.FindControl("lbl_masterSalesID");
                string slbl_masterSalesID = lbl_masterSalesID.Text;

                // Add New Org to tbl_OrgsMaster

                var sqlConn =
                    new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString);
                var cmd =
                    new SqlCommand(
                        "INSERT INTO tbl_OrgsMaster (OrgName, OrgAddress, OrgCity, OrgState, OrgZip, OrgPhone, OrgPhone2, OrgFax, OrgEmail, OrgContact, OrgDescription, OrgStatus, OrgSubscription)VALUES(@OrgName, @OrgAddress, @OrgCity, @OrgState, @OrgZip, @OrgPhone, @OrgPhone2, @OrgFax, @OrgEmail, @OrgContact, @OrgDescription, @OrgStatus, @OrgSubscription);SELECT @@IDENTITY",
                        sqlConn);


                cmd.Parameters.Add("@OrgName", SqlDbType.VarChar, 255).Value        = txt_addOrgName.Text;
                cmd.Parameters.Add("@OrgAddress", SqlDbType.VarChar, 255).Value     = txt_addOrgAddress.Text;
                cmd.Parameters.Add("@OrgCity", SqlDbType.VarChar, 255).Value        = txt_addOrgCity.Text;
                cmd.Parameters.Add("@OrgState", SqlDbType.VarChar, 255).Value       = ddl_addOrgState.SelectedItem.ToString();
                cmd.Parameters.Add("@OrgZip", SqlDbType.VarChar, 255).Value         = txt_addOrgZip.Text;
                cmd.Parameters.Add("@OrgPhone", SqlDbType.VarChar, 255).Value       = txt_addOrgPhone.Text;
                cmd.Parameters.Add("@OrgPhone2", SqlDbType.VarChar, 255).Value      = txt_addOrgPhone2.Text;
                cmd.Parameters.Add("@OrgFax", SqlDbType.VarChar, 255).Value         = txt_addOrgFax.Text;
                cmd.Parameters.Add("@OrgEmail", SqlDbType.VarChar, 255).Value       = txt_addOrgEmail.Text;
                cmd.Parameters.Add("@OrgContact", SqlDbType.VarChar, 255).Value     = txt_addOrgContact.Text;
                cmd.Parameters.Add("@OrgDescription", SqlDbType.NVarChar, -1).Value = txt_addOrgDescription.Text;
                cmd.Parameters.Add("@OrgStatus", SqlDbType.VarChar, 255).Value      =
                    ddl_addOrgStatus.SelectedItem.ToString();
                cmd.Parameters.Add("@OrgSubscription", SqlDbType.VarChar, 255).Value =
                    ddl_addOrgSubscription.SelectedItem.ToString();

                cmd.Connection.Open();
                Int32 NewOrgID = Convert.ToInt32(cmd.ExecuteScalar());
                lbl_NewOrgID.Text = NewOrgID.ToString();
                cmd.Connection.Close();
                cmd.Connection.Dispose();

                // WRITE TO TBL_SALESMEMBERS

                var sqlConn2 =
                    new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString);
                var cmd2 =
                    new SqlCommand(
                        "INSERT INTO tbl_SalesMembers (SalesID, OrgID, SalesMemberTerm)VALUES(@SalesID, @OrgID, @SalesMemberTerm)",
                        sqlConn2);


                cmd2.Parameters.Add("@SalesID", SqlDbType.VarChar, 255).Value         = slbl_masterSalesID;
                cmd2.Parameters.Add("@OrgID", SqlDbType.VarChar, 255).Value           = lbl_NewOrgID.Text;
                cmd2.Parameters.Add("@SalesMemberTerm", SqlDbType.VarChar, 255).Value =
                    ddl_addOrgSubscription.SelectedItem.ToString();

                cmd2.Connection.Open();
                cmd2.ExecuteNonQuery();
                cmd2.Connection.Close();
                cmd2.Connection.Dispose();


                // Clear Boxes
                txt_addOrgName.Text        = "";
                txt_addOrgAddress.Text     = "";
                txt_addOrgCity.Text        = "";
                txt_addOrgZip.Text         = "";
                txt_addOrgPhone.Text       = "";
                txt_addOrgPhone2.Text      = "";
                txt_addOrgFax.Text         = "";
                txt_addOrgEmail.Text       = "";
                txt_addOrgContact.Text     = "";
                txt_addOrgDescription.Text = "";

                // Hide Div
                addNewOrg.Visible = false;

                // Rebind OrgDropdown
                BindOrgDropdown();
            }
        }
    private void ShowGreeting()
    {
        Panel sidebarPanel = (Panel)Master.FindControl("pnlSidebar");

        sidebarPanel.Visible = false;
    }
Пример #48
0
 protected void MaxValuesReturnedInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralMaxValuesReturned", "PxWebAdminFeaturesApiGeneralMaxValuesReturnedInfo");
 }
Пример #49
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         BitOP.Global.MenuControl.getMenu((Menu)Master.FindControl("NavigationMenu"), (Login)Master.FindControl("Login1"), BitOP.Global.Perfil);
     }
 }
Пример #50
0
 protected void RoutePrefixInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralRoutePrefix", "PxWebAdminFeaturesApiGeneralRoutePrefixInfo");
 }
Пример #51
0
{// if the page in loaded change menuitem back ground color && after remove event
    //diable button.
    protected void Page_Load(object sender, EventArgs e)
    {
        Master.SetCurrentMenuItem("Sections");
        Button2.Enabled = false;
    }
Пример #52
0
 protected void CnmmDatabasesInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralApiCnmmDatabases", "PxWebAdminFeaturesApiGeneralApiCnmmDatabasesInfo");
 }
Пример #53
0
 protected void EnableCacheInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralEnableCache", "PxWebAdminFeaturesApiGeneralEnableCacheInfo");
 }
Пример #54
0
 protected void DefaultExampleResponseFormatInfo(object sender, ImageClickEventArgs e)
 {
     Master.ShowInfoDialog("PxWebAdminFeaturesApiGeneralDefaultExampleResponseFormat", "PxWebAdminFeaturesApiGeneralDefaultExampleResponseFormatInfo");
 }
Пример #55
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //txtSeqNo.Attributes.Add("onkeypress", "chkNumeric('"+ txtSeqNo.ClientID + "')");
            if (Page.IsPostBack != true)
            {
                try
                {
                    txtSeqNo.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtSeqNo.ClientID + "')");
                    txtmultiplier.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtmultiplier.ClientID + "')");
                    ViewState["Id"]         = Convert.ToInt32(Request.QueryString["SelectedId"]);
                    Session["UpdateID"]     = Convert.ToInt32(Request.QueryString["SelectedId"]);
                    ViewState["TableName"]  = Request.QueryString["TableName"].ToString();
                    ViewState["CategoryId"] = Request.QueryString["CategoryId"].ToString();
                    ViewState["ListName"]   = Request.QueryString["LstName"].ToString();
                    ViewState["FID"]        = Request.QueryString["Fid"].ToString();
                    ViewState["Update"]     = Request.QueryString["Upd"].ToString();
                    if (Request.QueryString["CCID"] != null)
                    {
                        ViewState["CCID"] = Request.QueryString["CCID"].ToString();
                    }
                    if (Request.QueryString["ModId"].ToString() != "")
                    {
                        ViewState["ModuleId"] = Convert.ToInt32(Request.QueryString["ModId"]);
                    }

                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Text   = "Customize Lists >> ";
                    (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = ViewState["ListName"].ToString();
                    if (ViewState["ListName"].ToString() == "Emergency Contact Relationship")
                    {
                        //(Master.FindControl("lblheader") as Label).Text = "Emerg. Cont. Relationship";
                        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Emerg. Cont. Relationship";
                    }
                    if (ViewState["ListName"].ToString() == "Scheduler - Appointment purpose")
                    {
                        //(Master.FindControl("lblheader") as Label).Text = "Sched. Appoi. Purpose";
                        (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Sched. Appoi. Purpose";
                    }
                    if (ViewState["TableName"].ToString() == "Frequency")
                    {
                        divmultiplier.Visible = true;
                    }
                    else
                    {
                        divmultiplier.Visible = false;
                    }

                    txtSeqNo.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtSeqNo.ClientID + "')");
                    Clear_Fields();

                    AuthenticationManager Authentication = new AuthenticationManager();
                    if (Convert.ToInt32(ViewState["Id"]) == 0)
                    {
                        if (Convert.ToInt32(ViewState["FID"]) != 0)
                        {
                            if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.View, (DataTable)Session["UserRight"]) == false)
                            {
                                btnSave.Enabled = false;
                            }
                        }

                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                        {
                            theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        }
                        IQCareMsgBox.ShowConfirm("CustomSaveRecord", theBuilder, btnSave);
                        if (ViewState["TableName"].ToString() != "HivDisease")
                        {
                            lblHeader.Text = "Add " + ViewState["ListName"].ToString();
                            if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                            {
                                lblHeader.Text = "Add " + ViewState["ListName"].ToString();
                            }
                        }
                        else
                        {
                            lblHeader.Text = "Add OIs or AIDS Defining Illnesses";
                        }
                        tdStatus.Visible = false;
                    }
                    else
                    {
                        if (Convert.ToInt32(ViewState["FID"]) != 0)
                        {
                            if (Authentication.HasFunctionRight(Convert.ToInt32(ViewState["FID"]), FunctionAccess.View, (DataTable)Session["UserRight"]) == false)
                            {
                                btnSave.Enabled = false;
                            }
                        }
                        /////////////Imposing Business Rule of Limiting Custom List to Add Only /////////
                        if (Convert.ToInt32(ViewState["Update"]) != 1)
                        {
                            DataTable   DTupdateflag  = new DataTable();
                            ICustomList CustomManager = (ICustomList)ObjectFactory.CreateInstance("BusinessProcess.Administration.BCustomList, BusinessProcess.Administration");
                            DTupdateflag = CustomManager.GetCustomListUpdateFlag(Convert.ToString(ViewState["TableName"]), Convert.ToInt32(ViewState["Id"]), Convert.ToInt32(Session["SystemId"].ToString()));
                            if (DTupdateflag.Rows.Count > 0)
                            {
                                if (DTupdateflag.Rows[0]["UpdateFlag"] != System.DBNull.Value)
                                {
                                    if (DTupdateflag.Rows[0].IsNull("UpdateFlag") == true)
                                    {
                                        ViewState["UpdateFlag"] = 0;
                                    }
                                    else
                                    {
                                        ViewState["UpdateFlag"] = DTupdateflag.Rows[0]["UpdateFlag"];
                                    }
                                    // int UpdateFlag = Convert.ToInt32(DTupdateflag.Rows[0]["UpdateFlag"]);
                                    if (Convert.ToInt32(ViewState["UpdateFlag"]) == 0)
                                    {
                                        btnSave.Enabled = false;
                                    }
                                }
                            }
                        }
                        /////////////////////////////////////////////////////////////////////////////////

                        MsgBuilder theBuilder = new MsgBuilder();
                        theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                        {
                            theBuilder.DataElements["Name"] = ViewState["ListName"].ToString();
                        }
                        IQCareMsgBox.ShowConfirm("CustomUpdateRecord", theBuilder, btnSave);
                        if (ViewState["TableName"].ToString() != "HivDisease")
                        {
                            lblHeader.Text = "Edit " + ViewState["ListName"].ToString();
                            if (Convert.ToInt32(ViewState["CategoryId"]) > 0)
                            {
                                lblHeader.Text = "Edit " + ViewState["ListName"].ToString();
                            }
                        }
                        else
                        {
                            lblHeader.Text = "Edit OIs or AIDS Defining Illnesses";
                        }
                        tdStatus.Visible = false;
                        btnSave.Text     = "Update";
                        tdStatus.Visible = true;
                    }
                }
                catch (Exception err)
                {
                    MsgBuilder theBuilder = new MsgBuilder();
                    theBuilder.DataElements["MessageText"] = err.Message.ToString();
                    IQCareMsgBox.Show("#C1", theBuilder, this);
                }
            }
        }
Пример #56
0
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlGenericControl body = (HtmlGenericControl)Master.FindControl("master");

        body.Attributes.Add("class", "admin");

        tablename = HttpContext.Current.Request.QueryString["t"];
        userrole  = LoginHelper.UserRole(Page.User.Identity.Name);

        if (userrole != "admin")
        {
            AllPanel.Visible = false;
            Label1.Text      = "Vous n'avez pas la permission d'utiliser cette page. Veuillez contacter [email protected] si vous pensez que c'est une erreur.";
        }
        else
        {
            eh      = new ElevesHelper();
            columns = new ArrayList();

            if (tablename == "" | tablename == null)
            {
                Label1.Text = "Aucune table n'a été sélectionnée.";
            }
            else
            {
                litTableName.Text = tablename;
                tbs = PageHelper.CreateTextBoxes(PageHelper.ColumnNames(eh.GetContactsDataSet("SELECT * from " + tablename).Tables[0]));

                Table tbl = new Table();

                InputPanel.Controls.Add(tbl);

                int counter = 0;
                foreach (TextBox tb in tbs)
                {
                    columns.Add(tb.ID.Substring(PREFIX_LENGTH));
                    TableRow  tr  = new TableRow();
                    TableCell td1 = new TableCell();
                    TableCell td2 = new TableCell();

                    tbl.Controls.Add(tr);
                    tr.Controls.Add(td1);
                    tr.Controls.Add(td2);

                    Label lb = new Label();
                    lb.Text = LoginHelper.GetColumnComment(tablename, tb.ID.Substring(PREFIX_LENGTH));

                    td1.Controls.Add(lb);
                    td2.Controls.Add(tb);
                    counter++;
                }

                if (!IsPostBack)
                {
                    if (Page.User.Identity.Name == "*****@*****.**")
                    {
                        Label1.Text = "Super admin";
                        GridView1.AutoGenerateEditButton   = true;
                        GridView1.AutoGenerateDeleteButton = true;
                    }
                    else
                    {
                        GridView1.AutoGenerateEditButton   = false;
                        GridView1.AutoGenerateDeleteButton = false;
                    }

                    BindDataGrid();
                }
            }
        }
    }
Пример #57
0
 public void Clear()
 {
     Master.Clear();
 }
Пример #58
0
        /// <summary>
        /// Set Page header,Call BindGrid() method
        /// Check User Permitions
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            string Mode = string.Empty;

            if (Request.QueryString["ProjectID"] != null)
            {
                Session["PROJECT_ID"] = Convert.ToInt32(Request.QueryString["ProjectID"]);
                if (Request.QueryString["HHID"] != null)
                {
                    Session["HH_ID"] = Convert.ToInt32(Request.QueryString["HHID"]);
                }
                else
                {
                    Session["HH_ID"] = null;
                }
                Session["PROJECT_CODE"] = Request.QueryString["ProjectCode"].ToString();
                Mode = Request.QueryString["Mode"].ToString();
            }
            ValuationMenu1.HighlightMenu  = ValuationMenu.MenuValue.PermanentBuildings;
            ViewMasterCopy1.HighlightMenu = ViewMasterCopy.MenuValue.PermanentBuilding;
            Page.Response.Cache.SetNoStore();
            if (!Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "MasterJS"))
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MasterJS",
                                                            CreateStartupScript());
            }
            if (Session["USER_ID"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            if (Session["PROJECT_ID"] == null)
            {
                Response.Redirect("~/UI/Project/ViewProjects.aspx");
            }
            if (Session["HH_ID"] == null)
            {
                Response.Redirect("~/UI/Compensation/PAPList.aspx");
            }
            if (!IsPostBack)
            {
                if (Session["PROJECT_CODE"] != null)
                {
                    Master.PageHeader = Session["PROJECT_CODE"].ToString() + " - Valuation - Permanent Buildings";
                }
                else
                {
                    Response.Redirect("~/UI/Project/ViewProjects.aspx");
                }

                ViewState["PERM_STRUCTUREID"] = 0; // ViewState ID
                BindGrid(false, false);            //Calling the Grid Data

                GetStructureTypeData();

                GetRoofMaterial();

                GetWallmaterial();

                GetFloorMaterial();

                GetWindowMaterial();

                GetOccupantStatus();

                GetConditionData();

                txtbxDepreciatedValue.Attributes.Add("onblur", "CalculateAmount();");
                txtbxReplacementValue.Attributes.Add("onblur", "CalculateAmount();");
                txtbxReplacementUplift.Attributes.Add("onKeyDown", "doCheck();");

                txtbxLength.Attributes.Add("onchange", "surfacearea();");
                txtbxWidth.Attributes.Add("onchange", "surfacearea();");
                txtbxSurfaceArea.Attributes.Add("onKeyDown", "doCheck();");


                txtbxDepreciatedValue.Attributes.Add("onchange", "setDirtyText();");
                txtbxReplacementValue.Attributes.Add("onchange", "setDirtyText();");


                RbtnSelf.Attributes.Add("onclick", "EnableDisableOtherOwner(0);");
                RbtnOther.Attributes.Add("onclick", "EnableDisableOtherOwner(1);");
                RdbtnSelfoccupied.Attributes.Add("onclick", "EnableDisableOtherOccupant(0);");
                RdbtnOccupantOther.Attributes.Add("onclick", "EnableDisableOtherOccupant(1);");

                ddlOccupantStatus.Attributes.Add("onchange", "EnableDisableOtherOccupantStatus(this);");

                popupData();
                //lnkViewPhoto.Visible = false;

                projectFrozen();

                if (CheckAuthorization.HasUpdatePrivilege(UtilBO.PrivilegeCode.PRIV_VALUATION) == false)
                {
                    lnkPermBuild.Visible = false;
                    btnSave.Visible      = false;
                    btnClear.Visible     = false;
                    grdPermanentBuilding.Columns[grdPermanentBuilding.Columns.Count - 1].Visible = false;
                    grdPermanentBuilding.Columns[grdPermanentBuilding.Columns.Count - 2].Visible = false;
                    grdPermanentBuilding.Columns[grdPermanentBuilding.Columns.Count - 4].Visible = false;
                }
            }

            if (Mode == "Readonly")
            {
                ValuationMenu1.Visible = false;
                Label userNameLabel = (Label)Master.FindControl("userNameLabel");
                userNameLabel.Visible = false;
                LinkButton lnkLogout = (LinkButton)Master.FindControl("lnkLogout");
                lnkLogout.Visible = false;
                Menu NavigationMenu = (Menu)Master.FindControl("NavigationMenu");
                NavigationMenu.Visible = false;
                ImageButton imgSearch = (ImageButton)HouseholdSummary1.FindControl("imgSearch");
                imgSearch.Visible    = false;
                lnkPermBuild.Visible = false;
                btnSave.Visible      = false;
                btnClear.Visible     = false;
                grdPermanentBuilding.Columns[grdPermanentBuilding.Columns.Count - 1].Visible = false;
                grdPermanentBuilding.Columns[grdPermanentBuilding.Columns.Count - 2].Visible = false;
                grdPermanentBuilding.Columns[grdPermanentBuilding.Columns.Count - 4].Visible = false;
            }
        }
Пример #59
0
 public void Remove(object key)
 {
     Master.Remove(key);
 }
    protected void OnButtonCommand(object sender, CommandEventArgs e)
    {
        //Event handler for command button clicked
        //Change view to Viewer and reset to clear existing data
        Master.Viewer.Reset();

        //Get parameters for the query
        string dates      = this.cboDateValue.SelectedValue;
        string _start     = dates.Split(':')[0].Trim();
        string _end       = dates.Split(':')[1].Trim();
        int    _delivDays = Convert.ToInt32(this.cboDelivDays.Text);
        string _locType   = this.cboLocType.Text;
        string _vendor    = this.cboCustomer.SelectedValue;

        //Initialize control values
        LocalReport report = Master.Viewer.LocalReport;

        report.DisplayName          = REPORT_NAME;
        report.EnableExternalImages = true;
        EnterpriseGateway enterprise = new EnterpriseGateway();
        DataSet           ds         = enterprise.FillDataset(USP_REPORT, TBL_REPORT, new object[] { _start, _end, _delivDays, _locType, _vendor });

        if (ds.Tables[TBL_REPORT].Rows.Count >= 0)
        {
            switch (e.CommandName)
            {
            case "Run":
                //Set local report and data source
                System.IO.Stream stream = Master.GetReportDefinition(REPORT_SRC);
                report.LoadReportDefinition(stream);
                report.DataSources.Clear();
                report.DataSources.Add(new ReportDataSource(REPORT_DS, ds.Tables[TBL_REPORT]));

                //Set the report parameters for the report
                ReportParameter start     = new ReportParameter("StartDate", _start);
                ReportParameter end       = new ReportParameter("EndDate", _end);
                ReportParameter delivDays = new ReportParameter("DeliveryDays", _delivDays.ToString());
                ReportParameter locType   = new ReportParameter("LocationType", _locType);
                report.SetParameters(new ReportParameter[] { start, end, delivDays, locType });

                //Update report rendering with new data
                report.Refresh();

                if (!Master.Viewer.Enabled)
                {
                    Master.Viewer.CurrentPage = 1;
                }
                break;

            case "Data":
                //Set local export report and data source
                report.LoadReportDefinition(Master.CreateExportRdl(ds, REPORT_DS, "RGXSQLR.TSORT"));
                report.DataSources.Clear();
                report.DataSources.Add(new ReportDataSource(REPORT_DS, ds.Tables[TBL_REPORT]));
                report.Refresh();
                break;

            case "Excel":
                //Create Excel mime-type page
                Response.ClearHeaders();
                Response.Clear();
                Response.Charset = "";
                Response.AddHeader("Content-Disposition", "inline; filename=BNConsumerDirectCartonDetail.xls");
                Response.ContentType = "application/vnd.ms-excel";      //application/octet-stream";
                System.IO.StringWriter       sw = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw);
                DataGrid dg = new DataGrid();
                dg.DataSource = ds.Tables[TBL_REPORT];
                dg.DataBind();
                dg.RenderControl(hw);
                Response.Write(sw.ToString());
                Response.End();
                break;
            }
        }
        else
        {
            Master.Status = "There were no records found.";
        }
    }