protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {



            cboPageSize.Items.Add(new ListItem() { Value = Int16.MaxValue.ToString(), Text = "Todos" });
            txtBeginDate.Text = DateTime.Now.Date.AddDays(-30).ToString();
            txtEndDate.Text = DateTime.Now.Date.AddDays(1).ToString();

            //
            // select user in combo if user logged is technical user
            //
            var humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            //if (employee != null)
            //{
            //    if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
            //        cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
            //}


        }
    }
예제 #2
0
        protected void lisAdditionalInformation_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            //
            // When a item come to the reader, it automatically searchs the AdditionalInformationData
            // to fill the ComboBox with the related value.
            //
            DropDownList          cboOrg   = e.Item.Controls[5] as DropDownList;
            HumanResourcesManager hManager = new HumanResourcesManager(this);

            cboOrg.DataSource     = hManager.GetAdditionalInformationData(Company.CompanyId, Convert.ToInt32((e.Item.Controls[1] as Label).Text));
            cboOrg.DataTextField  = "Name";
            cboOrg.DataValueField = "AddonInfoDataId";
            cboOrg.DataBind();
            //
            // If the form are in the update mode, the combobox will bind to the correct value, automatically
            //
            if (employeeId != null)
            {
                EmployeeAdditionalInformation addInfo = hManager.GetEmployeeAdditionalInformation
                                                        (
                    Company.CompanyId,
                    Convert.ToInt32((e.Item.Controls[1] as Label).Text),
                    employeeId
                                                        );
                if (addInfo != null)
                {
                    cboOrg.SelectedValue = addInfo.AddonInfoDataId.ToString();
                }
            }
        }
예제 #3
0
    private void SetVendorValue(Customer customer)
    {
        var      humanResourcesManager = new HumanResourcesManager(this);
        Employee employee = new Employee();

        if (customer.SalesPersonId.HasValue)
        {
            lblVendor.Text = customer.Employee.Profile.Name;
            Page.ViewState["SalesPersonId"] = customer.SalesPersonId;
            cboVendors.Attributes["Style"]  = "display:None";
        }
        else
        {
            pnlShowVendor.Attributes["Style"] = "display:None";
        }
        if (customer.SupplementalSalesPersonId.HasValue)
        {
            lblSupplementalVendor.Text = customer.Employee1.Profile.Name;
            Page.ViewState["supplementalSalesPersonId"] = customer.SupplementalSalesPersonId;
            cboSupplementalVendor.Attributes["Style"]   = "display:None";
        }
        else
        {
            pnlShowSupplementalVendor.Attributes["Style"] = "display:None";
        }
        if (customer.SalesPersonCommission.HasValue)
        {
            ucVendorComission.CurrencyValue = customer.SalesPersonCommission;
        }
        if (customer.SupplementalSalesPersonCommission.HasValue)
        {
            ucSupplementalVendorComission.CurrencyValue = customer.SupplementalSalesPersonCommission;
        }
    }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(rtvCompetencyValue.SelectedValue) < 0)
            {
                ShowError(Exception.UnselectedEmployee);
                return;
            }

            var humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployee(Company.CompanyId,
                                                            Convert.ToInt32(rtvCompetencyValue.SelectedValue));
            if (employee == null)
            {
                ShowError(Exception.unavailableEmployee);
                return;
            }

            humanResourcesManager.SetEmployeeCompetency(employee,
                                                  ucCurrFieldPurchaseCeilingValue.CurrencyValue,
                                                  rbtCentralBuyer.Checked);

            rtvCompetencyValue.DataBind();

            pnlPurchaseCeilingValue.Visible = false;
            ucCurrFieldPurchaseCeilingValue.CurrencyValue = null;
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        

        txtEmployee.Enabled = Enabled;
        _humanResourcesManager = new HumanResourcesManager(this);
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        humanResourcesManager = new HumanResourcesManager(this);
        organizationLevel = new OrganizationLevel();

        if (treeOL.SelectedNode != null)
        {

            OrganizationLevel original_organizationLevel = humanResourcesManager.GetOrganizationLevel(Company.CompanyId,
                Convert.ToInt32(treeOL.SelectedNode.Value));
            organizationLevel.CopyPropertiesFrom(original_organizationLevel);

            organizationLevel.Parentid = null;
            organizationLevel.Name = txtOL.Text.ToUpper();

            if (!String.IsNullOrEmpty(cboTreeOL.SelectedValue))
                organizationLevel.Parentid = Convert.ToInt32(cboTreeOL.SelectedValue);

            humanResourcesManager.UpdateOrganizationLevel(original_organizationLevel, organizationLevel);
        }
        else
        {
            organizationLevel.CompanyId = Company.CompanyId;
            organizationLevel.Name = txtOL.Text.ToUpper();
            organizationLevel.Parentid = null;

            if (!String.IsNullOrEmpty(cboTreeOL.SelectedValue))
                organizationLevel.Parentid = Convert.ToInt32(cboTreeOL.SelectedValue);

            humanResourcesManager.InsertOrganizationLevel(organizationLevel);
        }
        BindTree();
    }
예제 #7
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(rtvCompetencyValue.SelectedValue) < 0)
            {
                ShowError(Exception.UnselectedEmployee);
                return;
            }

            var      humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployee(Company.CompanyId,
                                                                  Convert.ToInt32(rtvCompetencyValue.SelectedValue));

            if (employee == null)
            {
                ShowError(Exception.unavailableEmployee);
                return;
            }

            humanResourcesManager.SetEmployeeCompetency(employee,
                                                        ucCurrFieldPurchaseCeilingValue.CurrencyValue,
                                                        rbtCentralBuyer.Checked);

            rtvCompetencyValue.DataBind();

            pnlPurchaseCeilingValue.Visible = false;
            ucCurrFieldPurchaseCeilingValue.CurrencyValue = null;
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ucDateTimeInterval.DateInterval = new DateTimeInterval(DateTime.Now.Date.AddDays(-30), DateTime.Now.Date.AddDays(1));

            cboTechnicalUser.DataBind();

            //
            // select user in combo if user logged is technical user
            //
            var humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            if (employee != null)
            {
                if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
                    cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
            }

            if (Page.Customization["cboCustomerCallType"] != null)
                cboCustomerCallType.SelectedIndex = Convert.ToInt32(Page.Customization["cboCustomerCallType"]);

            if (Page.Customization["cboStatus"] != null)
                cboStatus.SelectedIndex = Convert.ToInt32(Page.Customization["cboStatus"]);

            if (Page.Customization["cboPageSize"] != null)
                cboPageSize.SelectedIndex = Convert.ToInt32(Page.Customization["cboPageSize"]);

            if (Page.Customization["cboTechnicalUser"] != null && cboTechnicalUser.Items.FindByValue(Convert.ToString(Page.Customization["cboTechnicalUser"])) != null)
                cboTechnicalUser.SelectedValue = Convert.ToString(Page.Customization["cboTechnicalUser"]);
        }
    }
