Esempio n. 1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            EmployeeID = Convert.ToInt32(Session["UName"]);
            clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
            DataSet          dsEmail             = objClsBLReportIssue.GetEmailID(EmployeeID);

            if (dsEmail.Tables[0].Rows.Count > 0)
            {
                txtEmailID.Text = dsEmail.Tables[0].Rows[0][0].ToString();
                txtName.Text    = dsEmail.Tables[0].Rows[0]["UserName"].ToString();
            }
            if (EmployeeID.ToString() == "" || EmployeeID == 0)
            {
                //Response.Redirect("http://192.168.30.15/intranet/");
                Response.Redirect("http://myv2.v2solutions.com/");
            }
            else
            {
                if (!Page.IsPostBack)
                {
                    try
                    {
                        BindType();
                        BindSeverity();
                        BindSubCategory();
                    }

                    catch (V2Exceptions ex)
                    {
                        throw;
                    }
                    catch (System.Exception ex)
                    {
                        FileLog objFileLog = FileLog.GetLogger();
                        objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "Page_Load", ex.StackTrace);
                        throw new V2Exceptions();
                    }
                    ////	BindPriority();
                }
            }
            btnSubmit.Attributes.Add("onClick", "return validateAndCheck();");
            //lblMessage.Visible = false;
            //btnSubmit.Attributes.Add("onClick","return checkSubCategorySelection();");
        }
 public void Dispose()
 {
     _AllList.Remove(this);
     _AllByPrimaryKey.Remove(EmployeeID.ToString() + "_" + TerritoryID.ToString());
 }
Esempio n. 3
0
 // returns string representation of Reservation reservation object
 public override string ToString()
 {
     return(base.ToString() + "  Reservation ID: " + EmployeeID.ToString());
 } // end method ToString
 public override string ToString()
 {
     return(EmployeeID.ToString());
 }
