예제 #1
0
 public ProvisionData(ProvisionData p)
 {
     IWS_CardID            = p.IWS_CardID;
     PIN                   = p.PIN;
     EmployeeID            = p.EmployeeID;
     CompanyDivision       = p.CompanyDivision;
     JobRoleID             = p.JobRoleID;
     ProvisionedCategories = p.ProvisionedCategories;
 }
예제 #2
0
        public void ProvisionedByBOAABadgeID()
        {
            int BOAABadgeID = 4069676;


            ProvisionData tpd = testSvc.ProvisionedByBOAABadgeID(BOAABadgeID);

            Assert.IsTrue(true);
        }
예제 #3
0
        public void ProvisionedByCard()
        {
            int    IWS_CardID  = 1932169;
            string expectedPIN = "2887";

            ProvisionData pd = testSvc.ProvisionedByCard(IWS_CardID);

            Assert.IsTrue(pd.PIN == expectedPIN);
        }
예제 #4
0
        public ProvisionData ProvisionedByBOAABadgeID(int BOAABadgeID)
        {
            string name = "ProvisionedByBOAABadgeID(): ";

            log(name + "BOAABadgeID=" + BOAABadgeID.ToString());

            ProvisionData pd = new ProvisionData(cardID: 0, pin: "0", employeeid: "0", companydivision: "0", jobroleid: 0);

            try
            {
                DataTable dt    = new IwsRepository().ProvisionedByBOAABadgeID(BOAABadgeID);
                bool      first = true;

                foreach (DataRow dr in dt.Rows)
                {
                    if (first)
                    {
                        first = false;

                        long lIWSCardID = 0;
                        Int64.TryParse(dr["IWS_CardID"].ToString(), out lIWSCardID);
                        pd.IWS_CardID = lIWSCardID;

                        pd.PIN        = (string)dr["PIN"];
                        pd.EmployeeID = (string)dr["EmployeeID"].ToString();
                        string CompanyCode  = ((string)dr["CompanyCode"]).PadLeft(4, '0');
                        string DivisionCode = ((string)dr["DivisionCode"]).PadLeft(2, '0');
                        pd.CompanyDivision = (string)(CompanyCode + DivisionCode);
                        pd.JobRoleID       = int.Parse(dr["JobRoleID"].ToString());

                        log(name + "IWS_CardID: " + pd.IWS_CardID + ", PIN: " + pd.PIN + ", EmployeeID: " + pd.EmployeeID + ", CompanyDivision: " + pd.CompanyDivision + ", JobRoleID: " + pd.JobRoleID);
                    }

                    //RGuidi: 6/4/2013 Only add -if- record has a category value. This is in support of CMS requiring a minimal record (employee/codiv: with no categories) to revoke provisioning
                    if (dr["CategoryName"].ToString().Length > 0)
                    {
                        pd.ProvisionedCategories.Add(new CategoryData(
                                                         accessType: (char)dr["AccessType"].ToString()[0],
                                                         categoryID: (int)dr["CategoryID"],
                                                         categoryName: (string)dr["CategoryName"],
                                                         whenBecomesActive: (DateTime)dr["WhenBecomesActive"],
                                                         whenExpires: (DateTime)dr["WhenExpires"]
                                                         ));
                    }
                }
                log(name + " ProvisionedCategories Count: " + pd.ProvisionedCategories.Count.ToString());

                foreach (CategoryData bcd in pd.ProvisionedCategories)
                {
                    log("           AccessType: " + bcd.AccessType);
                    log("           CategoryID: " + bcd.CategoryID);
                    log("         CategoryName: " + bcd.CategoryName);
                    log("    WhenBecomesActive: " + bcd.WhenBecomesActive);
                    log("          WhenExpires: " + bcd.WhenExpires);
                }
            }
            catch (Exception e)
            {
                log(e.Message);
            }

            return(pd);
        }