protected void Search_Click(object sender, EventArgs e) { Hashtable htabel = new Hashtable(); if (chkPaName.Checked) { htabel.Add("Name", txtPaName.Text.Trim()); } if (chkPaLayer.Checked) { htabel.Add("Layer", txtPavLayer.Text.Trim()); } if (chkType.Checked) { htabel.Add("TypeID", int.Parse(DDLPaType.SelectedValue)); } if (chkPaHeight.Checked) { htabel.Add("Height", txtPaHeight.Text.Trim()); } if (chkPaArea.Checked) { htabel.Add("Area", txtPaArea.Text.Trim()); } string strsql = Ultility.GetConditionClause(htabel, chkExact.Checked); if (chkPaBuildDate.Checked) { strsql += " and BuildDate between '" + txtBeginDate.Value.Trim() + "' and '" + txtEndDate.Value.Trim() + "'"; } PavilionGridView.DataSource = pabll.GetPavilionByCondition(strsql); PavilionGridView.DataBind(); }
private void showErrorListToolStripMenuItem_CheckStateChanged(object sender, EventArgs e) { try { if (MenuButton_ErrorList.Checked) { if (ErrorListWindow.IsDisposed) { ErrorListWindow = new ErrorListWindow(); ErrorListWindow.Icon = Ultility.GetIcon("ErrorList"); ErrorListWindow.Disposed += new EventHandler(ErrorListWindow_Disposed); ErrorListWindow.ListView.DoubleClick += new EventHandler(ErrorListView_DoubleClick); } ErrorListWindow.Show(DockContainer); } else { try { ErrorListWindow.Hide(); } catch (Exception) { } } } catch (Exception ex) { } }
private void btnUserProfile_Click(object sender, EventArgs e) { try { tvodUltility = new Ultility(); bool isLogin = tvodUltility.checkLogin(); if (isLogin == true) { NavigationService.Navigate(new Uri("/UserProfileActivity_V2.xaml", UriKind.Relative)); } else { (App.Current as App).navigation_tvod = "MAIN_PAGE"; //NavigationService.Navigate(new Uri("/LoginActivity.xaml", UriKind.Relative)); LoginActivity_V2 loginWindow = new LoginActivity_V2(); //loginWindow.Login = Username; //loginWindow.Closed += new EventHandler(OnLoginChildWindowShow); loginWindow.Show(); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } }
protected void Search_Click(object sender, EventArgs e) { Hashtable htabel = new Hashtable(); if (chkFixID.Checked) { htabel.Add("FixID", txtFixID.Text.Trim()); } if (chkFixName.Checked) { htabel.Add("Name", txtFixName.Text.Trim()); } if (chkFixFactory.Checked) { htabel.Add("Factory", txtFixFactory.Text.Trim()); } string strsql = Ultility.GetConditionClause(htabel, chkExact.Checked); if (chkFixFactoryDate.Checked) { strsql += " and FactoryDate between '" + txtBeginDate.Value.Trim() + "' and '" + txtEndDate.Value.Trim() + "'"; } FixGridView.DataSource = bll.GetFixByCondition(strsql); FixGridView.DataBind(); }
public void GenerateMap() { currentMap = maps[mapIndex]; tileMap = new Transform[currentMap.mapSize.x, currentMap.mapSize.y]; if (currentMap.seed == "") { currentMap.seed = Ultility.GetRandomString(rnd, 64); } CoordAllTitles(); shuffledTitleCoords = new Queue <Coord>(Ultility.ShuffleArray(allTitleCoords.ToArray(), currentMap.seed)); string holderName = "Generated Map"; if (transform.FindChild(holderName)) { DestroyImmediate(transform.FindChild(holderName).gameObject); } Transform mapHolder = new GameObject(holderName).transform; mapHolder.parent = transform; CreateFloor(mapHolder, new System.Random(currentMap.seed.GetHashCode())); CreateObstacles(mapHolder); CreateBorder(mapHolder); }
private void Button_Purchase_Click(object sender, EventArgs e) { try { Process.Start("mailto:[email protected]"); } catch (Exception ex) { Ultility.LogException(ex, null); } //string url="http://windows.patroot.com/MemberCenter/LicenseControl.aspx?hid=" + License.Status.HardwareID; //try //{ // string defaultBrowserPath = GetDefaultBrowserPath(); // // launch default browser // Process.Start(defaultBrowserPath, url); //} //catch (Exception exp) //{ // MessageBox.Show(exp.Message); //} }
protected void Search_Click(object sender, EventArgs e) { Hashtable htabel = new Hashtable(); if (chkFixName.Checked) { htabel.Add("Name", txtFixName.Text.Trim()); } if (chkMainHead.Checked) { htabel.Add("MainHead", txtMainHead.Text.Trim()); } if (chkFixID.Checked) { htabel.Add("FixID", txtFixID.Text.Trim()); } if (chkSign.Checked) { htabel.Add("Sign", Convert.ToInt32(DDLSign.SelectedValue)); } if (chkUnit.Checked) { htabel.Add("RepairUnit", txtUnit.Text.Trim()); } if (chkFee.Checked) { htabel.Add("RepairSum", Convert.ToInt32(txtFee.Text)); } FixRepairGridView.DataSource = bll.GetFixRepairByCondition(Ultility.GetConditionClause(htabel, chkExact.Checked)); FixRepairGridView.DataBind(); }
public List <T> ExecStoreToList <T>(string storedProcedure, object[] iparam = null, dynamic outParam = null, SqlTransaction transaction = null, bool buffered = true, int?commandTimeout = null) where T : class { SqlConnection connection = new SqlConnection(connectionString); try { connection.Open(); if (tsnTransaction != null) { transaction = tsnTransaction; } var param = Ultility.Converts(iparam); var output = connection.Query <T>(storedProcedure, param: (object)param, transaction: transaction, buffered: buffered, commandTimeout: commandTimeout ?? 60, commandType: CommandType.StoredProcedure); return(output.ToList()); } catch (Exception ex) { throw ex; } finally { connection.Close(); connection.Dispose(); } }
public ActionResult Header() { V308CMSEntities mEntities = new V308CMSEntities(); MarketRepository marketRepository = new MarketRepository(mEntities); AccountRepository accountRepository = new AccountRepository(mEntities); HeaderPage mHeaderPage = new HeaderPage(); List <Market> mList; Account mAccount; try { //Check xem dang nhap chưa thi hien thi menu khac // && Session["ShopCart"] != null if (HttpContext.User.Identity.IsAuthenticated == true && Session["UserId"] != null) { //lay thong tin chi tiet user mAccount = accountRepository.LayTinTheoId(Int32.Parse(Session["UserId"].ToString())); mHeaderPage.IsAuthenticated = true; mHeaderPage.Account = mAccount; } if (Session["ShopCart"] != null) { mHeaderPage.ShopCart = (ShopCart)Session["ShopCart"]; } else { mHeaderPage.ShopCart = null; } //lay danh sach nhom tin mList = marketRepository.getAll(8); mHeaderPage.Market = mList; //lay danh sach cac tin theo nhom // // // if (Request.Cookies["location"] != null && Request.Cookies["locationname"] != null) { ViewBag.location = Int32.Parse(Request.Cookies["location"].Value); ViewBag.locationname = Ultility.convertValueToDistrict(Int32.Parse(Request.Cookies["location"].Value)); } else { ViewBag.location = 0; ViewBag.locationname = "Hà Nội"; } // return(View("Header", mHeaderPage)); } catch (Exception ex) { Console.Write(ex); return(Content("<dx></dx>")); } finally { mEntities.Dispose(); marketRepository.Dispose(); } }
/** Constructor **/ public List_Child_Category_Level_2() { InitializeComponent(); imgCache = new ImageCache(); tvodUltility = new Ultility(); setUpApplicationBar(); //Cho doi thong tin nhan duoc tu server }
protected void ChangeSubDomain() { string pageId = Page.RouteData.Values["PageId"] != null ? Page.RouteData.Values["PageId"].ToString() : Request.QueryString["PageId"]; if (!String.IsNullOrEmpty(pageId)) { CheckSubDomain(pageId); } string articleId = Page.RouteData.Values["Id"] != null ? Page.RouteData.Values["Id"].ToString() : Request.QueryString["ArticleId"]; string topicId = Page.RouteData.Values["TopicId1"] != null ? Page.RouteData.Values["TopicId1"].ToString() : Request.QueryString["TopicId"]; if (!String.IsNullOrEmpty(articleId)) { int index = articleId.IndexOf("/"); int review = articleId.IndexOf("Preview"); if (index > 0) { articleId = articleId.Substring(0, index); } pageId = review > -1 ? Ultility.GetPageIdByArticleIdUnPublish(articleId).ToString(): Ultility.GetPageIdByArticleId(articleId).ToString(); portalPageId = pageId; CheckSubDomain(pageId); } if (!String.IsNullOrEmpty(topicId)) { int index = topicId.IndexOf("/"); if (index > 0) { topicId = topicId.Substring(0, index); } //topicId => pageId pageId = Ultility.GetPageIdByTopicId(topicId).ToString(); portalPageId = pageId; CheckSubDomain(pageId); } string moduleId = Page.RouteData.Values["ModuleId"] != null ? Page.RouteData.Values["ModuleId"].ToString() : Request.QueryString["ModuleId"]; if (!String.IsNullOrEmpty(moduleId)) { //moduleId => pageId int index = moduleId.IndexOf("/"); if (index > 0) { moduleId = moduleId.Substring(0, index); } if (moduleId == ConfigurationManager.AppSettings["ModuleAlbum"] || moduleId == ConfigurationManager.AppSettings["ModuleVideoClip"] || moduleId == ConfigurationManager.AppSettings["ModuleSiteMap"]) { pageId = SubDomain.GetPage(Ultility.GetSubDomain()); } else { pageId = Ultility.GetPageIdByModuleleId(moduleId).ToString(); } portalPageId = pageId; CheckSubDomain(pageId); } }
public UserProfileActivity_V2() { InitializeComponent(); setUpApplicationBar(); enableProgressBar(); tvodUltility = new Ultility(); this.lstNDDaMua.Loaded += new RoutedEventHandler(lstNDDaMua_Loaded); //this.lstFavouriteContent.Loaded += new RoutedEventHandler(lstFavouriteContent_Loaded); }
public ListChannel_Follow_Child_Category() { InitializeComponent(); imgCache = new ImageCache(); tvodUltility = new Ultility(); setUpApplicationBar(); enableProgressBar(); this.lstLiveChannel_Follow_Category.Loaded += new RoutedEventHandler(lstLiveChannel_Follow_Category_Loaded); }
public Video_Detail_Player_V2() { InitializeComponent(); disableProgressBar(); setUpApplicationBar(); tvodUltility = new Ultility(); SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Portrait; webClient = new WebClient(); //Request to server to get Image Material webClient.OpenReadCompleted += (s1, e1) => { if (e1.Error == null) { try { bool isSpaceAvailable = IsSpaceIsAvailable(e1.Result.Length); if (isSpaceAvailable) { //Save File To Isolated Storage using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication()) { if (!myIsolatedStorage.DirectoryExists(folder)) { myIsolatedStorage.CreateDirectory(folder); } using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream(folder + "\\" + ImageFileName, FileMode.Create, FileAccess.Write, myIsolatedStorage)) { long imgLen = e1.Result.Length; byte[] b = new byte[imgLen]; e1.Result.Read(b, 0, b.Length); isfs.Write(b, 0, b.Length); isfs.Flush(); isfs.Close(); } } LoadImageFromIsolatedStorage(folder + "\\" + ImageFileName); } else { BitmapImage bmpImg = new BitmapImage(); bmpImg.SetSource(e1.Result); imgVideo.Source = bmpImg; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }; }
private void FixedUpdate() { float x = Input.GetAxis("Horizontal") * speed * rate; float z = Input.GetAxis("Vertical") * speed * rate; Transform t = VRMode ? vr.CameraTransform : transform; Vector3 f = t.forward; f.y = 0; Vector3 r = t.right; r.y = 0; Vector3 tmp = transform.localPosition; Vector3 dir = f * z + r * x; tmp.x += dir.x; tmp.y += dir.y; tmp.z += dir.z; transform.localPosition = tmp; if (VRMode) { bool noInput = x == 0 && z == 0; if (!noInput) { transform.rotation = Quaternion.AngleAxis(Ultility.AbsolutelyAngle(dir), Vector3.up); } if (Input.GetButtonDown("Teleport")) { vr.Teleport(transform.position, transform.forward); } if (Input.GetButtonDown("Resume")) { Vector3 pos = vr.Camera.transform.position; pos.y = vr.transform.position.y + vr.Height; transform.position = pos; Vector3 rot = vr.Camera.transform.rotation.eulerAngles; rot.x = rot.z = 0f; transform.eulerAngles = rot; } } else { float y = Input.GetAxis("Horizontal2"); transform.rotation = transform.rotation * Quaternion.AngleAxis(y, Vector3.up); float head = Input.GetAxis("Vertical2"); CameraBase.transform.localRotation = CameraBase.transform.localRotation * Quaternion.Euler(head, 0, 0); } }
public static bool operator ==(SimpleBitSet one, SimpleBitSet other) { bool?val = Ultility.NullCheck(one, other); if (val != null) { return(val.Value); } return(one.bitset == other.bitset); }
public List_Drama_Activity() { InitializeComponent(); imgCache = new ImageCache(); tvodUltility = new Ultility(); setUpApplicationBar(); enableProgressBar(); btnNewest.Background = new SolidColorBrush(Colors.White); btnNewest.Foreground = new SolidColorBrush(Colors.Black); this.lstDrama.Loaded += new RoutedEventHandler(lstDrama_Loaded); }
public override void BuildVars() { this.Vars = new List <string>(16); for (int i = 0; i < Size1; i++) { for (int j = 0; j < Size2; j++) { Associations[i, j].BuildVars(); Ultility.Union(this.Vars, Associations[i, j].Vars); } } }
private void Start() { VRProxy.OnVRTeleport += () => { Vector3 pos = VRCamera.transform.position; pos.y = transform.position.y + PlayerHeight; Player.transform.position = pos; float cameraAngle = Ultility.AbsolutelyAngle(VRCamera.transform.forward); Player.transform.rotation = Quaternion.AngleAxis(cameraAngle, Vector3.up); }; }
public List_Video_Follow_Child_Category() { InitializeComponent(); imgCache = new ImageCache(); tvodUltility = new Ultility(); setUpApplicationBar(); enableProgressBar(); btnNewest.Background = new SolidColorBrush(Colors.White); btnNewest.Foreground = new SolidColorBrush(Colors.Black); this.lstVideo_Follow_Category.Loaded += new RoutedEventHandler(lstVideo_Follow_Category_Loaded); }
public void Teleport(Vector3 pos, Vector3 forward) { float playerAngle = Ultility.AbsolutelyAngle(forward); float cameraAngle = Ultility.AbsolutelyAngle(VRCamera.transform.forward); float baseAngle = Ultility.AbsolutelyAngle(transform.forward); //transform.rotation = Quaternion.AngleAxis(baseAngle + playerAngle - cameraAngle, Vector3.up); Vector3 diff = pos - VRCamera.transform.position; diff.y = 0f; transform.position += diff; }
public override void Effect(GameObject target) { if (target.tag == "Player") { Player_remove player_speed_control = target.GetComponent <Player_remove>(); player_speed_control.speed = 2.5f; Ultility.SetTimeOut(3000, () => { player_speed_control.speed = 5f; }); } else { NpcWeaponScript npc_speed_control = target.GetComponent <NpcWeaponScript>(); npc_speed_control.speed /= 2; Ultility.SetTimeOut(3000, () => { npc_speed_control.speed *= 2; }); } }
public ActionResult ChooseDistrict() { // if (Request.Cookies["location"] != null && Request.Cookies["locationname"] != null) { ViewBag.location = Int32.Parse(Request.Cookies["location"].Value); ViewBag.locationname = Ultility.convertValueToDistrict(Int32.Parse(Request.Cookies["location"].Value)); } else { ViewBag.location = 0; ViewBag.locationname = "Hà Nội"; } return(View()); }
public void SetSyntaxLanguage(Language language) { FileType ft = language.FileTypes[0] as FileType; LanguageName = ft.Extension.Substring(1).ToUpper(); FileExtension = ft.Name + " (*" + ft.Extension + ")|*" + ft.Extension + "|All File (*.*)|*.*"; this._EditorControl.Document.Parser.Init(language); this.Icon = Ultility.GetIcon(language.Name); if (LanguageChanged != null) { LanguageChanged(this, new LanguageChangedEventArgs(language)); } }
public virtual void SetSyntaxLanguage(string languageName) { try { IHighlightingStrategy strategy = HighlightingStrategyFactory.CreateHighlightingStrategy(languageName); textEditorControl.Document.HighlightingStrategy = strategy; textEditorControl.InitializeAdvancedHighlighter(); ModuleName = strategy.Name; this.Icon = Ultility.GetModuleIcon(languageName); FileExtension = strategy.Name + " (*" + string.Join(";", strategy.Extensions) + ")|*" + string.Join(";", strategy.Extensions) + "|All File (*.*)|*.*"; } catch (HighlightingDefinitionInvalidException ex) { MessageBox.Show(Resources.Error__file_format_is_not_supported_, Common.Ultility.Ultility.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public object ExecStoreToPaging <T>(string storedProcedure, object[] iparam = null, dynamic outParam = null, SqlTransaction transaction = null, bool buffered = true, int?commandTimeout = null) where T : class, new() { SqlConnection connection = new SqlConnection(connectionString); try { connection.Open(); if (tsnTransaction != null) { transaction = tsnTransaction; } var param = Ultility.Converts(iparam); var lst = connection.Query <T>(storedProcedure, param: (object)param, transaction: transaction, buffered: buffered, commandTimeout: commandTimeout ?? 60, commandType: CommandType.StoredProcedure).ToList(); int totalRow = 0; if (lst != null) { List <T> lstT = (List <T>)lst; if (lstT.Count > 0) { T obj = lstT[0]; if (obj.GetType().GetProperty("rowTotal") != null) { totalRow = (int)obj.GetType().GetProperty("rowTotal").GetValue(obj, null); } else { totalRow = lstT.Count; } } } return(new { totalRow = totalRow, lst = lst }); } catch (Exception ex) { throw ex; } finally { connection.Close(); connection.Dispose(); } }
protected void Search_Click(object sender, EventArgs e) { Hashtable htabel = new Hashtable(); if (chkPaName.Checked) { htabel.Add("PaID", Convert.ToInt32(DDLPa.SelectedValue)); } if (chkCell.Checked) { htabel.Add("CellID", Convert.ToInt32(DDLCell.SelectedValue)); } if (chkSunny.Checked) { htabel.Add("SunnyID", Convert.ToInt32(DDLSunny.SelectedValue)); } if (chkLayer.Checked) { htabel.Add("Substring(Code,6,2)", txtLayer.Text.Trim()); } if (chkUse.Checked) { htabel.Add("RoomUseID", Convert.ToInt32(DDLUse.SelectedValue)); } if (chkFormat.Checked) { htabel.Add("RoomFormatID", Convert.ToInt32(DDLFormat.SelectedValue)); } if (chkIndoor.Checked) { htabel.Add("IndoorID", Convert.ToInt32(DDLIndoor.SelectedValue)); } if (rbSale.Checked) { htabel.Add("State", 1); } else { htabel.Add("State", 0); } RoomGridView.DataSource = roombll.GetRoomByCondition(Ultility.GetConditionClause(htabel, false)); RoomGridView.DataBind(); }
public JsonResult OnCreate(string pUserName, string pAvata, int pMarketType, string pEmail, string pFullName, string pMobile, string pSumary, bool pActive = true) { var mMarket = new Market() { Date = DateTime.Now, BirthDay = DateTime.Now, UserName = Ultility.LocDau2(pUserName.Trim()), Avata = pAvata, Email = pEmail, FullName = pFullName, Gender = true, Phone = pMobile, Role = pMarketType, Status = pActive, Sumary = pSumary }; MpStartEntities.AddToMarket(mMarket); MpStartEntities.SaveChanges(); //lay danh sách nhom san pham var mList = ProductsService.getProductTypeParent(); foreach (ProductType it in mList) { MarketProductType mMarketProductType = new MarketProductType() { Date = DateTime.Now, Name = it.Name, Detail = it.Name, Parent = it.ID, Status = true, Visible = true, Number = 1, MarketId = mMarket.ID, MarketName = mMarket.UserName, ImageBanner = it.ImageBanner }; MpStartEntities.AddToMarketProductType(mMarketProductType); } MpStartEntities.SaveChanges(); return(Json(new { code = 1, message = "Lưu cửa hàng thành công." })); }
private void Start() { if (_controller == null) { _controller = GameObject.FindGameObjectWithTag("GameController").GetComponent <Controller>(); } if (!isSun) { transform.position = new Vector3(Random.Range(-20, 20), Random.Range(-20, 20), Random.Range(-20, 20)); MassUnity = Random.Range(1f, 10f); PowerOfTen = Random.Range(20, 26); transform.localScale = new Vector3(PowerOfTen / _controller.SystemMassPoTScale, PowerOfTen / _controller.SystemMassPoTScale, PowerOfTen / _controller.SystemMassPoTScale); GetComponent <Renderer>().material.color = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f)); transform.name = Ultility.nameGenerator(); Velocity = new Vector3(Random.Range(-5f, 5f), Random.Range(-5f, 5f), Random.Range(-5f, 5f)); } _mass = MassUnity * Mathf.Pow(10, PowerOfTen - _controller.SystemMassPoTScale); _controller.AddPlanet(this); }
private void btnUserProfile_Click(object sender, EventArgs e) { try { tvodUltility = new Ultility(); bool isLogin = tvodUltility.checkLogin(); if (isLogin == true) { NavigationService.Navigate(new Uri("/UserProfileActivity_V2.xaml", UriKind.Relative)); } else { (App.Current as App).navigation_tvod = "MAIN_PAGE"; NavigationService.Navigate(new Uri("/LoginActivity.xaml", UriKind.Relative)); } } catch (Exception ex) { Debug.WriteLine(ex.Message); } }