/// <summary>
    /// Gets the master data for the Asset or employee dropdown.
    /// </summary>
    private void GetSectionByBranch(int branchId)
    {
        try
        {
            raveHRCollection = new RaveHRCollection();
            //Invoke the object of business layer to call BusinessLayer method.
            objBLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

            //Get the Branchs of rave.
            raveHRCollection = objBLSeatAllocation.GetSectionByBranch(branchId);

            //Bind the dropdown with data.
            RbListSeatAllocation.DataSource     = raveHRCollection;
            RbListSeatAllocation.DataValueField = SectionId;
            RbListSeatAllocation.DataTextField  = SectionName;
            RbListSeatAllocation.DataBind();
        }

        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetMasterDataForBranch", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
        }
    }
示例#2
0
    /// <summary>
    /// Check whether employee allocated to any seat.
    /// </summary>
    /// <param name="employeeId"></param>
    /// <returns></returns>
    public bool CheckEmployeeLocation(int employeeId)
    {
        bool flag = true;

        try
        {
            SeatDetails = new BusinessEntities.SeatAllocation();

            BLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();
            SeatDetails      = BLSeatAllocation.CheckEmployeeLocation(employeeId);

            if (SeatDetails != null)
            {
                flag = false;
                lblConfirmMessage.Text = "<font color=RED >'" + SeatDetails.EmployeeName + "' has been already allocated at Seat No. '" + SeatDetails.SeatName + "'</font>";
            }
            else
            {
                flag = true;
            }
            return(flag);
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "CheckEmployeeLocation", EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
        }
    }
    /// <summary>
    /// Shift the employee  seat location fron one seat to another.
    /// </summary>
    /// <param name="Source"></param>
    /// <param name="Destination"></param>
    /// <returns></returns>
    public bool ShiftLocation(BusinessEntities.SeatAllocation Source, BusinessEntities.SeatAllocation Destination)
    {
        try
        {
            //Invoke the object of business layer to call BusinessLayer method.
            objBLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

            //Create & Invoke the object of BusinessEntities.SeatAllocation to get details of shifted employee.
            BusinessEntities.SeatAllocation EmpDetails = new BusinessEntities.SeatAllocation();

            //Invoke the object of BusinessEntities.SeatAllocation to get the seat deatils of destination.
            seatDetails = new BusinessEntities.SeatAllocation();

            //Invoke the object of BusinessEntities.SeatAllocation to get the seat deatils of source.
            BusinessEntities.SeatAllocation seat = new BusinessEntities.SeatAllocation();

            //call BusinessLayer method to shift the location.
            result = objBLSeatAllocation.ShiftLocation(Source, Destination);
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "ShiftLocation", EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
        }
        return(result);
    }
示例#4
0
    /// <summary>
    /// Gets  employees those are not allocated to any seat.
    /// </summary>
    private void GetMasterData_EmployeeCode()
    {
        try
        {
            List <BusinessEntities.SeatAllocation> ddlObj = new List <BusinessEntities.SeatAllocation>();
            Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation BLobject = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

            //This region will fill the unallocated Employee Code in the employee code drop down.
            ddlObj = BLobject.GetUnAllocatedEmployee();

            ddlEmployeeCode.DataSource     = ddlObj;
            ddlEmployeeCode.DataValueField = DbTableColumn.Seat_EmployeeID;
            ddlEmployeeCode.DataTextField  = DbTableColumn.Seat_EmployeeCode;
            ddlEmployeeCode.DataBind();
            ddlEmployeeCode.Items.Insert(0, new ListItem(SELECTONE, ZERO));
        }

        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetMasterData_LocationDropDown", EventIDConstants.RAVE_HR_PROJECTS_PRESENTATION_LAYER);
        }
    }
示例#5
0
    /// <summary>
    /// Check whether seat is allocated to self(LOGIN USER).
    /// </summary>
    /// <param name="seat"></param>
    /// <returns></returns>
    public bool CheckSelfAllocation(BusinessEntities.SeatAllocation seat)
    {
        try
        {
            BLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

            SeatDetails = new BusinessEntities.SeatAllocation();

            //Get logged in user
            Common.AuthorizationManager.AuthorizationManager objAuMan = new Common.AuthorizationManager.AuthorizationManager();

            string LoggedInuserEmailId = objAuMan.getLoggedInUserEmailId();

            if (LoggedInuserEmailId == seat.EmployeeEmailID)
            {
                result = true;
            }
            return(result);
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, CHECKSELFALLOCATION, EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
        }
    }