예제 #9
0
        protected void grdDependents_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            var originalDependent     = humanResourcesManager.GetEmployeeDependent(Convert.ToInt32(grdDependents.DataKeys[e.RowIndex]["EmployeeDependentId"]));
            var dependent             = new EmployeeDependent();

            if (originalDependent != null)
            {
                dependent.CopyPropertiesFrom(originalDependent);
            }

            dependent.FamilyTree = (grdDependents.Rows[e.RowIndex].FindControl("txtUpdateFamilyTree") as TextBox).Text;
            dependent.Name       = (grdDependents.Rows[e.RowIndex].FindControl("txtUpdateName") as TextBox).Text;

            if (!String.IsNullOrEmpty((grdDependents.Rows[e.RowIndex].FindControl("txtUpdateBirthDate") as TextBox).Text))
            {
                dependent.BirthDate = Convert.ToDateTime((grdDependents.Rows[e.RowIndex].FindControl("txtUpdateBirthDate") as TextBox).Text);
            }

            humanResourcesManager.UpdateEmployeeDependent(originalDependent, dependent);

            grdDependents.EditIndex = -1;
            grdDependents.DataBind();

            e.Cancel = true;
        }
예제 #10
0
 public ClientResponse FindEmployees(string q, int limit)
 {
     return(new ClientResponse(() =>
     {
         using (var humanResourcesManager = new HumanResourcesManager(null))
             return humanResourcesManager.SearchEmployees(Company.CompanyId, q, limit).ToArray();
     }));
 }
예제 #11
0
 public void BindTree()
 {
     humanResourcesManager = new HumanResourcesManager(this);
     treeOL.DataSource     = humanResourcesManager.GetAllOrganizationLevelToDataTable((int)Company.CompanyId);
     treeOL.DataBind();
     treeOL.ExpandAllNodes();
     txtOL.Text = String.Empty;
     cboTreeOL.SelectedValue = String.Empty;
 }
 protected void grdEmployeeStatusHistory_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     var humanResourcesManager = new HumanResourcesManager(this);
     humanResourcesManager.DeleteStatusHistory(
         humanResourcesManager.GetEmployeeStatusHistory(
         Convert.ToInt16(grdEmployeeStatusHistory.DataKeys[e.RowIndex]["StatusHistoryId"])));
     e.Cancel = true;
     grdEmployeeStatusHistory.DataBind();
 }
예제 #13
0
    /// <summary>
    /// this method return the available employee
    /// </summary>
    private void LoadAvailableTechnicalEmployee()
    {
        var employeeManager = new HumanResourcesManager(this);

        cboTechnicalEmployee.Items.Clear();
        cboTechnicalEmployee.DataSource = employeeManager.GetAvailableTechnicalAsDataTable(Company.CompanyId, Convert.ToDateTime(txtInitialTime.Text), Convert.ToDateTime(txtEndTime.Text));
        cboTechnicalEmployee.Items.Add("");
        cboTechnicalEmployee.DataBind();
    }
 public void BindTree()
 {
     humanResourcesManager = new HumanResourcesManager(this);
     treeOL.DataSource = humanResourcesManager.GetAllOrganizationLevelToDataTable((int)Company.CompanyId);
     treeOL.DataBind();
     treeOL.ExpandAllNodes();
     txtOL.Text = String.Empty;
     cboTreeOL.SelectedValue = String.Empty;
 }
예제 #15
0
    protected void grdEmployeeStatusHistory_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        var humanResourcesManager = new HumanResourcesManager(this);

        humanResourcesManager.DeleteStatusHistory(
            humanResourcesManager.GetEmployeeStatusHistory(
                Convert.ToInt16(grdEmployeeStatusHistory.DataKeys[e.RowIndex]["StatusHistoryId"])));
        e.Cancel = true;
        grdEmployeeStatusHistory.DataBind();
    }
예제 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            humanResourcesManager            = new HumanResourcesManager(this);
            Session["lstEmployee"]           = humanResourcesManager.GetEmployeeByCompanyAsList(Company.CompanyId);
            grdEmployeeWorkedTime.DataSource = (List <Employee>)Session["lstEmployee"];

            grdEmployeeWorkedTime.DataBind();
        }
    }
        protected void rtvCompetencyValue_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployee(Company.CompanyId,
                                                            Convert.ToInt32(rtvCompetencyValue.SelectedValue));

            if (employee == null)
                return;

            pnlPurchaseCeilingValue.Visible = Convert.ToInt32(rtvCompetencyValue.SelectedValue) > 0;
            rbtCentralBuyer.Checked = employee.CentralBuyer ?? false;
        }
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            humanResourcesManager = new HumanResourcesManager(this);
            Session["lstEmployee"] = humanResourcesManager.GetEmployeeByCompanyAsList(Company.CompanyId);
            grdEmployeeWorkedTime.DataSource = (List<Employee>)Session["lstEmployee"];

            grdEmployeeWorkedTime.DataBind();

        }
    }
예제 #19
0
        private void AddAlertWhenPostCommentInCustomerCall(Comment comment)
        {
            if (comment.PageName.ToLower() == "customercall.aspx")
            {
                var alertManager    = new AlertManager(this);
                var customerManager = new CustomerManager(this);

                var call = customerManager.GetCustomerCall(comment.SubjectId);

                //
                // defines Alert description
                //
                string alertDescription = string.Format(@"
                    No chamado <a href='javascript:;' 
                                  onclick=""top.$.LightBoxObject.show('CRM/CustomerCall.aspx?lightbox[iframe]=true&CustomerCallId={0}&ReadOnly=true&ModalPopup=1')"" 
                                  target='content'>{1}</a>, {2} disse: {3} &nbsp;&nbsp;&nbsp;&nbsp;<br />
                    <center>
                        <a href='javascript:;' onclick='$(this).next().show()'>Clique aqui para responder!</a>
                        <iframe id=""comments"" style='display:none' src='../app_shared/comments.aspx?id={4}&pageName=customercall.aspx'>
                    </center>", call.CustomerCallId.ToString(),
                                                        call.CallNumber,
                                                        comment.UserName,
                                                        comment.Description.Shortly(140),
                                                        comment.SubjectId);

                //
                // Send alert to CreatorUser from CustomerCall
                //
                if (call.UserId.HasValue)
                {
                    if (call.User.Profile.AbreviatedName != comment.UserName) // Don't alert yourself
                    {
                        alertManager.InsertAlert(call.UserId.Value, alertDescription);
                    }
                }


                //
                // Send alert to Technical
                //
                if (call.TechnicalEmployeeId.HasValue)
                {
                    var  humanResourcesManager = new HumanResourcesManager(this);
                    User user = humanResourcesManager.GetUserByEmployee(call.TechnicalEmployeeId.Value);
                    if (user != null && user.Profile.AbreviatedName != comment.UserName) // Don't alert yourself
                    {
                        alertManager.InsertAlert(user.UserId, alertDescription);
                    }
                }
            }
        }
