Skip to main content

Posts

Showing posts from 2009

Version control for Flex Builder

1. Use Visual SourceSafe: If you're familiar with Microsoft Visual SourceSafe, it's a bit difficult to apply it in your Flex project. But I think you can use it. Just create a Source Safe project to contain all files in your Flex project. After that, check-out the file you want to work and use Flex Builder to edit. Steps: - Install Microsoft Visual SourceSafe to create your project - Add all of your project's folder and files into this project 2. Use Subversion: Method 1: - Install VisualSVN Server to create project repository URL - Install Subclipse - Create Flex project as SVN in File/New/Other... with the repository URL has been created. - Working with version control inside Flex Method 2: - Install VisualSVN Server to create project repository URL - Install TortoiseSVN - Add the folder contains your Flex project into your project repository URL - Working with version control outside Flex 3. Use CVS: I'm not using it frequently, so I'll update it later.

How to move many records have the same value between two grids

private void MoveManyRecords(DataGridView dtL, DataGridView dtR, int iColToCheck) { if (dtL.CurrentCell == null) return; int iCurrentRowIndex = 0, i = 0; int iLastRow = 0; iCurrentRowIndex = dtL.CurrentCell.RowIndex; string strColToCheckValue = dtL[iColToCheck, iCurrentRowIndex].Value.ToString(); int j = 0; while (j < dtL.Rows.Count) { if (dtL[iColToCheck, j].Value.ToString().Equals(strColToCheckValue)) { dtR.Rows.Add(); iLastRow = dtR.Rows.Count - 1; for (i = 0; i < dtL.Columns.Count; i++) { dtR[i, iLastRow].Value = dtL[i, j].Value; } dtR.Rows[iLastRow].Selected = true; dtR.CurrentCell = dtR.Rows...

How to move entire row between two grids

private void MoveRecord(DataGridView dtL, DataGridView dtR) { if (dtL.CurrentCell == null) return; int iCurrentRowIndex = 0, i = 0; int iLastRow = 0; iCurrentRowIndex = dtL.CurrentCell.RowIndex; dtR.Rows.Add(); iLastRow = dtR.Rows.Count - 1; for (i = 0; i { dtR[i, iLastRow].Value = dtL[i, iCurrentRowIndex].Value; } dtR.Rows[iLastRow].Selected = true; dtR.CurrentCell = dtR.Rows[iLastRow].Cells[1]; dtL.Rows.RemoveAt(iCurrentRowIndex); }

15 Firefox add-ons for Web developers

I use FireFox browser everyday to surf web and have installed some of Firefox add-ons for my jobs. Today, I found this article 15 Firefox add-ons for Web developers and I think it's good for us in development. I also created an add-ons for learning Japanese, if you like, you can download at this address https://addons.mozilla.org/en-US/firefox/addon/9645

Six Ways to Ruin Your Resume

I think software developers all over the world is in the difficult time. Some of my friends have been laid off because there's no projects for a long time. They have to write their new resumes and post them to new employers. But, it's not easy if they don't notice Six ways to ruine your resume on CIO.com site.

MSDN Search

It seems that I'm a big fan of Google. I am using most of Google products such as Search, Documents, Spreadsheet, Picasa, Feedburner, etc. Especially, I use Google search every day if I want to know some information about specific topics. When I was a student, I used MSDN to search for code I need. But, nowadays, I use Google search to search on MSDN site www.msdn.microsoft.com. :D I can search MSDN by using Google like that: C# sample site: msdn.microsoft.com However, because of laziness, I have created this gadget to embed to my iGoogle page

Register a service written by .NET

Using Visual Studio Command Prompt In command prompt windows: Register: installutil YourServiceNameWithFullPath Unregister: installutil YourServiceNameWithFullPath /u For example, I created a service named MyService.exe and put in the folder D:\Projects\Services Register: installutil D:\Projects\Services\MyService.exe Unregister: installutil D:\Projects\Services\MyService.exe /u

How to add select all checkbox to DataGridView

//Your DataGridView: dtgrd //Flag to determine select all or not bool bSelectAll = false; if (dtgrd.Controls.Find("chkSelectAll", true).Length > 0) { dtgrd.Controls.RemoveByKey("chkSelectAll"); } if (dtgrd.Rows.Count > 0) { DataGridViewCheckBoxColumn dtChkCol = new DataGridViewCheckBoxColumn(false); dtChkCol.Width = 30; dtChkCol.Resizable = DataGridViewTriState.False; dtChkCol.ReadOnly = false; dtgrd.Columns.Insert(0, dtChkCol); Rectangle rect = dtgrd.GetCellDisplayRectangle(0, -1, true); rect.X = rect.Location.X + (rect.Width / 3); rect.Y = rect.Location.Y + (rect.Height / 3); CheckBox chkSelectAll = new CheckBox(); chkSelectAll.Name = "chkSelectAll"; chkSelectAll.Size = new Size(18, 18); chkSelectAll.Location = rect.Location; chkSelectAll.CheckedChanged += new EventHandler(chkSelectAll_CheckedChanged); chkSelectAll.Checked = false; dtgrd.Controls.Add(chkSelectAll); dtgrd.Columns[lcCheck].Frozen = true; } //Event here private void c...

How to create custom hyperlink field in Salesforce

Salesforce.com allows you to create a custom field with type URL. However, sometimes you may want to create a custom URL for your special requirements. For example, you have a separate application call Human Resource Management (HRM) Your Salesforce application contains a custom field call EmployeeID__c in Contact object Contact tab layout: ------------------------------------------------------- Contact name | EmployeeID| E-mail | ... ------------------------------------------------------- Thao Truong | 000111 | abc@yahoo.com | -------------------------------------------------------- John Peter | 000112 | abc@gmail.com | --------------------------------------------------------- When user clicks on EmployeeID cell, you would like it can be linked to your HRM application with the link like that: http://YourHRM/Employees.aspx?ID=000111 or http://YourHRM/Employees.aspx?ID=000112 In this case, you could create a new custom field EmployeeID...

Get Salesforce Data with Partner WSDL

DataTable GetSforceData(string strSQL, int iBatchSize) { DataTable dt = null; partner.SforceService binding = new partner.SforceService(); string strAccountName = "", strAccountPassword = "", strSecurityToken = ""; //get account name, account password and security token here bll = null; partner.LoginResult lr = binding.login(strAccountName, strAccountPassword + strSecurityToken); if (!lr.passwordExpired) { binding.Url = lr.serverUrl; binding.SessionHeaderValue = new partner.SessionHeader(); binding.SessionHeaderValue.sessionId = lr.sessionId; partner.QueryResult qr = null; binding.QueryOptionsValue = new partner.QueryOptions(); binding.QueryOptionsValue.batchSize = iBatchSize; binding.QueryOptionsValue.batchSizeSpecified = true; qr = binding.query(strSQL); bool done = false; if (qr.size > 0) { dt = new DataTable(); partner.sObject sOtmp = (partner.sObject)qr.records[0]; for ...

Steps to reset security token in Salesforce

Login to Salesforce with your account Select Setup Select My Personal Information Select Reset My Security Token Click the button Reset Security Token An e-mail will be sent to your account with the token, get this token and use it in your application If the security token is not correct, your application may show an error like that: {"INVALID_LOGIN: Invalid username, password, security token; or user locked out."}