Beispiel #1
0
        }//end GetAll

        public EmployeeBusinessUser GetByID(int employeeid)
        {
            Dictionary <string, Object> dataLayerDict;

            try
            {
                EmployeeBusinessData dataLayer = new EmployeeBusinessData();
                dataLayerDict = (Dictionary <string, Object>)Deserializer(dataLayer.GetByID(employeeid));
                //EmployeeBusinessData empBusData = new EmployeeBusinessData();
                //Dictionary<string, Object> empBusData.GetByID(employeeid);
                _title        = Convert.ToString(dataLayerDict["title"]);
                _firstName    = Convert.ToString(dataLayerDict["firstname"]);
                _lastName     = Convert.ToString(dataLayerDict["lastname"]);
                _departmentid = Convert.ToInt32(dataLayerDict["departmentid"]);
                _employeeID   = Convert.ToInt32(dataLayerDict["employeeid"]);
                _email        = Convert.ToString(dataLayerDict["email"]);
                _phoneNo      = Convert.ToString(dataLayerDict["phoneno"]);
            }
            catch (Exception e)
            {
                ErrorRoutine(e, "EmployeeBusinessUser", "GetByID");
            }
            return(this);
        }
Beispiel #2
0
        public int Update()
        {
            int rowsUpdated = 0;

            try
            {
                EmployeeBusinessData        dataLayer       = new EmployeeBusinessData();
                Dictionary <string, Object> empBusinessData = new Dictionary <string, Object>();
                Dictionary <string, Object> empDict2        = (Dictionary <string, Object>)Deserializer(dataLayer.GetByID(_employeeID));
                empBusinessData["departmentid"] = _departmentid;
                empBusinessData["email"]        = _email;
                empBusinessData["employeeid"]   = _employeeID;
                empBusinessData["firstname"]    = _firstName;
                empBusinessData["lastname"]     = _lastName;
                empBusinessData["phoneno"]      = _phoneNo;
                empBusinessData["title"]        = _title;
                empBusinessData["entity"]       = empDict2["entity"];
                _entity     = Serializer(empBusinessData);
                rowsUpdated = dataLayer.Update(_entity);
            }
            catch (Exception e)
            {
                ErrorRoutine(e, "EmployeeBusinessUser", "Update");
            }
            return(rowsUpdated);
        }//end Update