예제 #20
0
        protected void rtvCompetencyValue_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
            var      humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployee(Company.CompanyId,
                                                                  Convert.ToInt32(rtvCompetencyValue.SelectedValue));

            if (employee == null)
            {
                return;
            }

            pnlPurchaseCeilingValue.Visible = Convert.ToInt32(rtvCompetencyValue.SelectedValue) > 0;
            rbtCentralBuyer.Checked         = employee.CentralBuyer ?? false;
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            var competency = new EmployeeCompetency();

            string skillName = txtSkillName.Text.Trim().ToCapitalize();
            competency.Name = skillName;
            competency.EmployeeId = employeeId;
            competency.CompanyId = Company.CompanyId;
            competency.Rating = rtnRanking.CurrentRating;

            humanResourcesManager.SaveEmployeeCompetency(competency);
            txtSkillName.Text = String.Empty;
            rtnRanking.CurrentRating = 0;
            grdCompetency.DataBind();
        }
예제 #22
0
    protected void lnkDelete_Command(object sender, CommandEventArgs e)
    {
        if (e.CommandName == "select")
        {
            var node = treeOL.FindNodeByValue(e.CommandArgument.ToString()) ?? new RadTreeNode();

            cboTreeOL.SelectedValue = String.Empty;

            if (node.ParentNode != null)
            {
                cboTreeOL.SelectedValue = node.ParentNode.Value;
            }

            txtOL.Text = node.Text;
        }

        if (e.CommandName == "delete")
        {
            humanResourcesManager = new HumanResourcesManager(this);
            organizationLevel     = humanResourcesManager.GetOrganizationLevel(Company.CompanyId,
                                                                               Convert.ToInt32(e.CommandArgument));

            if (organizationLevel != null)
            {
                IQueryable <OrganizationLevel> childOrganizationLevelList;
                childOrganizationLevelList = humanResourcesManager.GetChildOrganizationLevel(Company.CompanyId, organizationLevel.OrganizationlevelId);

                if (childOrganizationLevelList.Count() != 0)
                {
                    ShowError(Resources.Exception.DeletingRegisterWithForeignKey);
                    return;
                }
                else
                {
                    try
                    {
                        humanResourcesManager.DeleteOrganizationLevel(organizationLevel);
                        BindTree();
                    }
                    catch (Exception)
                    {
                        ShowError(Resources.Exception.DeletingRegisterWithForeignKey);
                    }
                }
            }
        }
    }
예제 #23
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            var competency            = new EmployeeCompetency();

            string skillName = txtSkillName.Text.Trim().ToCapitalize();

            competency.Name       = skillName;
            competency.EmployeeId = employeeId;
            competency.CompanyId  = Company.CompanyId;
            competency.Rating     = rtnRanking.CurrentRating;

            humanResourcesManager.SaveEmployeeCompetency(competency);
            txtSkillName.Text        = String.Empty;
            rtnRanking.CurrentRating = 0;
            grdCompetency.DataBind();
        }
예제 #24
0
    public static bool DeleteEmployee(int companyId, int employeeId)
    {
        bool result = true;

        using (var humanResourcesManager = new HumanResourcesManager(null))
        {
            try
            {
                humanResourcesManager.DeleteEmployee(companyId, employeeId);
            }
            catch (System.Data.SqlClient.SqlException e)
            {
                result = false;
            }
        }
        return(result);
    }
예제 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        humanResourcesManager = new HumanResourcesManager(this);

        if (!IsPostBack)
        {
            //
            //retrieve the customerId from Modal Popup
            //
            if (Request["EmployeeId"] != null)
                Page.ViewState["EmployeeId"] = Request["EmployeeId"];
        }
        if (Page.ViewState["EmployeeId"] != null)
        {
            originalEmployee = humanResourcesManager.GetEmployee(Company.CompanyId, Convert.ToInt32(Page.ViewState["EmployeeId"]));
        }    
    }
예제 #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
#warning a atribuição a essa variável de sessão é temporária e deverá ser revista; ela é utilizada na prospectBuilder.aspx.cs
            Session["BudgetId"] = null;

            Int32    tmp = 0;
            ListItem listItem;
            cboPageSize.Items.Add(new ListItem()
            {
                Value = Int16.MaxValue.ToString(), Text = "Todos"
            });
            rbtstatus.Items.Add(new ListItem("Todos", ""));
            rbtstatus.Items.Add(new ListItem("Abertos", Convert.ToInt32(BudgetStatus.Open).ToString()));
            rbtstatus.Items.Add(new ListItem("Enviados", Convert.ToInt32(BudgetStatus.SentToCustomer).ToString()));
            rbtstatus.Items.Add(new ListItem("Aceito", Convert.ToInt32(BudgetStatus.Accepted).ToString()));
            rbtstatus.Items.Add(new ListItem("Não aceito", Convert.ToInt32(BudgetStatus.Rejected).ToString()));

            if (!String.IsNullOrEmpty(Convert.ToString(Page.Customization["cboPageSize"])))
            {
                listItem = cboPageSize.Items.FindByValue(Convert.ToString(Page.Customization["cboPageSize"]));
                if (listItem != null)
                {
                    cboPageSize.SelectedValue = listItem.Value;
                }
            }

            if (!String.IsNullOrEmpty(Convert.ToString(Page.Customization["rbtStatus"])))
            {
                listItem = rbtstatus.Items.FindByValue(Convert.ToString(Page.Customization["rbtStatus"]));
                if (listItem != null)
                {
                    rbtstatus.SelectedValue = listItem.Value;
                }
            }

            //
            // Load SalesPerson to the DropDownList
            //
            var humanResourcesManager = new HumanResourcesManager(this);
            cboVendor.DataSource = humanResourcesManager.GetSalesPerson(Company.CompanyId);
            cboVendor.DataBind();
        }
    }
    protected void lnkDelete_Command(object sender, CommandEventArgs e)
    {
        if (e.CommandName == "select")
        {
            var node = treeOL.FindNodeByValue(e.CommandArgument.ToString()) ?? new RadTreeNode();

            cboTreeOL.SelectedValue = String.Empty;

            if (node.ParentNode != null)
                cboTreeOL.SelectedValue = node.ParentNode.Value;
          
            txtOL.Text = node.Text;
        }

        if (e.CommandName == "delete")
        {
            humanResourcesManager = new HumanResourcesManager(this);
            organizationLevel = humanResourcesManager.GetOrganizationLevel(Company.CompanyId,
                Convert.ToInt32(e.CommandArgument));

            if (organizationLevel != null)
            {
                IQueryable<OrganizationLevel> childOrganizationLevelList;
                childOrganizationLevelList = humanResourcesManager.GetChildOrganizationLevel(Company.CompanyId, organizationLevel.OrganizationlevelId);

                if (childOrganizationLevelList.Count() != 0)
                {
                    ShowError(Resources.Exception.DeletingRegisterWithForeignKey);
                    return;
                }
                else
                {
                    try
                    {
                        humanResourcesManager.DeleteOrganizationLevel(organizationLevel);
                        BindTree();
                    }
                    catch (Exception)
                    {
                        ShowError(Resources.Exception.DeletingRegisterWithForeignKey);
                    }
                }
            }
        }
    }
