日期:2014-05-18 浏览次数:20545 次
private void LoadEmployeeData() { M_Employee employee= new M_Employee(); employee.Where.Resign_date.Operator = WhereParameter.Operand.IsNull; if (employee.Query.Load()) { lblWarning.Visible = false; HtmlTableRow r; do { r = new HtmlTableRow(); for (int i = 0; i < 18; i++) { r.Cells.Add(GetTableCell(employee, i)); } tblData.Rows.Add(r); } while (employee.MoveNext()); } else { lblWarning.Visible = true; lblWarning.Text = "No Data found!"; } } private HtmlTableCell GetTableCell(M_Employee obj, int column) { HtmlTableCell c; c = new HtmlTableCell(); switch (column) { case 0: if (Master.Level > 1) { c.InnerHtml = "<a href=\"javascript:OpenPopup('600','480','EditEmployee.aspx" + "?employeeid=" + obj.Employee_id + "');\">" + obj.Employee_id + "</a>"; } else c.InnerText = obj.Employee_id; break; case 1: c.InnerText = selectCompanyName(obj.Company_id); break; case 2: c.InnerText = selectDepartmentName(obj.Department_id); break; case 3: c.InnerText = selectDivisionName(obj.Division_id); break; case 4: c.InnerText = selectGroupName(obj.Group_id); break; case 5: c.InnerText = obj.Last_name.Trim() + obj.First_name.Trim(); break; case 6: if (obj.Sex) c.InnerText = "男"; else c.InnerText = "女"; break; case 7: c.InnerText = obj.Ablity; break; case 8: c.InnerText = obj.Duty; break; case 9: if (obj.s_Married == string.Empty) c.InnerHtml = " "; else if (obj.Married) c.InnerText = "已婚"; else c.InnerText = "未婚"; break; case 10: c.InnerText = obj.Degree.Trim(); break; case 11: if (obj.IsColumnNull(M_Employee.ColumnNames.Birthday)) c.InnerHtml = " "; else c.InnerText = obj.Birthday.ToString("yyyy/MM/dd"); break; case 12: c.InnerText = obj.Telephone.Trim(); break; case 13: c.InnerText = obj.Mobile; break; case 14: c.InnerText = obj.Address.Trim(); break; case 15: if (obj.s_Transtype == string.Empty) c.InnerHtml = " "; else if (obj.Transtype == 0) c.InnerText = "不坐班车"; else if (obj.Transtype == 1) c.InnerText = "坐班车"; break; case 16: