public static string ConvertUNI2TCV(string strInput) { string res = ""; res = strInput; ConvertFont convert = new ConvertFont(); convert.Convert(ref res, FontIndex.iUNI, FontIndex.iTCV); return(res); }
public static string ConvertVNI2UNI(string s) { convertFont.Convert(ref s, FontIndex.iVNI, FontIndex.iUNI); convertFont.CharCase = FontCase.Normal; return(s.Replace("Aù", "Á").Replace("ø", "").Replace("Uù", "Ú").Replace("©", "")); }
private void PopulateEmployeeListView() { ConvertFont convertFont = new ConvertFont(); lvwEmployeeBarcode.BeginUpdate(); lvwEmployeeBarcode.TableModel.Rows.Clear(); string departmentNM, employeeNM, companyNM = string.Empty, creditCardNM = string.Empty; int STT = 0; string strBarCode; foreach (DataRow dr in dsEmployee.Tables[0].Rows) { departmentNM = dr["DepartmentName"].ToString(); employeeNM = dr["EmployeeName"].ToString(); companyNM = COMPANY_NM; creditCardNM = CREDIT_CARD_NM; //Tieng viet ko dau if (rdbTiengVietKD.Checked) { departmentNM = Utils.RemoveSign4VietnameseString(departmentNM); employeeNM = Utils.RemoveSign4VietnameseString(employeeNM); companyNM = Utils.RemoveSign4VietnameseString(COMPANY_NM); creditCardNM = Utils.RemoveSign4VietnameseString(CREDIT_CARD_NM); } //font: TCVN3(ABC) else if (rdbTCVN3.Checked) { convertFont.Convert(ref departmentNM, FontIndex.iUNI, FontIndex.iTCV); convertFont.Convert(ref employeeNM, FontIndex.iUNI, FontIndex.iTCV); convertFont.Convert(ref companyNM, FontIndex.iUNI, FontIndex.iTCV); convertFont.Convert(ref creditCardNM, FontIndex.iUNI, FontIndex.iTCV); } Cell DepartmentName = new Cell(departmentNM); Cell EmployeeName = new Cell(employeeNM); Cell CompanyName = new Cell(companyNM); Cell CreditCardName = new Cell(creditCardNM); Cell BarCodeNew = new Cell(""); if (dr["BarCode"] != DBNull.Value) { strBarCode = dr["BarCode"].ToString(); if (strBarCode.Length > 0) { //Barcode 8 so if (cboBarCodeType.SelectedIndex == 0) { strBarCode = strBarCode.Substring(5, 8); } //Ma BarCode bo so check code if (!chkCheckCode.Checked) { strBarCode = strBarCode.Substring(0, strBarCode.Length - 1); } BarCodeNew = new Cell(strBarCode); } } Cell CardID = new Cell(dr["CardID"].ToString()); Cell StartDate = new Cell(""); if (dr["StartDate"] != DBNull.Value) { StartDate = new Cell(DateTime.Parse(dr["StartDate"].ToString()).ToString("dd/MM/yyyy")); } Cell ImageFilePath = new Cell(""); if (dr["Picture"] != DBNull.Value) { string PictureFileName = dr["Picture"].ToString(); if (PictureFileName.Equals("")) { ImageFilePath = new Cell(Application.StartupPath + @"\IMAGES\noimage3.jpg"); } else { string PictureFilePath = WorkingContext.Setting.PicturePath + '\\' + dr["Picture"].ToString(); try { ImageFilePath = new Cell(PictureFilePath); } catch { ImageFilePath = new Cell(Application.StartupPath + @"\IMAGES\noimage3.jpg"); } } } else { ImageFilePath = new Cell(Application.StartupPath + "/IMAGES/noimage3.jpg"); } Row rowBarcode = new Row(new Cell[] { new Cell(STT + 1), CompanyName, CreditCardName, CardID, BarCodeNew, EmployeeName, DepartmentName, StartDate, ImageFilePath }); rowBarcode.Tag = STT; lvwEmployeeBarcode.TableModel.Rows.Add(rowBarcode); STT++; } lvwEmployeeBarcode.EndUpdate(); }