예제 #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        humanResourcesManager = new HumanResourcesManager(this);

        if (!IsPostBack)
        {
            //
            //retrieve the customerId from Modal Popup
            //
            if (Request["EmployeeId"] != null)
            {
                Page.ViewState["EmployeeId"] = Request["EmployeeId"];
            }
        }
        if (Page.ViewState["EmployeeId"] != null)
        {
            originalEmployee = humanResourcesManager.GetEmployee(Company.CompanyId, Convert.ToInt32(Page.ViewState["EmployeeId"]));
        }
    }
예제 #29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ucDateTimeInterval.DateInterval = new DateTimeInterval(DateTime.Now.Date.AddDays(-30), DateTime.Now.Date.AddDays(1));

            cboTechnicalUser.DataBind();

            //
            // select user in combo if user logged is technical user
            //
            var      humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            if (employee != null)
            {
                if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
                {
                    cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
                }
            }

            if (Page.Customization["cboCustomerCallType"] != null)
            {
                cboCustomerCallType.SelectedIndex = Convert.ToInt32(Page.Customization["cboCustomerCallType"]);
            }

            if (Page.Customization["cboStatus"] != null)
            {
                cboStatus.SelectedIndex = Convert.ToInt32(Page.Customization["cboStatus"]);
            }

            if (Page.Customization["cboPageSize"] != null)
            {
                cboPageSize.SelectedIndex = Convert.ToInt32(Page.Customization["cboPageSize"]);
            }

            if (Page.Customization["cboTechnicalUser"] != null && cboTechnicalUser.Items.FindByValue(Convert.ToString(Page.Customization["cboTechnicalUser"])) != null)
            {
                cboTechnicalUser.SelectedValue = Convert.ToString(Page.Customization["cboTechnicalUser"]);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        manager = new HumanResourcesManager(this);
        employee = new Employee();

        if (!String.IsNullOrEmpty(Request["ServiceOrderId"]))
            serviceOrderId = Convert.ToInt32(Request["ServiceOrderId"]);

        if (!IsPostBack)
        {
            ResetAgenda();
            selDate.DateTime = radAppointment.SelectedDate = DateTime.Today;
        }

        radAppointment.GroupBy = "";
        radAppointment.ReadOnly = false;
        radAppointment.Width = Unit.Percentage(100);
        radAppointment.SelectedDate = DateTime.Today;
    }
예제 #31
0
    protected void Page_Load(object sender, EventArgs e)
    {
        manager  = new HumanResourcesManager(this);
        employee = new Employee();

        if (!String.IsNullOrEmpty(Request["ServiceOrderId"]))
        {
            serviceOrderId = Convert.ToInt32(Request["ServiceOrderId"]);
        }

        if (!IsPostBack)
        {
            ResetAgenda();
            selDate.DateTime = radAppointment.SelectedDate = DateTime.Today;
        }

        radAppointment.GroupBy      = "";
        radAppointment.ReadOnly     = false;
        radAppointment.Width        = Unit.Percentage(100);
        radAppointment.SelectedDate = DateTime.Today;
    }
예제 #32
0
        protected void grdDependents_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            var originalDependent = humanResourcesManager.GetEmployeeDependent(Convert.ToInt32(grdDependents.DataKeys[e.RowIndex]["EmployeeDependentId"]));
            var dependent = new EmployeeDependent();

            if (originalDependent != null)
                dependent.CopyPropertiesFrom(originalDependent);

            dependent.FamilyTree = (grdDependents.Rows[e.RowIndex].FindControl("txtUpdateFamilyTree") as TextBox).Text;
            dependent.Name = (grdDependents.Rows[e.RowIndex].FindControl("txtUpdateName") as TextBox).Text;

            if (!String.IsNullOrEmpty((grdDependents.Rows[e.RowIndex].FindControl("txtUpdateBirthDate") as TextBox).Text))
                dependent.BirthDate = Convert.ToDateTime((grdDependents.Rows[e.RowIndex].FindControl("txtUpdateBirthDate") as TextBox).Text);

            humanResourcesManager.UpdateEmployeeDependent(originalDependent, dependent);

            grdDependents.EditIndex = -1;
            grdDependents.DataBind();

            e.Cancel = true;
        }
예제 #33
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