Esempio n. 5
0
        protected void lvHREmployee_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeID;

            Int64.TryParse(e.CommandArgument.ToString(), out EmployeeID);

            if (EmployeeID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _EmployeeID = EmployeeID;
                    _MemberID   = CurrentHREmployeeEntity.MemberID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        HREmployeeEntity tempEmployee = FCCHREmployee.GetFacadeCreate().GetByID(EmployeeID);

                        #region Resource Delete

                        Int64 resultOne = -1;

                        String fe1_re = SqlExpressionBuilder.PrepareFilterExpression(ResourceEntity.FLD_NAME_ReferenceID, EmployeeID.ToString(), SQLMatchType.Equal);
                        String fe2_re = SqlExpressionBuilder.PrepareFilterExpression(ResourceEntity.FLD_NAME_ResourceCategoryID, MasterDataConstants.ResourceCategory.EMPLOYEE.ToString(), SQLMatchType.Equal);
                        String fe_re  = SqlExpressionBuilder.PrepareFilterExpression(fe1_re, SQLJoinType.AND, fe2_re);

                        IList <ResourceEntity> resourceList = FCCResource.GetFacadeCreate().GetIL(null, null, String.Empty, fe_re, DatabaseOperationType.LoadWithFilterExpression);

                        foreach (ResourceEntity ent in resourceList)
                        {
                            String fe_re_delete = SqlExpressionBuilder.PrepareFilterExpression(ResourceEntity.FLD_NAME_ResourceID, ent.ResourceID.ToString(), SQLMatchType.Equal);

                            resultOne = FCCResource.GetFacadeCreate().Delete(ent, fe_re_delete, DatabaseOperationType.Delete, TransactionRequired.No);
                        }

                        #endregion

                        #region Employee Delete

                        Int64 resultTwo = -1;

                        if (resultOne == 0)
                        {
                            String fe_con_delete = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_EmployeeID, EmployeeID.ToString(), SQLMatchType.Equal);

                            HREmployeeEntity hREmployeeEntity = new HREmployeeEntity();

                            resultTwo = FCCHREmployee.GetFacadeCreate().Delete(hREmployeeEntity, fe_con_delete, DatabaseOperationType.Delete, TransactionRequired.No);
                        }

                        #endregion

                        #region Member Delete

                        Int64 resultThree = -1;

                        if (resultTwo == 0)
                        {
                            String fe_mem_delete = SqlExpressionBuilder.PrepareFilterExpression(HRMemberEntity.FLD_NAME_MemberID, tempEmployee.MemberID.ToString(), SQLMatchType.Equal);

                            HRMemberEntity hRMemberEntity = new HRMemberEntity();

                            resultThree = FCCHRMember.GetFacadeCreate().Delete(hRMemberEntity, fe_mem_delete, DatabaseOperationType.Delete, TransactionRequired.No);
                        }

                        #endregion

                        if (resultOne == 0 && resultTwo == 0 && resultThree == 0)
                        {
                            _EmployeeID       = 0;
                            _HREmployeeEntity = new HREmployeeEntity();
                            _MemberID         = 0;
                            _HRMemberEntity   = new HRMemberEntity();

                            PrepareInitialView();
                            BindHREmployeeList();

                            MiscUtil.ShowMessage(lblMessage, "Employee has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 6
0
        public List <Claim> GetClaims(ClaimsPrincipal principal)
        {
            //getting the claims for the token created by the sts
            List <Claim> claims = new List <Claim>()
            {
                new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Email),
                new Claim("http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider", Email),
                new Claim("'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", Email),
                new Claim(System.IdentityModel.Claims.ClaimTypes.Name, Email),
                //new Claim(System.IdentityModel.Claims.ClaimTypes.NameIdentifier, Email),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + "Email", Email),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + "PhoneNumber", PhoneNumber),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_ROLE_ID, ManagerID.ToString()),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_FIRST_NAME, FirstName),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_LAST_NAME, LastName),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_ACCESS, Administrator),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_FIRST_NAME, FirstName),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_LAST_NAME, LastName),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_ACCOUNT, Account),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_DEPARTMENT_ID, DepartmentID.ToString()),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_ROLE_ID, RoleID.ToString()),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_ID, EmployeeID.ToString()),
                new Claim(Const.CLAIM.CLAIM_NAMESPACE + "/" + Const.Fields.EMPLOYEE_HIRE_DATE, HireDate.ToString())
            };

            return(claims);
        }
Esempio n. 7
0
 public void ToStringFor0603000001Returns0603000001String()
 {
     Expect(employeeIDFixture0603000001.ToString(), Is.EqualTo("0603000001"));
 }
Esempio n. 8
0
    protected void btnsubmitAss_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow row in GridView1.Rows)
        {
            Label       l1 = row.FindControl("QuestionId") as Label;
            RadioButton r1 = row.FindControl("Rbans1") as RadioButton;
            RadioButton r2 = row.FindControl("Rbans2") as RadioButton;
            RadioButton r3 = row.FindControl("Rbans3") as RadioButton;
            RadioButton r4 = row.FindControl("Rbans4") as RadioButton;

            if (r1.Checked)
            {
                select_no = 1;
            }
            else if (r2.Checked)
            {
                select_no = 2;
            }
            else if (r3.Checked)
            {
                select_no = 3;
            }
            else if (r4.Checked)
            {
                select_no = 4;
            }

            con.Close();
            //my duplicate code

            //check_number(l1.Text);
            cmd.CommandText = "select * from Question where [coursename]='" + Session["CourseName"].ToString() + "' AND [Question_ID]=@qid" + count;
            cmd.Parameters.AddWithValue("@qid" + count, l1.Text);
            cmd.Connection = con;
            con.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                if (select_no == Convert.ToInt32(dr["correct_ans"]))
                {
                    correct_asn = correct_asn + 1;
                }
                else
                {
                    wrong_ans = wrong_ans + 1;
                }
            }
            count++;
            con.Close();
        }

        //=====================***********************************==================//
        Page.Validate("Group1");
        if (Page.IsValid)
        {
            if (Page.IsPostBack == true)
            {
                SqlConnection con1    = new SqlConnection(con.ConnectionString);
                SqlCommand    command = new SqlCommand("select * from CreateCourseTable where CourseName='" + Session["CourseName"].ToString() + "'", con1);
                con1.Open();
                SqlDataReader drCourse = command.ExecuteReader();

                while (drCourse.Read())
                {
                    LmsCourseId = (Convert.ToInt32(drCourse["CourseID"]));
                }
                con1.Close();

                //Code to get employee Id

                SqlCommand emplyeeIdget = new SqlCommand("Select * from registration where employeeMailId='" + lblmail.Text.ToString() + "'", con);

                con.Open();


                SqlDataReader dremp = emplyeeIdget.ExecuteReader();

                while (dremp.Read())

                {
                    EmployeeID = (Convert.ToInt32(dremp["EmployeeID"]));
                }
                con.Close();
            }


            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "SP_insertResult";

            cmd.Parameters.Add("@UserMailID", SqlDbType.NVarChar).Value = lblmail.Text.Trim();
            cmd.Parameters.Add("@EmployeeId", SqlDbType.NVarChar).Value = EmployeeID.ToString();
            cmd.Parameters.Add("@CourseId", SqlDbType.NVarChar).Value   = LmsCourseId.ToString();
            cmd.Parameters.Add("@Result", SqlDbType.NVarChar).Value     = correct_asn.ToString();
            cmd.Connection = con;
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();

            //lblmessage.Text = "You Total Score Is  : " + correct_asn.ToString();
            //Session["result"] = lblmessage.Text;
            //Response.Redirect("resultpage.aspx");

            ClientScript.RegisterStartupScript(typeof(Page), "alertMessage",
                                               "<script type='text/javascript'>alert('Result: " + correct_asn + "');window.location.replace('..//NewVideosPage.aspx');</script>");
        }
    }
Esempio n. 9
0
 public override string EmployeeStatus()
 {
     return(EmployeeID.ToString() + Name + "has " + SuccessfulChkIn.ToString() + "  succesful Check in");
 }