public static HR_Overtime GetHR_RowStatusByRowStatusID(int RowStatusID) { HR_Overtime hR_Overtime = new HR_Overtime(); SqlHR_OvertimeProvider sqlHR_OvertimeProvider = new SqlHR_OvertimeProvider(); hR_Overtime = sqlHR_OvertimeProvider.GetHR_OvertimeByRowStatusID(RowStatusID); return hR_Overtime; }
public static HR_Overtime GetHR_OvertimeByOverTimeID(int OverTimeID) { HR_Overtime hR_Overtime = new HR_Overtime(); SqlHR_OvertimeProvider sqlHR_OvertimeProvider = new SqlHR_OvertimeProvider(); hR_Overtime = sqlHR_OvertimeProvider.GetHR_OvertimeByOverTimeID(OverTimeID); return hR_Overtime; }
public static HR_Overtime GetHR_EmployeeByEmployeeID(string EmployeeID) { HR_Overtime hR_Overtime = new HR_Overtime(); SqlHR_OvertimeProvider sqlHR_OvertimeProvider = new SqlHR_OvertimeProvider(); hR_Overtime = sqlHR_OvertimeProvider.GetHR_OvertimeByEmployeeID(EmployeeID); return hR_Overtime; }
protected void btnUpdate_Click(object sender, EventArgs e) { HR_Overtime hR_Overtime = new HR_Overtime (); hR_Overtime.OverTimeID= int.Parse(Request.QueryString["ID"].ToString()); hR_Overtime.EmployeeID= ddlEmployeeID.SelectedValue; hR_Overtime.Date= DateTime.Parse(txtDate.Text); hR_Overtime.Hours= decimal.Parse(txtHours.Text); hR_Overtime.ExtraField1= txtExtraField1.Text; hR_Overtime.ExtraField2= txtExtraField2.Text; hR_Overtime.ExtraField3= txtExtraField3.Text; hR_Overtime.ExtraField4= txtExtraField4.Text; hR_Overtime.ExtraField5= txtExtraField5.Text; hR_Overtime.AddedBy= "530038e1-cf38-4ddb-84a4-99b6974b4f9d"; hR_Overtime.AddedDate= DateTime.Now; hR_Overtime.UpdatedBy= "530038e1-cf38-4ddb-84a4-99b6974b4f9d"; hR_Overtime.UpdateDate= DateTime.Now; hR_Overtime.RowStatusID = 1;//int.Parse(ddlRowStatusID.SelectedValue); bool resutl =HR_OvertimeManager.UpdateHR_Overtime(hR_Overtime); Response.Redirect("AdminDisplayHR_Overtime.aspx"); }
private void showHR_OvertimeData() { HR_Overtime hR_Overtime = new HR_Overtime (); hR_Overtime = HR_OvertimeManager.GetHR_OvertimeByOverTimeID(Int32.Parse(Request.QueryString["ID"])); //ddlEmployeeID.SelectedValue =hR_Overtime.EmployeeID.ToString(); txtDate.Text =hR_Overtime.Date.ToString(); txtHours.Text =hR_Overtime.Hours.ToString(); txtExtraField1.Text =hR_Overtime.ExtraField1.ToString(); txtExtraField2.Text =hR_Overtime.ExtraField2.ToString(); txtExtraField3.Text =hR_Overtime.ExtraField3.ToString(); txtExtraField4.Text =hR_Overtime.ExtraField4.ToString(); txtExtraField5.Text =hR_Overtime.ExtraField5.ToString(); ddlRowStatusID.SelectedValue =hR_Overtime.RowStatusID.ToString(); }
public bool UpdateHR_Overtime(HR_Overtime hR_Overtime) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("UpdateHR_Overtime", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@OverTimeID", SqlDbType.Int).Value = hR_Overtime.OverTimeID; cmd.Parameters.Add("@EmployeeID", SqlDbType.NVarChar).Value = hR_Overtime.EmployeeID; cmd.Parameters.Add("@Date", SqlDbType.DateTime).Value = hR_Overtime.Date; cmd.Parameters.Add("@Hours", SqlDbType.Decimal).Value = hR_Overtime.Hours; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = hR_Overtime.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = hR_Overtime.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = hR_Overtime.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = hR_Overtime.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = hR_Overtime.ExtraField5; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = hR_Overtime.UpdatedBy; cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = hR_Overtime.UpdateDate; cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = hR_Overtime.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public HR_Overtime GetHR_OvertimeFromReader(IDataReader reader) { try { HR_Overtime hR_Overtime = new HR_Overtime ( DataAccessObject.IsNULL<int>(reader["OverTimeID"]), DataAccessObject.IsNULL<string>(reader["EmployeeID"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["Date"]), DataAccessObject.IsNULL<decimal>(reader["Hours"]), DataAccessObject.IsNULL<string>(reader["ExtraField1"]), DataAccessObject.IsNULL<string>(reader["ExtraField2"]), DataAccessObject.IsNULL<string>(reader["ExtraField3"]), DataAccessObject.IsNULL<string>(reader["ExtraField4"]), DataAccessObject.IsNULL<string>(reader["ExtraField5"]), DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]), DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["UpdateDate"]), DataAccessObject.IsNULL<int>(reader["RowStatusID"]) ); return hR_Overtime; } catch(Exception ex) { return null; } }
public static int InsertHR_Overtime(HR_Overtime hR_Overtime) { SqlHR_OvertimeProvider sqlHR_OvertimeProvider = new SqlHR_OvertimeProvider(); return sqlHR_OvertimeProvider.InsertHR_Overtime(hR_Overtime); }
public static bool UpdateHR_Overtime(HR_Overtime hR_Overtime) { SqlHR_OvertimeProvider sqlHR_OvertimeProvider = new SqlHR_OvertimeProvider(); return sqlHR_OvertimeProvider.UpdateHR_Overtime(hR_Overtime); }