#warning a atribuição a essa variável de sessão é temporária e deverá ser revista; ela é utilizada na prospectBuilder.aspx.cs
            Session["BudgetId"] = null;

            Int32 tmp = 0;
            ListItem listItem;
            cboPageSize.Items.Add(new ListItem() { Value = Int16.MaxValue.ToString(), Text = "Todos" });
            rbtstatus.Items.Add(new ListItem("Todos", ""));
            rbtstatus.Items.Add(new ListItem("Abertos", Convert.ToInt32(BudgetStatus.Open).ToString()));
            rbtstatus.Items.Add(new ListItem("Enviados", Convert.ToInt32(BudgetStatus.SentToCustomer).ToString()));
            rbtstatus.Items.Add(new ListItem("Aceito", Convert.ToInt32(BudgetStatus.Accepted).ToString()));
            rbtstatus.Items.Add(new ListItem("Não aceito", Convert.ToInt32(BudgetStatus.Rejected).ToString()));

            if (!String.IsNullOrEmpty(Convert.ToString(Page.Customization["cboPageSize"])))
            {
                listItem = cboPageSize.Items.FindByValue(Convert.ToString(Page.Customization["cboPageSize"]));
                if (listItem != null)
                    cboPageSize.SelectedValue = listItem.Value;
            }

            if (!String.IsNullOrEmpty(Convert.ToString(Page.Customization["rbtStatus"])))
            {
                listItem = rbtstatus.Items.FindByValue(Convert.ToString(Page.Customization["rbtStatus"]));
                if (listItem != null)
                    rbtstatus.SelectedValue = listItem.Value;
            }

            //
            // Load SalesPerson to the DropDownList
            //
            var humanResourcesManager = new HumanResourcesManager(this);
            cboVendor.DataSource = humanResourcesManager.GetSalesPerson(Company.CompanyId);
            cboVendor.DataBind();
        }
    }
예제 #34
0
        protected void btnAddDependent_Click(object sender, ImageClickEventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            var dependent             = new EmployeeDependent();

            dependent.Name       = txtName.Text;
            dependent.FamilyTree = txtFamilyTree.Text;
            dependent.BirthDate  = ucDtBirthDate.DateTime.Value;

            dependent.EmployeeId = employeeId;
            dependent.CompanyId  = Company.CompanyId;

            humanResourcesManager.InsertEmployeeDependent(dependent);

            //
            // Clear fields
            //

            txtName.Text           = string.Empty;
            txtFamilyTree.Text     = string.Empty;
            ucDtBirthDate.DateTime = null;

            grdDependents.DataBind();
        }
예제 #35
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            cboPageSize.Items.Add(new ListItem()
            {
                Value = Int16.MaxValue.ToString(), Text = "Todos"
            });
            txtBeginDate.Text = DateTime.Now.Date.AddDays(-30).ToString();
            txtEndDate.Text   = DateTime.Now.Date.AddDays(1).ToString();

            //
            // select user in combo if user logged is technical user
            //
            var      humanResourcesManager = new HumanResourcesManager(this);
            Employee employee = humanResourcesManager.GetEmployeeByProfile((Int32)User.Identity.ProfileId, Company.CompanyId);

            //if (employee != null)
            //{
            //    if (cboTechnicalUser.Items.FindByValue(User.Identity.UserId.ToString()) != null)
            //        cboTechnicalUser.SelectedValue = User.Identity.UserId.ToString();
            //}
        }
    }
예제 #36
0
        protected void btnAddDependent_Click(object sender, ImageClickEventArgs e)
        {
            var humanResourcesManager = new HumanResourcesManager(this);
            var dependent = new EmployeeDependent();

            dependent.Name = txtName.Text;
            dependent.FamilyTree = txtFamilyTree.Text;
            dependent.BirthDate = ucDtBirthDate.DateTime.Value;

            dependent.EmployeeId = employeeId;
            dependent.CompanyId = Company.CompanyId;

            humanResourcesManager.InsertEmployeeDependent(dependent);

            //
            // Clear fields
            //

            txtName.Text = string.Empty;
            txtFamilyTree.Text = string.Empty;
            ucDtBirthDate.DateTime = null;

            grdDependents.DataBind();
        }
예제 #37
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        humanResourcesManager = new HumanResourcesManager(this);
        organizationLevel     = new OrganizationLevel();

        if (treeOL.SelectedNode != null)
        {
            OrganizationLevel original_organizationLevel = humanResourcesManager.GetOrganizationLevel(Company.CompanyId,
                                                                                                      Convert.ToInt32(treeOL.SelectedNode.Value));
            organizationLevel.CopyPropertiesFrom(original_organizationLevel);

            organizationLevel.Parentid = null;
            organizationLevel.Name     = txtOL.Text.ToUpper();

            if (!String.IsNullOrEmpty(cboTreeOL.SelectedValue))
            {
                organizationLevel.Parentid = Convert.ToInt32(cboTreeOL.SelectedValue);
            }

            humanResourcesManager.UpdateOrganizationLevel(original_organizationLevel, organizationLevel);
        }
        else
        {
            organizationLevel.CompanyId = Company.CompanyId;
            organizationLevel.Name      = txtOL.Text.ToUpper();
            organizationLevel.Parentid  = null;

            if (!String.IsNullOrEmpty(cboTreeOL.SelectedValue))
            {
                organizationLevel.Parentid = Convert.ToInt32(cboTreeOL.SelectedValue);
            }

            humanResourcesManager.InsertOrganizationLevel(organizationLevel);
        }
        BindTree();
    }
예제 #38
0
        /// <summary>
        /// This method inserts a Purchase Request and its Items
        /// </summary>
        /// <param name="purchaseRequest">Can't be null</param>
        /// <param name="purchaseRequestItems">Can't be null</param>
        public void SavePurchaseRequest(PurchaseRequest purchaseRequest, List <PurchaseRequestItem> purchaseRequestItems)
        {
            int purchaseRequestId = purchaseRequest.PurchaseRequestId;

            if (purchaseRequestId > 0)
            {
                purchaseRequest =
                    DbContext.PurchaseRequests.Where(p => p.PurchaseRequestId == purchaseRequestId).FirstOrDefault();
                DbContext.PurchaseRequestItems.DeleteAllOnSubmit(purchaseRequest.PurchaseRequestItems);
            }

            purchaseRequest.ModifiedDate = DateTime.Now;

            DbContext.PurchaseRequests.InsertOnSubmit(purchaseRequest);
            DbContext.SubmitChanges();

            foreach (PurchaseRequestItem item in purchaseRequestItems)
            {
                if (Convert.ToBoolean(item.Product.RequiresAuthorization))
                {
                    var  humanResourcesManager = new HumanResourcesManager(this);
                    User user = humanResourcesManager.GetCentralBuyer(purchaseRequest.CompanyId);
                    new AlertManager(this).InsertAlert(
                        user.UserId,
                        "Há requisição de produtos centralizados, <a href='Purchasing/PurchaseRequests.aspx' target='content'>clique aqui</a> para analisá-la!");

                    return;
                }

                item.PurchaseRequestId = purchaseRequest.PurchaseRequestId;
                item.CompanyId         = purchaseRequest.CompanyId;
                //item.Detach();
                DbContext.PurchaseRequestItems.InsertOnSubmit(item.Detach());
            }
            DbContext.SubmitChanges();
        }
