예제 #1
0
    protected void OnActionDeleteClicked(object sender, EventArgs e)
    {
        LinkButton lnkItem = (LinkButton)sender;
        int actionID = int.Parse(lnkItem.CommandArgument);
        Neos.Data.Action deleteItem = new Neos.Data.Action(actionID);
        ActionRepository repo = new ActionRepository();
        repo.Delete(deleteItem);

        BindGridData(null);
        gridActions.DataBind();
    }
예제 #2
0
    private Neos.Data.Action GetAction()
    {
        Neos.Data.Action saveItem = new Neos.Data.Action();
        if (!string.IsNullOrEmpty(ddlTypeAction.SelectedValue))
        {
            saveItem.TypeAction = int.Parse(ddlTypeAction.SelectedValue);
            saveItem.TypeActionLabel = ddlTypeAction.Text;
        }
        saveItem.DateCreation = datCreationDate.SelectedDate;
        saveItem.DateAction = datDateAction.SelectedDate;
        saveItem.Hour = radTimeHour.SelectedDate;

        /*if(!string.IsNullOrEmpty(hiddenCompanyId.Value))
            saveItem.CompanyID = int.Parse(hiddenCompanyId.Value);
        if (!string.IsNullOrEmpty(hiddenCandidateId.Value))
            saveItem.CandidateID = int.Parse(hiddenCandidateId.Value);*/
        if (!string.IsNullOrEmpty(ddlCompany.SelectedValue))
        {
            /*saveItem.CandidateFullName = txtCandidate.Text.Trim();
            saveItem.CompanyName = txtCompany.Text.Trim();*/

            saveItem.CompanyID = int.Parse(ddlCompany.SelectedValue);
            saveItem.CompanyName = ddlCompany.Text;
        }
        if (!string.IsNullOrEmpty(ddlCandidate.SelectedValue))
        {
            saveItem.CandidateID = int.Parse(ddlCandidate.SelectedValue);
            saveItem.CandidateFullName = ddlCandidate.Text;
        }
        if (!string.IsNullOrEmpty(ddlContact.SelectedValue) && ddlContact.SelectedValue != "-1")
            saveItem.ContactID = int.Parse(ddlContact.SelectedValue);
        saveItem.ResultCompany = txtCompanyResult.Text.Trim();
        saveItem.ResultCandidate = txtCandidateResult.Text.Trim();
        saveItem.DescrAction = txtDescription.Text.Trim();
        if(!string.IsNullOrEmpty(ddlResponsible.SelectedValue))
            saveItem.Responsable = ddlResponsible.SelectedValue;
        saveItem.LieuRDV = txtAppointmentPlace.Text.Trim();
        saveItem.Actif = chkActive.Checked;
        return saveItem;
    }
 private void CreateAction()
 {
     if (SessionManager.PresentationEmailObject != null)
     {
         PresentationEmailObject emailObject = SessionManager.PresentationEmailObject;
         Neos.Data.Action newAction = new Neos.Data.Action();
         newAction.CandidateID = emailObject.CandidateId;
         newAction.CompanyID = emailObject.CompanyId;
         if(emailObject.ContactId > 0)
             newAction.ContactID = emailObject.ContactId;
         newAction.Responsable = SessionManager.CurrentUser.UserID;
         newAction.DateCreation = DateTime.Today;
         newAction.DateAction = DateTime.Today;
         newAction.Hour = DateTime.Now;
         newAction.Actif = true;
         //action type="CV envoyé"
         ParamTypeAction typeAction = new ParamTypeActionRepository().GetParamTypeActionByLibelle("CV envoyé");
         if(typeAction != null)
             newAction.TypeAction = typeAction.ParamActionID;
         new ActionRepository().Insert(newAction);
     }
 }