示例#6
0
 /// <summary>
 /// Save the employee details.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (btnSave.Text != "Close")
         {
             BusinessEntities.SeatAllocation SeatInfo = new BusinessEntities.SeatAllocation();
             BLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();
             SeatInfo         = getControldata();
             result           = BLSeatAllocation.SaveEmpDetails(SeatInfo);
             if (result)
             {
                 lblConfirmMessage.Visible = true;
                 lblConfirmMessage.Text    = "Details Updated sucessfully";
                 btnSave.Text = "Close";
             }
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "close", "window.close();", true);
         }
     }
     catch (RaveHRException ex)
     {
         LogErrorMessage(ex);
     }
     catch (Exception ex)
     {
         RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "btnSave_Click", EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
         LogErrorMessage(objEx);
     }
 }
    /// <summary>
    /// Swaping seat location.
    /// </summary>
    /// <param name="sourceSeatId"> first seat location</param>
    /// <param name="destinationSeatId"> 2nd seat location</param>
    /// <returns></returns>
    public bool SwapLocation(int sourceSeatId, int destinationSeatId)
    {
        try
        {
            //Check the roles for shifting of loaction.(Only admin can shift the location.)
            if (Rave.HR.BusinessLayer.SeatAllocation.SeatAllocationRoles.CheckRolesSeatAllocation())
            {
                //Invoke the object of business layer to call BusinessLayer method.
                objBLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

                //Invoke the object of BusinessEntities.SeatAllocation to get the seat deatils of source.
                BusinessEntities.SeatAllocation SourceSeatDetails = new BusinessEntities.SeatAllocation();

                //Invoke the object of BusinessEntities.SeatAllocation to get the seat deatils of source.
                BusinessEntities.SeatAllocation DestinationSeatDetails = new BusinessEntities.SeatAllocation();

                //Invoke the object of BusinessEntities.SeatAllocation to get the seat deatils of source.
                BusinessEntities.SeatAllocation Source = new BusinessEntities.SeatAllocation();
                Source.SeatID = sourceSeatId;

                //Invoke the object of BusinessEntities.SeatAllocation to get the seat deatils of source.
                BusinessEntities.SeatAllocation Destination = new BusinessEntities.SeatAllocation();
                Destination.SeatID = destinationSeatId;

                //call BusinessLayer method to shift the location.
                result = objBLSeatAllocation.SwapLocation(Source, Destination);

                //Checks For the sucess of the Shifting and sends the mail.
                if (result)
                {
                    lblMessage.Text = "Seat swapping done successfully";
                }
            }
            else
            {
                lblMessage.Text = "You are not authorised to swap employee's Location.";
                lblMessage.Text = "<font color=RED>" + lblMessage.Text + "</font>";
            }
            //Clear the hidden fields value.
            hdfDragFrom.Value  = string.Empty;
            hdfDragTo.Value    = string.Empty;
            hdfClickedTd.Value = string.Empty;
        }

        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "SwapLocation", EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
        }
        return(result);
    }
示例#8
0
    /// <summary>
    /// Allocate the employee to related(clicked )seat.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAllocate_Click(object sender, EventArgs e)
    {
        try
        {
            if (Convert.ToInt32(ddlEmpAsset.SelectedValue) != 301)
            {
                if (string.IsNullOrEmpty(hfEmpID.Value))
                {
                    hfEmpID.Value = "0";
                }

                if (Convert.ToInt32(hfEmpID.Value) != 0 && Convert.ToInt32(hfSeatID.Value) != 0)
                {
                    if (CheckEmployeeLocation(Convert.ToInt32(hfEmpID.Value)))
                    {
                        SeatDetails      = new BusinessEntities.SeatAllocation();
                        BLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

                        SeatDetails.EmployeeID = Convert.ToInt32(hfEmpID.Value);
                        SeatDetails.SeatID     = Convert.ToInt32(hfSeatID.Value);

                        result = BLSeatAllocation.Allocate(SeatDetails);
                        if (result)
                        {
                            lblConfirmMessage.Visible = true;
                            lblConfirmMessage.Text    = "Details Updated sucessfully";
                            btnAllocate.Visible       = false;
                            btnOK.Visible             = true;
                        }
                    }
                }
                else
                {
                    lblConfirmMessage.Text = "<font color=RED >" + "Select a Proper Employee Code." + "</font>";
                }
            }
            else
            {
                HideControlsForAsset();
                btnAllocate.Visible    = false;
                lblConfirmMessage.Text = "<font color=RED >" + "MODULE UNDER DEVLOPMENT" + "</font>";
            }
        }
        catch (RaveHRException ex)
        {
            LogErrorMessage(ex);
        }
        catch (Exception ex)
        {
            RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "btnAllocate_Click", EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
            LogErrorMessage(objEx);
        }
    }