예제 #39
0
        public IList GetPurchaseRequestItemsByCompany(Int32 companyId, Int32 employeeId, String sortExpression,
                                                      Int32 startRowIndex, Int32 maximumRows)
        {
            Employee employee = new HumanResourcesManager(this).GetEmployee(companyId, employeeId);

            if (employee == null)
            {
                return(null);
            }

            IQueryable <PurchaseRequestItem> purchaseRequestItems = DbContext.PurchaseRequestItems;

            if (!employee.PurchaseCeilingValue.HasValue) //if he can't buy just get his itens
            {
                purchaseRequestItems =
                    DbContext.PurchaseRequestItems.Where(pi => pi.PurchaseRequest.EmployeeId == employeeId);
            }

            //group of products
            var products = from purchaseRequestItem in purchaseRequestItems
                           join purchaseRequest in DbContext.PurchaseRequests on purchaseRequestItem.PurchaseRequestId
                           equals purchaseRequest.PurchaseRequestId
                           join purchaseOrder in DbContext.PurchaseOrders on purchaseRequestItem.PurchaseOrderId equals
                           purchaseOrder.PurchaseOrderId into gPurchaseOrder
                           from purchaseOrder in gPurchaseOrder.DefaultIfEmpty()
                           join purchaseOrderStatus in DbContext.PurchaseOrderStatus on
                           purchaseOrder.PurchaseOrderStatusId equals purchaseOrderStatus.PurchaseOrderStatusId into
                           gPurchaseOrderStatus
                           from purchaseOrderStatus in gPurchaseOrderStatus.DefaultIfEmpty()
                           join address in DbContext.Addresses on purchaseRequest.PostalCode equals address.PostalCode
                           into gAddress
                           from address in gAddress.DefaultIfEmpty()
                           join product in DbContext.Products on purchaseRequestItem.ProductId equals product.ProductId
                           where purchaseRequest.CompanyId == companyId && !purchaseRequest.ProductId.HasValue
                           orderby purchaseRequest.PurchaseRequestId descending
                           select new
            {
                product.ProductId,
                Name =
                    product.Name + " - " + (purchaseRequestItem.ProductPackage.Name ?? "") + " - " +
                    (purchaseRequestItem.ProductManufacturer.Name ?? ""),
                purchaseRequest.PurchaseRequestId,
                purchaseRequestItem.PurchaseRequestItemId,
                purchaseRequestItem.ProductManufacturerId,
                purchaseRequestItem.ProductPackageId,
                purchaseOrder.PurchaseOrderCode,
                PurchaseOrderId     = (int?)purchaseOrder.PurchaseOrderId,
                PurchaseOrderStatus = purchaseOrderStatus.Name,
                City         = address.NeighborhoodEntity.City.Name,
                CityId       = (int?)address.NeighborhoodEntity.City.CityId,
                CostCenter   = purchaseRequest.CostCenter.Name,
                CategoryName = product.Category.Name,
                purchaseRequestItem.Amount
            };

            var products2 = from purchaseRequest in DbContext.PurchaseRequests
                            join purchaseOrder in DbContext.PurchaseOrders on
                            purchaseRequest.PurchaseRequestItems.FirstOrDefault().PurchaseOrderId equals
                            purchaseOrder.PurchaseOrderId into gPurchaseOrder
                            from purchaseOrder in gPurchaseOrder.DefaultIfEmpty()
                            join purchaseOrderStatus in DbContext.PurchaseOrderStatus on
                            purchaseOrder.PurchaseOrderStatusId equals purchaseOrderStatus.PurchaseOrderStatusId
                            into gPurchaseOrderStatus
                            from purchaseOrderStatus in gPurchaseOrderStatus.DefaultIfEmpty()
                            join address in DbContext.Addresses on purchaseRequest.PostalCode equals address.PostalCode
                            into gAddress
                            from address in gAddress.DefaultIfEmpty()
                            join product in DbContext.Products on purchaseRequest.ProductId equals product.ProductId
                                where purchaseRequest.CompanyId == companyId && purchaseRequest.ProductId.HasValue
                            orderby purchaseRequest.PurchaseRequestId descending
                            select new
            {
                product.ProductId,
                product.Name,
                purchaseRequest.PurchaseRequestId,
                PurchaseRequestItemId = 0,
                ProductManufacturerId = (int?)null,
                ProductPackageId      = (int?)null,
                purchaseOrder.PurchaseOrderCode,
                PurchaseOrderId     = (int?)purchaseOrder.PurchaseOrderId,
                PurchaseOrderStatus = purchaseOrderStatus.Name,
                City         = address.NeighborhoodEntity.City.Name,
                CityId       = (int?)address.NeighborhoodEntity.City.CityId,
                CostCenter   = purchaseRequest.CostCenter.Name,
                CategoryName = product.Category.Name,
                Amount       = (decimal?)purchaseRequest.Amount
            };
            var list = products.ToList();

            list.AddRange(products2.ToList());
            return(list);
        }
