示例#1
0
        public SCMS.Entity.Shared.Employee GetEmployeeInfoById(int employeeId)
        {
            SOFTTEK.SCMS.Entity.Shared.Employee employee = null;
            return(context.Execute(() =>
            {
                using (dataSource = new SRADataContext(context.SecurityContext))
                {
                    dataSource.ConnectionString = "SRA";
                    dataSource.DefaultUser = new System.Configuration.AppSettingsReader().GetValue("S_APP_UID", typeof(string)).ToString();
                    dataSource.Initialize();

                    employee = dataSource.GetEmployeeById(employeeId);
                }
                return employee;
            }, "Retrieve the employee information for the provided employee identifier."));
        }
示例#2
0
        public bool SetEmployeeImage(string ftpURL, int employeeID)
        {
            bool result = false;

            return(context.Execute(() =>
            {
                using (dataSource = new SRADataContext(context.SecurityContext))
                {
                    dataSource.ConnectionString = "SRA";
                    dataSource.DefaultUser = new System.Configuration.AppSettingsReader().GetValue("S_APP_UID", typeof(string)).ToString();

                    dataSource.Initialize();
                    SOFTTEK.SCMS.Entity.Shared.Employee employee = dataSource.GetEmployeeById(employeeID);
                    if (employee != null)
                    {
                        employee.ImageURL = ftpURL;
                        result = dataSource.UpdateEmployee(employee);
                    }
                    ;

                    return result;
                }
            }, "Upload to the images repository, the provided binary image file."));
        }