Esempio n. 1
0
        /// <summary>
        /// Update Project Details
        /// </summary>
        /// <param name="projectDetailsEntity">Object for update data into database</param>
        /// <returns>system.int32</returns>
        public int UpdateProjectDetailsDAL(ProjectDetailsEntity projectDetailsEntity)
        {
            int result = 0;
            try
            {
                connection.Open();
                SqlCommand cmd = new SqlCommand();

                SqlParameter[] sqlparams = {
                                              //new SqlParameter("@candidateId",projectDetailsEntity.CandidateId),
                                              new SqlParameter("@companyName",projectDetailsEntity.CompanyName),
                                              new SqlParameter("@projectTitle",projectDetailsEntity.ProjectTitle),
                                              new SqlParameter("@roleId",projectDetailsEntity.YourRole),
                                              new SqlParameter("@clientName",projectDetailsEntity.ClientName),
                                              new SqlParameter("@projectLocation",projectDetailsEntity.ProjectLocation),
                                              new SqlParameter("@duration",projectDetailsEntity.Duration),
                                              new SqlParameter("@employmentType",projectDetailsEntity.EmploymentType),
                                              new SqlParameter("@projectDescription",projectDetailsEntity.ProjectDescription),
                                              new SqlParameter("@teamSize",projectDetailsEntity.TeamSize),
                                              new SqlParameter("@skillUsed",projectDetailsEntity.SkillUsed),
                                              new SqlParameter("@rolesandResponsibility",projectDetailsEntity.RolesandResponsibility),
                                              new SqlParameter("@projectLive",projectDetailsEntity.ProjectLive),
                                              new SqlParameter("@projectLink", projectDetailsEntity.ProjectLink),
                                              new SqlParameter("@projectId",projectDetailsEntity.ProjectId),
                                              new SqlParameter("@degree",projectDetailsEntity.Degree),
                                              new SqlParameter("@projectFor",projectDetailsEntity.ProjectFor),
                                            };
                result = SqlHelper.ExecuteNonQuery(connection, CommandType.StoredProcedure, Constants.sp_JS_UpdateProjectDetails, sqlparams);
            }
            catch (Exception)
            {
                // throw;
            }
            finally
            {
                connection.Close();
            }
            return result;
        }
Esempio n. 2
0
 /// <summary>
 /// Update Project Details
 /// </summary>
 /// <param name="projectDetailsEntity">ProjectDetailsEntity</param>
 /// <returns>system.Int32</returns>
 public int UpdateProjectDetailsBAL(ProjectDetailsEntity projectDetailsEntity)
 {
     ProjectDetailsDAL projectDetailsDAL = new ProjectDetailsDAL();
     return projectDetailsDAL.UpdateProjectDetailsDAL(projectDetailsEntity);
 }
