示例#1
0
       public static SalarySheetItem[] GetSalarySheetItem(int year, int month, Guid DepartmentId)
       {
           object obj = SqlHelper.ExecuteScalar(@"select Id from T_SalarySheet where
                                [email protected] and [email protected] and [email protected]",
                                                            new SqlParameter("@Year", year),
                                                            new SqlParameter("@Month", month),
                                                            new SqlParameter("@DeptId", DepartmentId));
           Guid sheetId = (Guid)obj;

           DataTable table = SqlHelper.ExecuteDataTable("select * from T_SalarySheetItem where [email protected]",
                                            new SqlParameter("@sheetId", sheetId));
           SalarySheetItem[] items = new SalarySheetItem[table.Rows.Count];
           for (int i = 0; i < table.Rows.Count; i++)
           {
               SalarySheetItem item = new SalarySheetItem();
               DataRow row = table.Rows[i];
               item.Id = (Guid)row["Id"];
              item.EmployeeId = (Guid)row["EmployeeId"];
               item.SheetId = (Guid)row["SheetId"];
               item.BaseSalary = (decimal)row["BaseSalary"];
               item.Bonus = (decimal)row["Bonus"];
               item.Fine = (decimal)row["Fine"];
               item.Other = (decimal)row["Other"];

               items[i] = item;
           }
           return items;
       }
示例#2
0
 public static void UpdateSalarySheet(SalarySheetItem item)
 {
     SqlHelper.ExcuteNonQuery(@"update T_SalarySheetItem set [email protected],
               [email protected],[email protected],[email protected] where [email protected]",
                                              new SqlParameter("@BaseSalary",item.BaseSalary),
                                              new SqlParameter("@Bonus",item.Bonus),
                                              new SqlParameter("@Fine",item.Fine),
                                              new SqlParameter("@Other",item.Other),
                                              new SqlParameter("@Id",item.Id));
 }