public int CheckDuplicateEmployee_DL(EWA_SetLeave objEWA) { try { prmList = new string[6]; prmList[0] = "@Action"; prmList[1] = "CheckData"; prmList[2] = "@UserCode"; prmList[3] = objEWA.UserCode; prmList[4] = "@OrgId"; prmList[5] = objEWA.OrgId.ToString(); DataSet ds = ObjHelper.FillControl(prmList, "SP_SetLeave"); if (ds.Tables[0].Rows.Count > 0) { return(1); } else { return(0); } } catch (Exception exp) { throw exp; } }
public DataSet BindLeaveTypeGrid_DL(EWA_SetLeave objEWA) { DataSet ds = new DataSet(); try { prmList = new string[4]; prmList[0] = "@Action"; prmList[1] = "SelectLeaveData"; prmList[2] = "@OrgId"; prmList[3] = objEWA.OrgId.ToString(); ds = ObjHelper.FillControl(prmList, "SP_SetLeave"); if (ds.Tables[0].Rows.Count > 0) { return(ds); } } catch (Exception exp) { // GeneralErr(exp.Message.ToString()); throw exp; } return(ds); }
public int CheckDuplicateEmployee_BL(EWA_SetLeave objEWA) { try { int i = objDL.CheckDuplicateEmployee_DL(objEWA); return(i); } catch (Exception exp) { throw exp; } }
//To Call AllEmployeeGridBind #region AllEmployeeGridBind public DataSet AllEmployeeGridBind_BL(EWA_SetLeave objEWA) { try { DataSet ds = objDL.BindAllEmployeeGrid_DL(objEWA); return(ds); } catch (Exception) { throw; } }
//To Call EmployeeGridBind #region EmployeeGridBind public DataSet EmployeeGridBind_BL(EWA_SetLeave objEWA) { try { //DL_EmployeeDeptDes objDL = new DL_EmployeeDeptDes(); DataSet ds = objDL.BindEmployeeGrid_DL(objEWA); return(ds); } catch (Exception) { throw; } }
//To Call LeaveGridBind #region LeaveGridBind public DataSet LeaveTypeGridBind_BL(EWA_SetLeave objEWA) { try { DataSet ds = objDL.BindLeaveTypeGrid_DL(objEWA); return(ds); } catch (Exception) { throw; } finally { objDL = null; } }
//Insert operaeion on Leave Balance Table #region ActionPerformed For LeaveBalance public int SetLeaveAction_BL(EWA_SetLeave objEWA) { try { int flag = objDL.SetLeaveAction_DL(objEWA); return(flag); } catch (Exception ex) { throw ex; } //finally //{ // objDL = null; //} }
//To Perform Insert,Update,Delete and Search Actions On EmpDeptDes Table #region PerformActionsOnLeaveBalance public int SetLeaveAction_DL(EWA_SetLeave objEWA) { try { cmd = new SqlCommand("SP_SetLeave", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Action", objEWA.Action); // cmd.Parameters.AddWithValue("@UserCode", objEWA.UserCode); cmd.Parameters.AddWithValue("@LeaveId", objEWA.LeaveId); cmd.Parameters.AddWithValue("@BalanceLeave", objEWA.BalanceLeave); cmd.Parameters.AddWithValue("@AcademicYearId", objEWA.AcademicYearId); cmd.Parameters.AddWithValue("@OrgId", objEWA.OrgId); cmd.Parameters.AddWithValue("@UserId", objEWA.UserId); cmd.Parameters.AddWithValue("@IsActive", objEWA.IsActive); con.Open(); int flag = cmd.ExecuteNonQuery(); con.Close(); return(flag); } catch (Exception ex) { int err = ((System.Data.SqlClient.SqlException)(ex)).Number; if (err == 547 && objEWA.Action == "Delete") { throw new SystemException("Record is in use !!!"); } else { throw ex; } } //finally //{ // con.Close(); // cmd.Dispose(); //} }
//To Bind AllEmployeeGrid #region BindAllEmployeeGrid public DataSet BindAllEmployeeGrid_DL(EWA_SetLeave objEWA) { DataSet ds = new DataSet(); try { prmList = new string[4]; prmList[0] = "@Action"; prmList[1] = objEWA.Action; prmList[2] = "@OrgId"; prmList[3] = objEWA.OrgId.ToString(); ds = ObjHelper.FillControl(prmList, "SP_SetLeave"); } catch (Exception exp) { // GeneralErr(exp.Message.ToString()); throw exp; } return(ds); }