예제 #40
0
    /// <summary>
    /// load data of budget for report
    /// </summary>
    public void loadDataOfBudget()
    {
        if (budget != null)
        {
            var humanResourcesManager = new HumanResourcesManager(this);

            lblProspectNumber.Text = "<b>Número da proposta :&nbsp;&nbsp;&nbsp;</b>" + budget.BudgetCode + "<br /><br />";
            if (budget.VendorId.HasValue)
            {
                lblVendor.Text = "<b>Vendedor:</b>&nbsp;&nbsp;&nbsp;" + humanResourcesManager.GetEmployee(Company.CompanyId, Convert.ToInt32(budget.VendorId)).Profile.Name + "<br /><br />";
            }
            //contact

            if (!String.IsNullOrEmpty(budget.ContactName))
            {
                lblContactName.Text = "Aos cuidados.: " + budget.ContactName + "<br/><br/>";
            }



            //show or hide the fieldset of supply
            bool showSupplierFieldset = true;
            if (!string.IsNullOrEmpty(budget.DeliveryDate))
            {
                lblEntrega.Text    = budget.DeliveryDate;
                lblEntrega.Visible = lblDeliveryText.Visible = true;
            }
            else
            {
                showSupplierFieldset = lblEntrega.Visible = lblDeliveryText.Visible = false;
            }


            if (!string.IsNullOrEmpty(budget.Warranty))
            {
                lblGarantia.Text   = budget.Warranty;
                lblEntrega.Visible = lblWarrantText.Visible = true;
            }
            else
            {
                showSupplierFieldset = lblEntrega.Visible = lblWarrantText.Visible = false;
            }

            if (!String.IsNullOrEmpty(budget.ExpirationDate.ToString()))
            {
                lblValidade.Text            = budget.ExpirationDate.ToString() + " dia(s)";
                lblProspectValidate.Visible = lblValidade.Visible = true;
            }
            else
            {
                showSupplierFieldset = lblProspectValidate.Visible = lblValidade.Visible = false;
            }

            if (!String.IsNullOrEmpty(budget.PaymentMethod))
            {
                lblPagamento.Text    = budget.PaymentMethod;
                lblPagamento.Visible = lblpayment.Visible = lblPaymentAditional.Visible = true;
            }
            else
            {
                showSupplierFieldset = lblPagamento.Visible = lblpayment.Visible = lblPaymentAditional.Visible = false;
            }

            if (!String.IsNullOrEmpty(budget.DeliveryDescription))
            {
                lblDeliveryDescription.Text    = budget.DeliveryDescription;
                lblDeliveryDescription.Visible = lblDeliveryDescriptionText.Visible = true;
            }
            else
            {
                showSupplierFieldset = lblDeliveryDescription.Visible = lblDeliveryDescriptionText.Visible = false;
            }
            //set the visible of supply Fieldset
            pnlDelivery.Visible = showSupplierFieldset;

            lblOBS.Text = budget.Observation.Replace("\n", "<br>");

            //lblContato.Text = budget.ContactName;
            tblObs.Visible = budget.Observation.Length > 0;

            lblCover.Text   = budget.Cover;
            lblSummary.Text = budget.Summary;

            lblAditional.Text = String.Format("{0:f}", budget.AdditionalCost.ToString());
        }
        else
        {
            pnlDelivery.Visible = false;
        }
    }