Esempio n. 3
0
        protected void rptrProjectDetails_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            LinkButton lnkUpdate = (LinkButton)e.Item.FindControl("lnkUpdate");
            LinkButton lnkCancel = (LinkButton)e.Item.FindControl("lnkCancel");
            LinkButton lnkEdit = (LinkButton)e.Item.FindControl("lnkEdit");
            LinkButton lnkDelete = (LinkButton)e.Item.FindControl("lnkDelete");
            Label lblrptID = (Label)e.Item.FindControl("lblID");
            Label lblProjectFor = (Label)e.Item.FindControl("lblProjectFor");
            Label lblProjectTiltle = (Label)e.Item.FindControl("lblProjectTiltle");
            Label lblCompanyName = (Label)e.Item.FindControl("lblCompanyName");
            Label lblClientName = (Label)e.Item.FindControl("lblClientName");
            Label lblDuration = (Label)e.Item.FindControl("lblDuration");
            Label lblProjectLocation = (Label)e.Item.FindControl("lblProjectLocation");
            Label lblEmploymentType = (Label)e.Item.FindControl("lblEmploymentType");
            Label lblProjectDetails = (Label)e.Item.FindControl("lblProjectDetails");
            Label lblRolesandResponsibility = (Label)e.Item.FindControl("lblRolesandResponsibility");
            Label lblSkillUsed = (Label)e.Item.FindControl("lblSkillUsed");
            Label lblProjectLive = (Label)e.Item.FindControl("lblProjectLive");
            Label lblProjectLink = (Label)e.Item.FindControl("lblProjectLink");
            TextBox txtProjectTiltle = (TextBox)e.Item.FindControl("txtProjectTiltle");
            TextBox txtCompanyName = (TextBox)e.Item.FindControl("txtCompanyName");
            TextBox txtClientName = (TextBox)e.Item.FindControl("txtClientName");
            TextBox txtDuration = (TextBox)e.Item.FindControl("txtDuration");
            TextBox txtProjectLocation = (TextBox)e.Item.FindControl("txtProjectLocation");
            TextBox txtEmploymentType = (TextBox)e.Item.FindControl("txtEmploymentType");
            TextBox txtProjectDetails = (TextBox)e.Item.FindControl("txtProjectDetails");
            TextBox txtRolesandResponsibility = (TextBox)e.Item.FindControl("txtRolesandResponsibility");
            TextBox txtSkillUsed = (TextBox)e.Item.FindControl("txtSkillUsed");
            TextBox txtProjectLive = (TextBox)e.Item.FindControl("txtProjectLive");
            TextBox txtProjectLink = (TextBox)e.Item.FindControl("txtProjectLink");
            DropDownList ddlRole = (DropDownList)e.Item.FindControl("ddlRole");
            DropDownList ddlTeamSize = (DropDownList)e.Item.FindControl("ddlTeamSize");
            DropDownList ddlProjectFor = (DropDownList)e.Item.FindControl("ddlProjectFor");
            DropDownList ddlDegree = (DropDownList)e.Item.FindControl("ddlDegree");
            CheckBox chkDelete = (CheckBox)e.Item.FindControl("chkDelete");
            // Check commond for edit
            if (e.CommandName == "edit")
            {
                lnkCancel.Visible = true;
                lnkUpdate.Visible = true;
                lnkEdit.Visible = false;
                txtProjectTiltle.Visible = true;
                txtCompanyName.Visible = true;
                txtClientName.Visible = true;
                txtDuration.Visible = true;
                txtEmploymentType.Visible = true;
                txtRolesandResponsibility.Visible = true;
                txtProjectLive.Visible = true;
                txtProjectLocation.Visible = true;
                txtProjectLink.Visible = true;
                txtSkillUsed.Visible = true;
                txtProjectDetails.Visible = true;
                txtProjectLink.Visible = true;
                ddlProjectFor.Visible = true;
                lblProjectFor.Visible = false;
                lblProjectTiltle.Visible = false;
                lblCompanyName.Visible = false;
                lblClientName.Visible = false;
                lblDuration.Visible = false;
                lblProjectLocation.Visible = false;
                lblEmploymentType.Visible = false;
                lblProjectDetails.Visible = false;
                lblRolesandResponsibility.Visible = false;
                lblSkillUsed.Visible = false;
                lblProjectLive.Visible = false;
                lblProjectLink.Visible = false;
            }
            // Check commond for update
            if (e.CommandName == "cancel")
            {
                BindRepeater();
            }
            // Check  commond for update
            if (e.CommandName == "update")
            {
                try
                {
                    ProjectDetailsBAL projectDetailsBAL = new ProjectDetailsBAL();
                    ProjectDetailsEntity projectDetailsEntity = new ProjectDetailsEntity();
                    projectDetailsEntity.ProjectTitle = txtProjectTiltle.Text;
                    projectDetailsEntity.CompanyName = txtCompanyName.Text;
                    projectDetailsEntity.YourRole = Convert.ToInt32(ddlRole.SelectedValue);
                    projectDetailsEntity.ClientName = txtClientName.Text;
                    projectDetailsEntity.Duration = txtDuration.Text;
                    projectDetailsEntity.ProjectLocation = txtProjectLocation.Text;
                    projectDetailsEntity.EmploymentType = txtEmploymentType.Text;
                    projectDetailsEntity.ProjectDescription = txtProjectDetails.Text;
                    projectDetailsEntity.RolesandResponsibility = txtRolesandResponsibility.Text;
                    projectDetailsEntity.TeamSize = ddlTeamSize.SelectedValue;
                    projectDetailsEntity.SkillUsed = txtSkillUsed.Text;
                    projectDetailsEntity.ProjectLive = txtProjectLive.Text;
                    projectDetailsEntity.ProjectLink = txtProjectLink.Text;
                    projectDetailsEntity.Degree = ddlDegree.SelectedValue;
                    projectDetailsEntity.ProjectFor = ddlProjectFor.SelectedValue;
                    projectDetailsEntity.ProjectId = Convert.ToInt32(e.CommandArgument);
                    projectDetailsBAL.UpdateProjectDetailsBAL(projectDetailsEntity);
                }
                catch (Exception ex)
                {
                    //  throw;
                }

                BindRepeater();
            }
            // Check commond for delete
            if (e.CommandName == "delete")
            {
                try
                {
                    ProjectDetailsBAL projectDetailsBAL = new ProjectDetailsBAL();
                    int projectId = Convert.ToInt32(e.CommandArgument);
                    projectDetailsBAL.DeleteProjectDetailsBAL(projectId);
                }
                catch (Exception)
                {
                    // throw;
                }
                BindRepeater();
            }
        }