コード例 #1
0
        public static List <UserProfileEmployeeProfile> SetPhotoByEmployeeID(DataTable EmployeeProfileDataTable)
        {
            try
            {
                List <UserProfileEmployeeProfile> EmployeeList = new List <UserProfileEmployeeProfile>();
                foreach (DataRow dr in EmployeeProfileDataTable.Rows)
                {
                    UserProfileEmployeeProfile theEmployeeProfile = new UserProfileEmployeeProfile();
                    theEmployeeProfile.EmployeeID      = int.Parse(dr["EmployeeID"].ToString());
                    theEmployeeProfile.SettingKeyValue = ImageFunctions.ByteToImage((Byte[])(dr["SettingKeyValue"]));

                    //theWebForm.ModuleID = int.Parse(dr["ModuleID"].ToString());
                    //theWebForm.WebFormName = dr["WebFormName"].ToString();
                    //theWebForm.WebFormURL = dr["WebFormURL"].ToString();
                    //theWebForm.WebFormImageURL = dr["WebFormImageURL"].ToString();
                    //theWebForm.ModuleName = dr["ModuleName"].ToString();
                    //theWebForm.CompanyCode = dr["CompanyCode"].ToString();
                    //theWebForm.IsActive = bool.Parse(dr["IsActive"].ToString());
                    //theWebForm.IsDeleted = bool.Parse(dr["IsDeleted"].ToString());
                    //theWebForm.WebFormDescription = dr["WebFormDescription"].ToString();

                    EmployeeList.Add(theEmployeeProfile);
                }
                return(EmployeeList);
            }

            catch (Exception ex)
            {
                throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
            }
        }
コード例 #2
0
        public int UpdateFieldForceProfile(int theFieldForceId)
        {
            byte[] data = null;
            if (lbl_FileName.Text.Trim().Length > 0)
            {
                data = File.ReadAllBytes(lbl_FileName.Text);
            }
            int ProcReturnValue = 0;

            if (data != null)
            {
                UserProfileFieldForceProfile TheFieldForceProfile = new UserProfileFieldForceProfile();
                TheFieldForceProfile.FieldForceID    = Connection.LoggedOnUser.UserReferenceID;
                TheFieldForceProfile.SettingKeyValue = ImageFunctions.ByteToImage(data);
                ProcReturnValue = UserProfileFieldForceProfileManagement.GetInstance.UpdateUserProfileFieldForceProfile(TheFieldForceProfile);
            }

            return(ProcReturnValue);
        }