예제 #41
0
 public IEnumerable <HumanResourcesManager.EmployeeAbsenceCount> GetAbsenceCount(DateTime initialDate, DateTime finalDate, Int32 limit)
 {
     return(HumanResourcesManager.GetEmployeeAbsenceCount(initialDate, finalDate, limit));
 }
        /// <summary>
        /// This method update one CustomerCall.
        /// </summary>
        /// <param name=entity>original_entity</param>
        /// <param name=entity>entity</param>
        public void UpdateCustomerCall(CustomerCall original_entity, CustomerCall entity)
        {
            if (original_entity.CustomerCallStatusId == CustomerCallStatus.Closed)
                entity.ClosedDate = DateTime.Now;

            if (!original_entity.TechnicalEmployeeId.HasValue && entity.TechnicalEmployeeId.HasValue &&
                original_entity.UserId.HasValue)
            {
                var manager = new AlertManager(this);
                Employee employee = new HumanResourcesManager(this).GetEmployee(entity.CompanyId,
                                                                                (int)entity.TechnicalEmployeeId);

                manager.InsertAlert(entity.UserId.Value,
                                    "Olá " + original_entity.User.Profile.FirstName + ", prazer!<br /> Meu nome é " +
                                    employee.Profile.AbreviatedName +
                                    " e sou o responsável pelo seu chamado, que está em análise!");
            }

            SetCustomerCallPriority(entity);
            original_entity.CopyPropertiesFrom(entity);
            original_entity.ModifiedDate = DateTime.Now;
            DbContext.SubmitChanges();
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="companyId"></param>
 /// <returns></returns>
 public DataTable GetTechnicalUserAsDataTable(Int32 companyId)
 {
     var employeeManager = new HumanResourcesManager(this);
     var query = from employee in employeeManager.GetTechnicalEmployee(companyId)
                 join profile in DbContext.Profiles on employee.ProfileId equals profile.ProfileId
                 join user in DbContext.Users on profile.ProfileId equals user.ProfileId
                 select new
                            {
                                profile.Name,
                                user.UserId
                            };
     return query.ToDataTable();
 }
예제 #44
0
 protected void Page_Load(object sender, EventArgs e)
 {
     txtEmployee.Enabled    = Enabled;
     _humanResourcesManager = new HumanResourcesManager(this);
 }
예제 #45
0
 public GenderCounter GetGenderCount(DateTime initialDate, DateTime finalDate)
 {
     return(HumanResourcesManager.GetGenderCount(initialDate, finalDate));
 }
예제 #46
0
 public IEnumerable <HumanResourcesManager.EmployeeCountByIntervalLine> GetEmployeeCountByInterval(DateTime initialDate, DateTime finalDate, TimeIntervalType timeInterval)
 {
     return(HumanResourcesManager.GetEmployeeCountByInterval(initialDate, finalDate, timeInterval));
 }
    private void SetVendorValue(Customer customer)
    {
        var humanResourcesManager = new HumanResourcesManager(this);
        Employee employee = new Employee();

        if (customer.SalesPersonId.HasValue)
        {
            lblVendor.Text = customer.Employee.Profile.Name;
            Page.ViewState["SalesPersonId"] = customer.SalesPersonId;
            cboVendors.Attributes["Style"] = "display:None";
        }
        else
            pnlShowVendor.Attributes["Style"] = "display:None";
        if (customer.SupplementalSalesPersonId.HasValue)
        {

            lblSupplementalVendor.Text = customer.Employee1.Profile.Name;
            Page.ViewState["supplementalSalesPersonId"] = customer.SupplementalSalesPersonId;
            cboSupplementalVendor.Attributes["Style"] = "display:None";

        }
        else
            pnlShowSupplementalVendor.Attributes["Style"] = "display:None";
        if (customer.SalesPersonCommission.HasValue)
            ucVendorComission.CurrencyValue = customer.SalesPersonCommission;
        if (customer.SupplementalSalesPersonCommission.HasValue)
            ucSupplementalVendorComission.CurrencyValue = customer.SupplementalSalesPersonCommission;
    }
 protected void lisAdditionalInformation_ItemDataBound(object sender, DataListItemEventArgs e)
 {
     //
     // When a item come to the reader, it automatically searchs the AdditionalInformationData
     // to fill the ComboBox with the related value.
     //
     DropDownList cboOrg = e.Item.Controls[5] as DropDownList;
     HumanResourcesManager hManager = new HumanResourcesManager(this);
     cboOrg.DataSource = hManager.GetAdditionalInformationData(Company.CompanyId, Convert.ToInt32((e.Item.Controls[1] as Label).Text));
     cboOrg.DataTextField = "Name";
     cboOrg.DataValueField = "AddonInfoDataId";
     cboOrg.DataBind();
     //
     // If the form are in the update mode, the combobox will bind to the correct value, automatically
     //
     if (employeeId != null)
     {
         EmployeeAdditionalInformation addInfo = hManager.GetEmployeeAdditionalInformation
             (
             Company.CompanyId,
             Convert.ToInt32((e.Item.Controls[1] as Label).Text),
             employeeId
             );
         if (addInfo != null)
             cboOrg.SelectedValue = addInfo.AddonInfoDataId.ToString();
     }
 }
예제 #49
0
    /// <summary>
    /// load data of budget for report
    /// </summary>
    public void loadDataOfBudget()
    {


        if (budget != null)
        {
            var humanResourcesManager = new HumanResourcesManager(this);

            lblProspectNumber.Text = "<b>Número da proposta :&nbsp;&nbsp;&nbsp;</b>" + budget.BudgetCode + "<br /><br />";
            if (budget.VendorId.HasValue)
                lblVendor.Text = "<b>Vendedor:</b>&nbsp;&nbsp;&nbsp;" + humanResourcesManager.GetEmployee(Company.CompanyId, Convert.ToInt32(budget.VendorId)).Profile.Name + "<br /><br />";
            //contact

            if (!String.IsNullOrEmpty(budget.ContactName))
                lblContactName.Text = "Aos cuidados.: " + budget.ContactName + "<br/><br/>";



            //show or hide the fieldset of supply
            bool showSupplierFieldset = true;
            if (!string.IsNullOrEmpty(budget.DeliveryDate))
            {
                lblEntrega.Text = budget.DeliveryDate;
                lblEntrega.Visible = lblDeliveryText.Visible = true;
            }
            else
                showSupplierFieldset = lblEntrega.Visible = lblDeliveryText.Visible = false;


            if (!string.IsNullOrEmpty(budget.Warranty))
            {
                lblGarantia.Text = budget.Warranty;
                lblEntrega.Visible = lblWarrantText.Visible = true;
            }
            else
                showSupplierFieldset = lblEntrega.Visible = lblWarrantText.Visible = false;

            if (!String.IsNullOrEmpty(budget.ExpirationDate.ToString()))
            {
                lblValidade.Text = budget.ExpirationDate.ToString() + " dia(s)";
                lblProspectValidate.Visible = lblValidade.Visible = true;
            }
            else
                showSupplierFieldset = lblProspectValidate.Visible = lblValidade.Visible = false;

            if (!String.IsNullOrEmpty(budget.PaymentMethod))
            {
                lblPagamento.Text = budget.PaymentMethod;
                lblPagamento.Visible = lblpayment.Visible = lblPaymentAditional.Visible = true;
            }
            else
                showSupplierFieldset = lblPagamento.Visible = lblpayment.Visible = lblPaymentAditional.Visible = false;

            if (!String.IsNullOrEmpty(budget.DeliveryDescription))
            {
                lblDeliveryDescription.Text = budget.DeliveryDescription;
                lblDeliveryDescription.Visible = lblDeliveryDescriptionText.Visible = true;
            }
            else
                showSupplierFieldset = lblDeliveryDescription.Visible = lblDeliveryDescriptionText.Visible = false;
            //set the visible of supply Fieldset
            pnlDelivery.Visible = showSupplierFieldset;

            lblOBS.Text = budget.Observation.Replace("\n", "<br>");

            //lblContato.Text = budget.ContactName;
            tblObs.Visible = budget.Observation.Length > 0;

            lblCover.Text = budget.Cover;
            lblSummary.Text = budget.Summary;

            lblAditional.Text = String.Format("{0:f}", budget.AdditionalCost.ToString());
        }
        else
            pnlDelivery.Visible = false;
    }
 /// <summary>
 /// this method return the available employee 
 /// </summary>
 private void LoadAvailableTechnicalEmployee()
 {
     var employeeManager = new HumanResourcesManager(this);
     cboTechnicalEmployee.Items.Clear();
     cboTechnicalEmployee.DataSource = employeeManager.GetAvailableTechnicalAsDataTable(Company.CompanyId, Convert.ToDateTime(txtInitialTime.Text), Convert.ToDateTime(txtEndTime.Text));
     cboTechnicalEmployee.Items.Add("");
     cboTechnicalEmployee.DataBind();
 }
 public ClientResponse FindEmployees(string q, int limit)
 {
     return new ClientResponse(() =>
     {
         using (var humanResourcesManager = new HumanResourcesManager(null))
             return humanResourcesManager.SearchEmployees(Company.CompanyId, q, limit).ToArray();
     });
 }
        public InsertCompanyStatus InsertUser(int companyId, User user, Profile profile, int? depositId)
        {
            //
            // If ProfileId equal 0 then the profile no exists in bd
            //
            var pManager = new ProfileManager(this);
            if (profile.ProfileId == 0)
                pManager.Insert(profile);

            //
            //method to insert a new user
            //
            var provider = Membership.Provider as VivinaMembershipProvider;
            MembershipCreateStatus status;
            var membershipManager = new MembershipManager(this);
            user.ProfileId = profile.ProfileId;
            membershipManager.Insert(user, out status, provider.RequiresValidEmail);
            //
            //verify if the status of the inclusion is ok
            //
            if (status != MembershipCreateStatus.Success)
            {
                DataManager.Rollback();
                switch (status)
                {
                    case MembershipCreateStatus.InvalidPassword:
                        return InsertCompanyStatus.InvalidPassword;
                    case MembershipCreateStatus.DuplicateEmail:
                        return InsertCompanyStatus.DuplicatedAdminEmail;
                }
            }

            //
            // Associate the User with company
            //
            AssociateUser(companyId, user.UserId, depositId, true);

            //
            // Insert a Employee
            //
            var humanResourcesManager = new HumanResourcesManager(this);
            var employee = new Employee();
            employee.IsActive = true;
            employee.ProfileId = profile.ProfileId;
            employee.CompanyId = companyId;
            humanResourcesManager.InsertEmployee(employee, new List<EmployeeAdditionalInformation>());

            return InsertCompanyStatus.Success;
        }
예제 #53
0
 public Double GetEmployeeMovementCount(DateTime initialDate, DateTime finalDate)
 {
     return(HumanResourcesManager.GetHumanResourcesSpendings(initialDate, finalDate));
 }
예제 #54
0
 public IEnumerable <HumanResourcesManager.OvertimeHourCount> GetOvertimeHoursCount(DateTime initialDate, DateTime finalDate, Int32 limit)
 {
     return(HumanResourcesManager.GetOvertimeHourCount(initialDate, finalDate, limit));
 }