示例#9
0
 /// <summary>
 /// Get the employee details at a particular seat.
 /// </summary>
 /// <param name="Seat"></param>
 /// <returns></returns>
 public BusinessEntities.SeatAllocation EmployeeDetailsAtSeat(BusinessEntities.SeatAllocation Seat)
 {
     try
     {
         SeatDetails      = new BusinessEntities.SeatAllocation();
         BLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();
         SeatDetails      = BLSeatAllocation.GetEmployeeDetailsForSeat(Seat);
     }
     catch (RaveHRException ex)
     {
         LogErrorMessage(ex);
     }
     catch (Exception ex)
     {
         RaveHRException objEx = new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, EMPLOYEESEATDETAILS, EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
         LogErrorMessage(objEx);
     }
     return(SeatDetails);
 }
    /// <summary>
    /// //Check whether seat is empty or occupied.
    /// </summary>
    /// <param name="seatId"></param>
    /// <returns></returns>
    public bool CheckEmployeeOnSeat(string seatId)
    {
        bool Flag = false;

        try
        {
            objBLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

            //Instantiate the object of BusinessEntities.SeatAllocation to get fetched data.
            BusinessEntities.SeatAllocation fetchedSeatDetails = new BusinessEntities.SeatAllocation();

            //Instantiate the object of BusinessEntities.SeatAllocation to pass seat id as a parameter.
            seatDetails = new BusinessEntities.SeatAllocation();

            //Add the seat id to SeatAllocation BusinessEntities.
            seatDetails.SeatID = Convert.ToInt32(seatId);

            //Call the Business layer method.
            fetchedSeatDetails = objBLSeatAllocation.GetSeatDetailsByID(seatDetails);

            if (fetchedSeatDetails != null)
            {
                //If seat is not vaccant then return true.
                if (fetchedSeatDetails.EmployeeID != 0)
                {
                    Flag = true;
                }
            }
        }

        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "CheckEmployeeOnSeat", EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
        }
        return(Flag);
    }
    /// <summary>
    /// Get the details of a seat.
    /// </summary>
    /// <param name="SeatInformation"></param>
    /// <returns></returns>
    public List <BusinessEntities.SeatAllocation> getSeatDetails(BusinessEntities.SeatAllocation SeatInformation)
    {
        List <BusinessEntities.SeatAllocation> SeatInfo = new List <BusinessEntities.SeatAllocation>();

        try
        {
            //Invoke the object of business layer to call BusinessLayer method.
            objBLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();

            //Call the method of business layer to get seat details
            raveHRCollection = objBLSeatAllocation.GetSeatDetails(SeatInformation);

            //Convert raveHRCollection to List<BusinessEntities.SeatAllocation>.
            for (int i = 0; i < raveHRCollection.Count; i++)
            {
                foreach (List <BusinessEntities.SeatAllocation> SeatDescription in raveHRCollection)
                {
                    foreach (BusinessEntities.SeatAllocation Seat in SeatDescription)
                    {
                        seatDetails = new BusinessEntities.SeatAllocation();
                        seatDetails = (BusinessEntities.SeatAllocation)Seat;
                        SeatInfo.Add(seatDetails);
                    }
                }
            }
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, SEATDETAILS, EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
        }
        return(SeatInfo);
    }
示例#12
0
    /// <summary>
    /// Get the employee name by employee code.
    /// </summary>
    public void GetEmployeeName()
    {
        try
        {
            SeatDetails = new BusinessEntities.SeatAllocation();
            BusinessEntities.SeatAllocation Seat = new BusinessEntities.SeatAllocation();

            BLSeatAllocation = new Rave.HR.BusinessLayer.SeatAllocation.SeatAllocation();
            // SeatDetails.EmployeeCode = tbEmpCode.Text.Trim();
            SeatDetails.EmployeeCode = ddlEmployeeCode.SelectedItem.Text;
            Seat = BLSeatAllocation.GetEmployeeName(SeatDetails);

            hfEmpID.Value  = Seat.EmployeeID.ToString();
            tbEmpName.Text = Seat.EmployeeName;
        }
        catch (RaveHRException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new RaveHRException(ex.Message, ex, Sources.PresentationLayer, CLASS_NAME, "GetEmployeeName", EventIDConstants.RAVE_HR_SEATALLOCATION_PRESENTATION_LAYER);
        }
    }