protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["Id"] == null) { Response.Redirect("~/Pages/User/ShowConnections.aspx"); } else { Guid profileId = new Guid(Request.QueryString["Id"]); MembershipUser CurrentUser = Membership.GetUser(); if (CurrentUser == null) { Response.Redirect($"~/Pages/Common/MainLogin.aspx"); } Guid VisitorId = (Guid)((Membership.GetUser()).ProviderUserKey); DataTable dt = SkillBLL.GetByUserID(profileId); gv_Skills.DataSource = dt; gv_Skills.DataKeyNames = new string[] { "SkillId" }; gv_Skills.DataBind(); dt.PrimaryKey = new DataColumn[] { dt.Columns["SkillId"] }; lbl_Discription.Visible = false; } } }
protected void gv_Skills_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { string SkillId = gv_Skills.DataKeys[e.NewSelectedIndex].Values[0].ToString(); Guid profileId = new Guid(Request.QueryString["Id"]); MembershipUser CurrentUser = Membership.GetUser(); if (CurrentUser == null) { Response.Redirect($"~/Pages/Common/MainLogin.aspx"); } Guid VisitorId = (Guid)((Membership.GetUser()).ProviderUserKey); bool endorsed = EndorsementBLL.CheckEndorsement(SkillId, VisitorId, profileId); bool samePerson = String.Equals(VisitorId, profileId); if (samePerson) { lbl_Discription.Text = "User Can`t Endorse himself"; lbl_Discription.Visible = true; } else if (endorsed) { SkillBLL.De_Endorse(SkillId); EndorsementBLL.RemovebyParams(SkillId, VisitorId, profileId); Response.Redirect($"~/Pages/User/UserProfile.aspx?Id={profileId}"); } else { SkillBLL.Endorse(SkillId); EndorsementBLL.Add(SkillId, VisitorId, profileId); Response.Redirect($"~/Pages/User/UserProfile.aspx?Id={profileId}"); } }
protected void gv_skills_RowUpdating(object sender, GridViewUpdateEventArgs e) { string SkillId = gv_skills.DataKeys[e.RowIndex].Values[0].ToString(); DropDownList ddl_newSkillLvl = ((DropDownList)gv_skills.Rows[e.RowIndex].FindControl("ddl_newSkill")); TextBox txtSkillName = ((TextBox)gv_skills.Rows[e.RowIndex].FindControl("txt_newSkillName")); SkillBLL.Update(txtSkillName.Text, ddl_newSkillLvl.SelectedValue, SkillId); Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri); }
protected void gv_skills_RowDeleting(object sender, GridViewDeleteEventArgs e) { string SkillId = gv_skills.DataKeys[e.RowIndex].Values[0].ToString(); //Delete from Database SkillBLL.Remove(SkillId); Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri); }
/// <summary> /// The constructor of the Skills controller. /// </summary> public SkillsController( ILogger <SkillsController> logger, IMapper mapper, SkillBLL bll ) { this.logger = logger; this.mapper = mapper; this.bll = bll; }
protected void gv_skills_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { //gv_skills.DataSource = (DataTable)ViewState["SkillsDT"]; //gv_skills.DataBind(); string SkillId = gv_skills.DataKeys[e.NewSelectedIndex].Values[0].ToString(); string SkillName = gv_skills.DataKeys[e.NewSelectedIndex].Values[1].ToString(); //MembershipUser CurrentUser = Membership.GetUser(); //if (CurrentUser == null) { Response.Redirect($"~/Pages/Users/Login.aspx"); } //Guid UserId = (Guid)((Membership.GetUser()).ProviderUserKey); DataTable dt = SkillBLL.GetSkillEndorsers(SkillId); gv_Endorsers.DataSource = dt; //gv_skills.DataKeyNames = new string[] { "SkillId", "SkillName" }; gv_Endorsers.DataBind(); lbl_skillName.Text = SkillName; lbl_skillName.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MembershipUser CurrentUser = Membership.GetUser(); if (CurrentUser == null) { Response.Redirect($"~/Pages/Common/MainLogin.aspx"); } Guid UserId = (Guid)((Membership.GetUser()).ProviderUserKey); DataTable dt = SkillBLL.GetByUserID(UserId); gv_skills.DataSource = dt; gv_skills.DataKeyNames = new string[] { "SkillId", "SkillName" }; gv_skills.DataBind(); dt.PrimaryKey = new DataColumn[] { dt.Columns["SkillId"] }; ViewState["SkillsDT"] = dt; lbl_skillName.Visible = false; } }
protected void btn_addSkill_Click(object sender, EventArgs e) { MembershipUser CurrentUser = Membership.GetUser(); if (CurrentUser == null) { Response.Redirect($"~/Pages/Common/MainLogin.aspx"); } Guid UserId = (Guid)((Membership.GetUser()).ProviderUserKey); string skillName = txt_SkillName.Text; string skillLevelId = ddl_SkillLevel.SelectedValue; int rAff = SkillBLL.Add(skillName, skillLevelId, UserId); if (rAff > 0) { lbl_message.Text = "Skill Added Successfully"; lbl_message.Visible = true; } if (Request.QueryString["Redirect"] == "MyProfile") { Response.Redirect($"~/Pages/User/MyProfile.aspx"); } }
public IActionResult Index() { personBLL = new PersonBLL(); var modelPerson = personBLL.GetPerson(); if (modelPerson == null) { return(NotFound()); } else { ViewBag.Person = modelPerson; } //Education educationBLL = new EducationBLL(); var modelEducation = educationBLL.GetCollectionEducation(); if (modelEducation == null) { return(NotFound()); } else { ViewBag.Education = modelEducation; } //Experience experienceBLL = new ExperienceBLL(); var modelExperience = experienceBLL.GetCollectionExperience(); if (modelExperience == null) { return(NotFound()); } else { ViewBag.Experience = modelExperience; } //Skill Coding skillBLL = new SkillBLL(); var modelSkillCode = skillBLL.GetCollectionSkillsByType("C"); if (modelSkillCode == null) { return(NotFound()); } else { ViewBag.SkillsCoding = modelSkillCode; } //Skill Others var modelSkillOthers = skillBLL.GetCollectionSkillsByType("O"); if (modelSkillOthers == null) { return(NotFound()); } else { ViewBag.SkillsOthers = modelSkillOthers; } //Pricing Freelancer Skill pricingSkillBLL = new PricingBLL(); var modelPricing = pricingSkillBLL.GetPricingByType("FL"); if (modelPricing == null) { return(NotFound()); } else { ViewBag.PricingSkillFreelancer = modelPricing; } //Pricing Freelancer Skills Collection var modelPSCollection = pricingSkillBLL.GetCollectionPricingSkill("FL"); if (modelPSCollection == null) { return(NotFound()); } else { ViewBag.PricingSkillCollectionFreelancer = modelPSCollection; } //Pricing Fulltime Skill var modelPricingFullTime = pricingSkillBLL.GetPricingByType("FT"); if (modelPricingFullTime == null) { return(NotFound()); } else { ViewBag.PricingSkillFulltime = modelPricingFullTime; } //Pricing FullTime Skills Collection var modelPSFullTimeCollection = pricingSkillBLL.GetCollectionPricingSkill("FT"); if (modelPSFullTimeCollection == null) { return(NotFound()); } else { ViewBag.PricingSkillCollectionFulltime = modelPSFullTimeCollection; } //Project Work projectWorkBLL = new ProjectWorkBLL(); var modelProjectWork = projectWorkBLL.GetCollectionProjectWorkFactory(); if (modelProjectWork == null) { return(NotFound()); } else { ViewBag.ProjectWorkCollection = modelProjectWork; } //Comments commentBLL = new CommentBLL(); var modelComment = commentBLL.GetCollectionComment(); if (modelComment == null) { return(null); } else { ViewBag.Comments = modelComment; } //Contacts contactBLL = new ContactBLL(); var modelContact = contactBLL.GetCollectionContact(); if (modelContact == null) { return(null); } else { ViewBag.Contacts = modelContact; } return(View()); }
public RJMMutation( DocumentBLL documentBLL, DocumentTypeBLL documentTypeBLL, ResumeBLL resumeBLL, ResumeStateBLL resumeStateBLL, SkillBLL skillBLL, SkillAliasBLL skillAliasBLL, JobBLL jobBLL, JobStateBLL jobStateBLL ) { this.AuthorizeWith("Authorized"); // Documents //FieldAsync<DocumentType>( // "createDocument", // arguments: new QueryArguments( // new QueryArgument<NonNullGraphType<DocumentInputType>> // { // Name = "document" // } // ), // resolve: async context => // { // Document document = context.GetArgument<Document>("document"); // return await context.TryAsyncResolve( // async c => await documentBLL.CreateDocumentAsync(document) // ); // } //); FieldAsync <GraphQLTypes.DocumentType>( "updateDocument", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <GraphQLTypes.DocumentInputType> > { Name = "document" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); Document document = context.GetArgument <Document>("document"); return(await context.TryAsyncResolve( async c => await documentBLL.UpdateDocumentAsync(document) )); } ); FieldAsync <GraphQLTypes.DocumentType>( "linkResumeToDocument", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <DocumentResumeInputType> > { Name = "documentResume" } ), resolve: async context => { DocumentResume documentResume = context.GetArgument <DocumentResume>("documentResume"); return(await context.TryAsyncResolve( async c => await documentBLL.LinkResumeToDocumentAsync(documentResume) )); } ); FieldAsync <GraphQLTypes.DocumentType>( "unlinkResumeFromDocument", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <DocumentResumeInputType> > { Name = "documentResume" } ), resolve: async context => { DocumentResume documentResume = context.GetArgument <DocumentResume>("documentResume"); return(await context.TryAsyncResolve( async c => await documentBLL.UnlinkResumeFromDocumentAsync(documentResume) )); } ); FieldAsync <GraphQLTypes.DocumentType>( "removeDocument", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await documentBLL.DeleteDocumentByIdAsync(id) )); } ); // DocumentTypes FieldAsync <DocumentTypeType>( "createDocumentType", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <DocumentTypeInputType> > { Name = "documentType" } ), resolve: async context => { APIModels.DocumentType documentType = context.GetArgument <APIModels.DocumentType>("documentType"); return(await context.TryAsyncResolve( async c => await documentTypeBLL.CreateDocumentTypeAsync(documentType) )); } ); FieldAsync <DocumentTypeType>( "updateDocumentType", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <DocumentTypeInputType> > { Name = "documentType" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); APIModels.DocumentType documentType = context.GetArgument <APIModels.DocumentType>("documentType"); return(await context.TryAsyncResolve( async c => await documentTypeBLL.UpdateDocumentTypeAsync(documentType) )); } ); FieldAsync <DocumentTypeType>( "removeDocumentType", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await documentTypeBLL.DeleteDocumentTypeByIdAsync(id) )); } ); // Resumes FieldAsync <ResumeType>( "createResume", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <ResumeInputType> > { Name = "resume" } ), resolve: async context => { Resume resume = context.GetArgument <Resume>("resume"); return(await context.TryAsyncResolve( async c => await resumeBLL.CreateResumeAsync(resume) )); } ); FieldAsync <ResumeType>( "updateResume", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <ResumeInputType> > { Name = "resume" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); Resume resume = context.GetArgument <Resume>("resume"); return(await context.TryAsyncResolve( async c => await resumeBLL.UpdateResumeAsync(resume) )); } ); FieldAsync <ResumeType>( "linkDocumentToResume", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <DocumentResumeInputType> > { Name = "documentResume" } ), resolve: async context => { DocumentResume documentResume = context.GetArgument <DocumentResume>("documentResume"); return(await context.TryAsyncResolve( async c => await resumeBLL.LinkDocumentToResumeAsync(documentResume) )); } ); FieldAsync <ResumeType>( "unlinkDocumentFromResume", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <DocumentResumeInputType> > { Name = "documentResume" } ), resolve: async context => { DocumentResume documentResume = context.GetArgument <DocumentResume>("documentResume"); return(await context.TryAsyncResolve( async c => await resumeBLL.UnlinkDocumentFromResumeAsync(documentResume) )); } ); FieldAsync <ResumeType>( "linkSkillToResume", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <ResumeSkillInputType> > { Name = "resumeSkill" } ), resolve: async context => { ResumeSkill resumeSkill = context.GetArgument <ResumeSkill>("resumeSkill"); return(await context.TryAsyncResolve( async c => await resumeBLL.LinkSkillToResumeAsync(resumeSkill) )); } ); FieldAsync <ResumeType>( "unlinkSkillFromResume", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <ResumeSkillInputType> > { Name = "resumeSkill" } ), resolve: async context => { ResumeSkill resumeSkill = context.GetArgument <ResumeSkill>("resumeSkill"); return(await context.TryAsyncResolve( async c => await resumeBLL.UnlinkSkillFromResumeAsync(resumeSkill) )); } ); FieldAsync <ResumeType>( "removeResume", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await resumeBLL.DeleteResumeByIdAsync(id) )); } ); // ResumeStates FieldAsync <ResumeStateType>( "createResumeState", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <ResumeStateInputType> > { Name = "resumeState" } ), resolve: async context => { ResumeState resumeState = context.GetArgument <ResumeState>("resumeState"); return(await context.TryAsyncResolve( async c => await resumeStateBLL.CreateResumeStateAsync(resumeState) )); } ); FieldAsync <ResumeStateType>( "updateResumeState", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <ResumeStateInputType> > { Name = "resumeState" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); ResumeState resumeState = context.GetArgument <ResumeState>("resumeState"); return(await context.TryAsyncResolve( async c => await resumeStateBLL.UpdateResumeStateAsync(resumeState) )); } ); FieldAsync <ResumeStateType>( "removeResumeState", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await resumeStateBLL.DeleteResumeStateByIdAsync(id) )); } ); // Skills FieldAsync <SkillType>( "createSkill", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <SkillInputType> > { Name = "skill" } ), resolve: async context => { Skill skill = context.GetArgument <Skill>("skill"); return(await context.TryAsyncResolve( async c => await skillBLL.CreateSkillAsync(skill) )); } ); FieldAsync <SkillType>( "updateSkill", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <SkillInputType> > { Name = "skill" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); Skill skill = context.GetArgument <Skill>("skill"); return(await context.TryAsyncResolve( async c => await skillBLL.UpdateSkillAsync(skill) )); } ); FieldAsync <SkillType>( "linkResumeToSkill", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <ResumeSkillInputType> > { Name = "resumeSkill" } ), resolve: async context => { ResumeSkill resumeSkill = context.GetArgument <ResumeSkill>("resumeSkill"); return(await context.TryAsyncResolve( async c => await skillBLL.LinkResumeToSkillAsync(resumeSkill) )); } ); FieldAsync <SkillType>( "unlinkResumeFromSkill", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <ResumeSkillInputType> > { Name = "resumeSkill" } ), resolve: async context => { ResumeSkill resumeSkill = context.GetArgument <ResumeSkill>("resumeSkill"); return(await context.TryAsyncResolve( async c => await skillBLL.UnlinkResumeFromSkillAsync(resumeSkill) )); } ); FieldAsync <SkillType>( "linkJobToSkill", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <JobSkillInputType> > { Name = "jobSkill" } ), resolve: async context => { JobSkill jobSkill = context.GetArgument <JobSkill>("jobSkill"); return(await context.TryAsyncResolve( async c => await skillBLL.LinkJobToSkillAsync(jobSkill) )); } ); FieldAsync <SkillType>( "unlinkJobFromSkill", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <JobSkillInputType> > { Name = "jobSkill" } ), resolve: async context => { JobSkill jobSkill = context.GetArgument <JobSkill>("jobSkill"); return(await context.TryAsyncResolve( async c => await skillBLL.UnlinkJobFromSkillAsync(jobSkill) )); } ); FieldAsync <SkillType>( "removeSkill", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await skillBLL.DeleteSkillByIdAsync(id) )); } ); // SkillAliases FieldAsync <SkillAliasType>( "createSkillAlias", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <SkillAliasInputType> > { Name = "skillAlias" } ), resolve: async context => { SkillAlias skillAlias = context.GetArgument <SkillAlias>("skillAlias"); return(await context.TryAsyncResolve( async c => await skillAliasBLL.CreateSkillAliasAsync(skillAlias) )); } ); FieldAsync <SkillAliasType>( "updateSkillAlias", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <SkillAliasInputType> > { Name = "skillAlias" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); SkillAlias skillAlias = context.GetArgument <SkillAlias>("skillAlias"); return(await context.TryAsyncResolve( async c => await skillAliasBLL.UpdateSkillAliasAsync(skillAlias) )); } ); FieldAsync <SkillAliasType>( "removeSkillAlias", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await skillAliasBLL.DeleteSkillAliasByIdAsync(id) )); } ); // Jobs FieldAsync <JobType>( "createJob", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <JobInputType> > { Name = "job" } ), resolve: async context => { Job job = context.GetArgument <Job>("job"); return(await context.TryAsyncResolve( async c => await jobBLL.CreateJobAsync(job) )); } ); FieldAsync <JobType>( "updateJob", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <JobInputType> > { Name = "job" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); Job job = context.GetArgument <Job>("job"); return(await context.TryAsyncResolve( async c => await jobBLL.UpdateJobAsync(job) )); } ); FieldAsync <JobType>( "linkSkillToJob", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <JobSkillInputType> > { Name = "jobSkill" } ), resolve: async context => { JobSkill jobSkill = context.GetArgument <JobSkill>("jobSkill"); return(await context.TryAsyncResolve( async c => await jobBLL.LinkSkillToJobAsync(jobSkill) )); } ); FieldAsync <JobType>( "unlinkSkillFromJob", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <JobSkillInputType> > { Name = "jobSkill" } ), resolve: async context => { JobSkill jobSkill = context.GetArgument <JobSkill>("jobSkill"); return(await context.TryAsyncResolve( async c => await jobBLL.UnlinkSkillFromJobAsync(jobSkill) )); } ); FieldAsync <JobType>( "removeJob", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await jobBLL.DeleteJobByIdAsync(id) )); } ); // JobStates FieldAsync <JobStateType>( "createJobState", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <JobStateInputType> > { Name = "jobState" } ), resolve: async context => { JobState jobState = context.GetArgument <JobState>("jobState"); return(await context.TryAsyncResolve( async c => await jobStateBLL.CreateJobStateAsync(jobState) )); } ); FieldAsync <JobStateType>( "updateJobState", arguments: new QueryArguments( //new QueryArgument<NonNullGraphType<IdGraphType>> //{ // Name = "id" //}, new QueryArgument <NonNullGraphType <JobStateInputType> > { Name = "jobState" } ), resolve: async context => { //Guid id = context.GetArgument<Guid>("id"); JobState jobState = context.GetArgument <JobState>("jobState"); return(await context.TryAsyncResolve( async c => await jobStateBLL.UpdateJobStateAsync(jobState) )); } ); FieldAsync <JobStateType>( "removeJobState", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IdGraphType> > { Name = "id" } ), resolve: async context => { Guid id = context.GetArgument <Guid>("id"); return(await context.TryAsyncResolve( async c => await jobStateBLL.DeleteJobStateByIdAsync(id) )); } ); }