示例#1
0
文件: GPRMC.cs 项目: kevincwq/UAV
        /// <summary>
        /// Initializes the NMEA Recommended minimum specific GPS/Transit data and parses an NMEA sentence
        /// </summary>
        /// <param name="NMEAsentence"></param>
        public GPRMC(string NMEAsentence)
        {
            try
            {
                //Split into an array of strings.
                string[] split = NMEAsentence.Split(new Char[] { ',' });

                //Extract date/time
                try
                {
                    string[] DateTimeFormats = { "ddMMyyHHmmss", "ddMMyy", "ddMMyyHHmmss.FFFFFF" };
                    if (split[9].Length >= 6) { //Require at least the date to be present
                        string time = split[9] + split[1]; // +" 0";
                        _timeOfFix = DateTime.ParseExact(time, DateTimeFormats, GPSHandler.numberFormat_EnUS, System.Globalization.DateTimeStyles.AssumeUniversal);
                    }
                    else
                        _timeOfFix = new DateTime();
                }
                catch { _timeOfFix = new DateTime(); }

                if (split[2] == "A")
                    _status = StatusEnum.OK;
                else
                    _status = StatusEnum.Warning;

                _position = new Coordinate(	GPSHandler.GPSToDecimalDegrees(split[5], split[6]),
                                            GPSHandler.GPSToDecimalDegrees(split[3], split[4]));

                GPSHandler.dblTryParse(split[7], out _speed);
                GPSHandler.dblTryParse(split[8], out _course);
                GPSHandler.dblTryParse(split[10], out _magneticVariation);
            }
            catch { }
        }
示例#2
0
        public static void GenerateRandomData(int standId, StatusEnum modelName)
        {
            Random r = new Random();
            int completePercentage = 0;

            completePercentage = r.Next(1, 30);
            var standData = new StatusModel() { StandID = standId, Status = completePercentage, TimeStamp = DateTime.Now, Description = modelName.ToString() };
            SendToEventhub(standData);
            Thread.Sleep(r.Next(_statusDelayMin, _statusDelayMax));

            completePercentage = r.Next(31, 60);
            standData = new StatusModel() { StandID = standId, Status = completePercentage, TimeStamp = DateTime.Now, Description = modelName.ToString() };
            SendToEventhub(standData);
            Thread.Sleep(r.Next(_statusDelayMin, _statusDelayMax));

            completePercentage = r.Next(61, 99);
            standData = new StatusModel() { StandID = standId, Status = completePercentage, TimeStamp = DateTime.Now, Description = modelName.ToString() };
            SendToEventhub(standData);
            Thread.Sleep(r.Next(_statusDelayMin, _statusDelayMax));

            completePercentage = 100;
            standData = new StatusModel() { StandID = standId, Status = completePercentage, TimeStamp = DateTime.Now, Description = modelName.ToString() };
            SendToEventhub(standData);

            //Pause for reset progress to 0
            Thread.Sleep(_statusCompleteDelay);

            completePercentage = 0;
            standData = new StatusModel() { StandID = standId, Status = completePercentage, TimeStamp = DateTime.Now, Description = modelName.ToString() };
            SendToEventhub(standData);
        }
示例#3
0
        public List<LeaveRequestView> ListLeaveRequestsApprovedByEmployee(int employeeId, StatusEnum? status)
        {
            SqlConnection conn = null;
            SqlCommand cmd = null;

            try
            {
                conn = DALHelper.CreateSqlDbConnection();
                cmd = new SqlCommand("usp_ListLeaveRequestsApprovedByEmployee", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@EmployeeId", employeeId);
                if (status != null)
                {
                    cmd.Parameters.AddWithValue("@Status", status);
                }

                SqlDataReader rdr = cmd.ExecuteReader();
                List<LeaveRequestView> list = new List<LeaveRequestView>();

                while (rdr.Read())
                {
                    LeaveRequestView view = new LeaveRequestView();
                    view.Id = Convert.ToInt32(rdr["Id"]);
                    view.LeaveType = Convert.ToString(rdr["LeaveType"]);
                    view.LeaveNameType = (LeaveNameType)Convert.ToInt32(rdr["LeaveNameType"]);
                    view.RequestDate = Convert.ToDateTime(rdr["RequestDate"]);
                    view.StartDate = Convert.ToDateTime(rdr["StartDate"]);
                    if (rdr["EndDate"] != DBNull.Value)
                    {
                        view.EndDate = Convert.ToDateTime(rdr["EndDate"]);
                    }
                    if (rdr["HalfDay"] != DBNull.Value)
                    {
                        view.IsHalfDay = Convert.ToBoolean(rdr["HalfDay"]);
                    }
                    view.Notes = Convert.ToString(rdr["Notes"]);
                    view.Employee = Convert.ToString(rdr["Employee"]);
                    view.AlternateEmployee = Convert.ToString(rdr["AlternateEmployee"]);
                    if (rdr["ManagerEmployee"] != DBNull.Value)
                    {
                        view.ManagerEmployee = Convert.ToString(rdr["ManagerEmployee"]);
                    }
                    view.LeaveStatus = (RequestsEnum)Convert.ToInt32(rdr["Status"]);
                    list.Add(view);
                }

                return list;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
                cmd.Dispose();
                conn.Dispose();
            }
        }
        public static int Execute(string sql)
        {
            Status = StatusEnum.Begining;
            MessageError = "";

            try
            {
                int RowsAffecteds;

                Command.CommandText = sql;
                Command.Connection = Connection;

                RowsAffecteds = Command.ExecuteNonQuery();

                if (CloseConnection)
                {
                    Command.Connection.Close();
                    Command.Connection.Dispose();
                }
                Status = StatusEnum.Success;
                return RowsAffecteds;
            }
            catch (Exception ex)
            {
                Status = StatusEnum.Error;
                MessageError = ex.Message.ToString();
                throw new Exception(ex.Message);
            }
        }
示例#5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">Name of job.</param>
 /// <param name="xml">XML of job.</param>
 /// <param name="status">Status of job.</param>
 /// <param name="url">URL of archive.</param>
 /// <param name="errorText">Error text or null if no error.</param>
 public Job(string name, StatusEnum status, string url, string errorText)
 {
     this.Name = name;
     this.Status = status;
     this.URL = url;
     this.ErrorText = errorText;
 }
示例#6
0
        public DLFile(string dlURL, StatusEnum status)
        {
            _dlURL = dlURL;
            _status = status;

            _id = null;
        }
示例#7
0
        public void DoHeartbeat()
        {
            StatusEnum previousStatus = Status;
            bool greenCondition = _greenCondition();
            bool yellowCondition = _yellowCondition();
            string callerStatusString = _callerStatusString();

            if (greenCondition)
            {
                Status = StatusEnum.Green;
            }
            else if (yellowCondition)
            {
                Status = StatusEnum.Yellow;
            }
            else
            {
                Status = StatusEnum.Red;
            }

            heartbeatStatus.Update(Status);

            if (OnHeartbeat != null)
            {
                OnHeartbeat(heartbeatStatus, callerStatusString);
            }

            if (OnStatusChanged != null && previousStatus != Status)
            {
                OnStatusChanged(heartbeatStatus, callerStatusString);
            }
        }
示例#8
0
        public ResultModel GetByStockLogId(UserModel user, int stockLogId, StatusEnum status = StatusEnum.已生效)
        {
            string cmdText = string.Format("select * from dbo.St_StockInStock_Ref where StockLogId = {0} and RefStatus >={1}", stockLogId, (int)status);

            ResultModel result = Get(user, CommandType.Text, cmdText, null);

            return result;
        }
示例#9
0
        public ResultModel LoadInterestListBySubId(UserModel user, int subId,StatusEnum status = StatusEnum.已生效)
        {
            ResultModel result = new ResultModel();

            string cmdTex = string.Format("select * from dbo.Pri_Interest where SubContractId={0} and InterestStatus >={1}", subId, (int)status);

            result = this.Load<Model.Interest>(user, System.Data.CommandType.Text, cmdTex);

            return result;
        }
示例#10
0
 public ActionResult Edit(int id, StatusEnum status)
 {
     using (var db = new ApplicationDbContext())
     {
         var order = db.Orders.Find(id);
         order.Status = status;
         db.SaveChanges();
         return Redirect("/Order/Index");
     }
 }
示例#11
0
        public DLFile(string dlURL, StatusEnum status, string dlPath, WebProxy webProxy, CookieCollection cookieJar)
        {
            _dlURL = dlURL;
            _status = status;
            _dlPath = dlPath;
            _webProxy = webProxy;
            _cookieJar = cookieJar;

            _id = null;
        }
示例#12
0
        private static string BuildMessageBody(int tipoEntidad, int codEntidad, string tipo, StatusEnum status, string accion, List<ArtCambiosDetalle> detalles)
        {
            var cuerpoMensaje = new StringBuilder();

            cuerpoMensaje.Append("<span style='font: 12px arial;'>El siguiente cambio se ha producido en el <b>Artemisa</b>:</span><br/>");
            cuerpoMensaje.Append("<br/>");
            cuerpoMensaje.AppendFormat("<b>Tipo Entidad:</b> {0}<br/>", tipo);
            cuerpoMensaje.AppendFormat("<b>Accion:</b> {0}<br/>", accion);

            switch (tipoEntidad)
            {
                case 1:
                    var trilogia = NHArtemisa.GetEntity<ViewTrilogia>(codEntidad);
                    cuerpoMensaje.AppendFormat("<b> M&eacute;dico </b>: {0}  <br />", trilogia.Medico);
                    cuerpoMensaje.AppendFormat("<b> APM </b>: {0}  <br />", trilogia.NombreAPM);
                    cuerpoMensaje.AppendFormat("<b> LDV </b>: {0}  <br />", trilogia.LDV);
                    cuerpoMensaje.AppendFormat("<b> Depto. </b>: {0}  <br />", trilogia.Provincia);
                    cuerpoMensaje.AppendFormat("<b> Esp. Visita </b>: {0}  <br />", trilogia.EspecialidadVisita);
                    break;
                case 2:
                    var medico = NHArtemisa.GetEntity<ViewMedico>(codEntidad);
                    cuerpoMensaje.AppendFormat("<b> Nombre </b>: {0}  <br />", medico.Nombre);
                    cuerpoMensaje.AppendFormat("<b> Apellido(s) </b>: {0}  <br />", medico.Apellido);
                    cuerpoMensaje.AppendFormat("<b> Esp. Primaria </b>: {0}  <br />", medico.Especialidad);
                    cuerpoMensaje.AppendFormat("<b> Residente </b>: {0}  <br />", medico.Residente.ToSiNo());
                    cuerpoMensaje.AppendFormat("<b> Matricula. </b>: {0} <br />", medico.Matricula);
                    break;

            }

            if (detalles != null)
            {
                cuerpoMensaje.Append("<br> <b> Detalles del Cambio </b> <br/><hr/>");
                foreach (var item in detalles)
                {
                    cuerpoMensaje.AppendFormat("<br/> <b>{0}:</b> <i>De:</i> {1} <i>A: </i> {2}", item.NombreCampo,
                                               item.ValorAnterior, item.ValorActual);
                }
                cuerpoMensaje.Append("<br/><hr/><br/>");
            }

            cuerpoMensaje.AppendFormat("<br/><b>Fecha del Cambio:</b>{0}<br/>", DateTime.Now.ToLongDateString());
            cuerpoMensaje.AppendFormat("<b>Estatus:</b> {0}<br/>", status);
            cuerpoMensaje.AppendFormat(
                status == StatusEnum.Aprobado ? "<b>Realizado Por:</b> {0}<br/>" : "<b>Solicitado Por:</b> {0}<br/>",
                Global.Usuario.NombreCompleto);

            cuerpoMensaje.AppendLine("<br/><br/><b>Administrador Artemisa.</b><br/>");

            return cuerpoMensaje.ToString();
        }
示例#13
0
		public Log CreateLog(StatusEnum status, Exception exception = null, string message = null)
		{
			var log = new Log();

			log.DateTime = DateTime.Now.TruncateToSeconds();
			log.StatusEnum = status;
			log.Message = message;

			if (exception != null)
			{
				log.FullData = exception.ToString();
				log.StackTrace = exception.StackTrace; 
			}
			return log;
		}
示例#14
0
        private Projekt AddProjekt(string tytulProjektu, string opis, DateTime dataRozpoczecia, DateTime dataZakonczenia, StatusEnum status, params Zadanie[] zadania)
        {
            Projekt item = ObjectSpace.FindObject<Projekt>(new BinaryOperator("TytulProjektu", tytulProjektu));
            if (item == null)
            {
                item = ObjectSpace.CreateObject<Projekt>();
                item.TytulProjektu = tytulProjektu;
                item.DataRozpoczecia = dataRozpoczecia;
                item.DataZakonczenia = dataZakonczenia;
                item.Opis = opis;
                item.Status = status;

                item.Save();
            }
            return item;
        }
示例#15
0
        public ResultModel Load(UserModel user, int subId, StatusEnum status = StatusEnum.已生效)
        {
            ResultModel result = new ResultModel();
            try
            {
                string cmdText = string.Format("select si.* from dbo.St_ContractStockIn_Ref csir inner join dbo.St_StockIn si on csir.StockInId = si.StockInId and si.StockInStatus>={0} where csir.RefStatus >= {1} and csir.ContractSubId = {2} ", (int)status, (int)status, subId);

                result = Load<Model.StockIn>(user, CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            return result;
        }
示例#16
0
        public static void AddMetadata(int seriesId, string imdbId, string zap2ItId, string network, string contentRating, decimal rating, StatusEnum? status, DateTime? airTime, DateTime firstAired, int runtime, DateTime? lastUpdateTheTVDB)
        {
            var updateEntity = new SeriesEntity();
            if (!string.IsNullOrEmpty(imdbId)) updateEntity.Imdbid = imdbId;
            if (!string.IsNullOrEmpty(zap2ItId)) updateEntity.Zap2ItId = zap2ItId;
            if (!string.IsNullOrEmpty(network)) updateEntity.Network = network;
            if (!string.IsNullOrEmpty(contentRating)) updateEntity.ContentRating = contentRating;
            if (rating > 0) updateEntity.Rating = rating;
            if (status.HasValue) updateEntity.StatusId = (int)status;
            if (airTime.HasValue) updateEntity.AirTimeUtc = airTime;
            if (firstAired != new DateTime()) updateEntity.FirstAiredUtc = firstAired;
            if (!string.IsNullOrEmpty(imdbId)) updateEntity.Imdbid = imdbId;
            if (runtime > 0) updateEntity.RuntimeMinutes = runtime;
            if (lastUpdateTheTVDB.HasValue) updateEntity.LastUpdateTheTvdbutc = lastUpdateTheTVDB;

            Database.UpdateEntitiesDirectly(updateEntity, new RelationPredicateBucket(SeriesFields.SeriesId == seriesId));
        }
示例#17
0
        public ResultModel GetByStockIn(UserModel user, int stockInId, StatusEnum status = StatusEnum.已生效)
        {
            ResultModel result = new ResultModel();

            try
            {
                string cmdText = string.Format("select * from dbo.St_StockInStock_Ref where StockInId = {0} and RefStatus >={1}", stockInId, (int)status);

                result = Get(user, CommandType.Text, cmdText, null);
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
                return result;
            }

            return result;
        }
示例#18
0
        internal void Update(StatusEnum status)
        {
            this.LastStatus = Status;
            this.Status = status;
            this.LastHeartbeat = DateTime.UtcNow;

            //based on the status passed, also modify other datetimes
            switch (this.Status)
            {
                case StatusEnum.Green:
                    this.LastGreen = this.LastHeartbeat;
                    break;
                case StatusEnum.Yellow:
                    this.LastYellow = this.LastHeartbeat;
                    break;
                case StatusEnum.Red:
                    this.LastRed = this.LastHeartbeat;
                    break;
            }
        }
示例#19
0
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
   string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny<Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
   if (attachments != null)
     m_attachments = attachments;
   else
     m_attachments = new SortedSetAny<Attachment>();
   m_reportedBy = reportedBy;
   m_project = project;
   m_component = component;
   m_affectedComponentSet = new SortedSetAny<Component>(1);
   if (component != null)
     m_affectedComponentSet.Add(component);
   m_affectedVersionSet = new SortedSetAny<ProductVersion>(1);
   if (version != null)
     m_affectedVersionSet.Add(version);
   m_voteSet = new SortedSetAny<Vote>(1);
   m_relatedIssueSet = new SortedSetAny<Issue>(1);
   m_fixedInVersionSet = new SortedSetAny<ProductVersion>(1);
   m_subTaskSet = new SortedSetAny<SubTask>(1);
   m_labelSet = new SortedSetAny<ProductLabel>(1);
   m_version = version;
   m_summary = summary;
   m_description = description;
   m_environment = environment;
   m_category = category;
   m_priority = priority;
   m_fixResolution = resolution;
   m_dateTimeCreated = DateTime.Now;
   m_dateTimeLastUpdated = m_dateTimeCreated;
   m_fixmessage = null;
   m_lastUpdatedBy = reportedBy;
   m_dueDate = dueDate;
   m_status = status;
   AssignedTo = assignedTo;
   m_subscribers = null; // to do
   m_testCase = null;// to do
 }
示例#20
0
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
   string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny<Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
   if (attachments != null)
     this.attachments = attachments;
   else
     this.attachments = new SortedSetAny<Attachment>();
   this.reportedBy = reportedBy;
   this.project = project;
   this.component = component;
   affectedComponentSet = new SortedSetAny<Component>(1);
   if (component != null)
     affectedComponentSet.Add(component);
   affectedVersionSet = new SortedSetAny<ProductVersion>(1);
   if (version != null)
     affectedVersionSet.Add(version);
   voteSet = new SortedSetAny<Vote>(1);
   relatedIssueSet = new SortedSetAny<Issue>(1);
   fixedInVersionSet = new SortedSetAny<ProductVersion>(1);
   subTaskSet = new SortedSetAny<SubTask>(1);
   labelSet = new SortedSetAny<ProductLabel>(1);
   this.version = version;
   this.summary = summary;
   this.description = description;
   this.environment = environment;
   this.category = category;
   this.priority = priority;
   fixResolution = resolution;
   dateTimeCreated = DateTime.Now;
   dateTimeLastUpdated = dateTimeCreated;
   fixmessage = null;
   lastUpdatedBy = reportedBy;
   this.dueDate = dueDate;
   this.status = status;
   this.AssignedTo = assignedTo;
   subscribers = null; // to do
   testCase = null;// to do
 }
示例#21
0
        public static void SendAlert(int tipoEntidad, int codEntidad, string accion, StatusEnum status, List<ArtCambiosDetalle> detalles)
        {
            var tipo = "";
            switch (tipoEntidad)
            {
                case 1:
                    tipo = "Trilogia";
                    break;
                case 2:
                    tipo = "Medico";
                    break;
                case 3:
                    tipo = "LDV";
                    break;
            }

            var asunto = String.Format("Cambio {0} de(l) (la) {1} Codigo {2} ", status, tipo, codEntidad);
            var cuerpoMensaje = BuildMessageBody(tipoEntidad, codEntidad, tipo, status, accion, detalles);
            var destinatarios = GetUsuariosAfectados(tipoEntidad, codEntidad, accion);
            var smtpMail = new Avaruz.FrameWork.Infraestructure.Mail();

            smtpMail.SendMail(destinatarios, asunto, cuerpoMensaje, "*****@*****.**", true);
        }
示例#22
0
        /// <summary>
        /// Alters the package state. Created because receiving, discarding and distributing do essentially
        /// the same thing - find the package Id, update the staff and status of it.
        /// </summary>
        /// <param name="packageId">ID of the package</param>
        /// <param name="staffId">ID of the staff</param>
        /// <param name="status">The new package status</param>
        public static PackageStatus AlterPackage(int packageId, string staffId, StatusEnum status)
        {
            using (var context = new Entities())
            {
                try
                {
                    var staffCentreQuery = from s in context.AspNetUsers where s.Id == staffId select s;
                    int centreId = (int)staffCentreQuery.FirstOrDefault().CentreId;

                    var packageStatusQuery = from p in context.PackageStatus where p.PackageID == packageId select p;
                    PackageStatus currentPackageStatus = packageStatusQuery.First();
                    currentPackageStatus.StaffID = staffId;
                    currentPackageStatus.DestinationCentreID = centreId;
                    currentPackageStatus.Status = (int)status;
                    context.SaveChanges();

                    return currentPackageStatus;
                }
                catch (NullReferenceException)
                {
                    return null;
                }
            }
        }
        private void btnBevestig_Click(object sender, EventArgs e)
        {
            int tramNr;

            if(cbbTramStatus.Text == StatusEnum.Remise.ToString()) Status = StatusEnum.Remise;
            else if(cbbTramStatus.Text == StatusEnum.Defect.ToString()) Status = StatusEnum.Defect;
            else if(cbbTramStatus.Text == StatusEnum.Dienst.ToString()) Status = StatusEnum.Dienst;
            else if(cbbTramStatus.Text == StatusEnum.Schoonmaak.ToString()) Status = StatusEnum.Schoonmaak;

            if (Int32.TryParse(tbTramnummer.Text, out tramNr) == false)
            {
                MessageBox.Show("Ongeldige invoer in tramnummer textbox");
                return;
            }

            //controleren of de tram bestaat
            if (Remise.Instance.BestaatTram(tramNr) == false)
            {
                MessageBox.Show("De ingevoerde tram bestaat niet");
                return;
            }

            //controleren of de status anders is
            Tram t = Remise.Instance.GeefTram(tramNr);
            TramID = t.TramID;

            if (t.StatusEnum == Status)
            {
                MessageBox.Show("De tram heeft al de gewenste status");
                return;
            }

            //form sluiten
            Uitvoeren = true;
            Close();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageManagementStreamUpdateSpec" /> class.
 /// </summary>
 /// <param name="additionalDetails">Additional details about image management stream..</param>
 /// <param name="description">Image management stream description..</param>
 /// <param name="name">Image management stream name. (required).</param>
 /// <param name="operatingSystem">Operating system. * UNKNOWN: Unknown * WINDOWS_XP: Windows XP * WINDOWS_VISTA: Windows Vista * WINDOWS_7: Windows 7 * WINDOWS_8: Windows 8 * WINDOWS_10: Windows 10 * WINDOWS_SERVER_2003: Windows Server 2003 * WINDOWS_SERVER_2008: Windows Server 2008 * WINDOWS_SERVER_2008_R2: Windows Server 2008 R2 * WINDOWS_SERVER_2012: Windows Server 2012 * WINDOWS_SERVER_2012_R2: Windows Server 2012 R2 * WINDOWS_SERVER_2016_OR_ABOVE: Windows Server 2016 or above * LINUX_OTHER: Linux (other) * LINUX_SERVER_OTHER: Linux server (other) * LINUX_UBUNTU: Linux (Ubuntu) * LINUX_RHEL: Linux (Red Hat Enterprise) * LINUX_SUSE: Linux (Suse) * LINUX_CENTOS: Linux (CentOS) (required).</param>
 /// <param name="publisher">Image management stream publisher.</param>
 /// <param name="source">Image management stream source. * MARKET_PLACE: Image management stream is from market place. * UPLOADED: Image management stream is uploaded. * COPIED_FROM_STREAM: Image management stream is copied from another stream. * COPIED_FROM_VERSION: Image management stream is copied from a version. (required).</param>
 /// <param name="status">Image management stream status. * AVAILABLE: Image management stream is available for desktop pools/farms to be created. * DELETED: Image management stream is deleted. * DISABLED: Image management stream is disabled and no further desktop pools/farms can be created using the same. * FAILED: Image management stream creation has failed. * IN_PROGRESS: Image management stream creation is in progress. * PARTIALLY_AVAILABLE: Image management version for this stream could not be created in one or more environments. * PENDING: Image management stream is in pending state. (required).</param>
 public ImageManagementStreamUpdateSpec(Dictionary <string, string> additionalDetails = default(Dictionary <string, string>), string description = default(string), string name = default(string), OperatingSystemEnum operatingSystem = default(OperatingSystemEnum), string publisher = default(string), SourceEnum source = default(SourceEnum), StatusEnum status = default(StatusEnum))
 {
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for ImageManagementStreamUpdateSpec and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     // to ensure "operatingSystem" is required (not null)
     if (operatingSystem == null)
     {
         throw new InvalidDataException("operatingSystem is a required property for ImageManagementStreamUpdateSpec and cannot be null");
     }
     else
     {
         this.OperatingSystem = operatingSystem;
     }
     // to ensure "source" is required (not null)
     if (source == null)
     {
         throw new InvalidDataException("source is a required property for ImageManagementStreamUpdateSpec and cannot be null");
     }
     else
     {
         this.Source = source;
     }
     // to ensure "status" is required (not null)
     if (status == null)
     {
         throw new InvalidDataException("status is a required property for ImageManagementStreamUpdateSpec and cannot be null");
     }
     else
     {
         this.Status = status;
     }
     this.AdditionalDetails = additionalDetails;
     this.Description       = description;
     this.Publisher         = publisher;
 }
示例#25
0
 public void DeleteStatus(StatusEnum se)
 {
     statusDic [se].Inactivate();
 }
示例#26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OBWriteInternationalConsentResponse3Data" /> class.
 /// </summary>
 /// <param name="consentId">OB: Unique identification as assigned by the ASPSP to uniquely identify the consent resource. (required).</param>
 /// <param name="creationDateTime">Date and time at which the resource was created.All dates in the JSON payloads are represented in ISO 8601 date-time format.  All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00 (required).</param>
 /// <param name="status">Specifies the status of consent resource in code form. (required).</param>
 /// <param name="statusUpdateDateTime">Date and time at which the resource status was updated.All dates in the JSON payloads are represented in ISO 8601 date-time format.  All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00 (required).</param>
 /// <param name="cutOffDateTime">Specified cut-off date and time for the payment consent.All dates in the JSON payloads are represented in ISO 8601 date-time format.  All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00.</param>
 /// <param name="expectedExecutionDateTime">Expected execution date and time for the payment resource.All dates in the JSON payloads are represented in ISO 8601 date-time format.  All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00.</param>
 /// <param name="expectedSettlementDateTime">Expected settlement date and time for the payment resource.All dates in the JSON payloads are represented in ISO 8601 date-time format.  All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00.</param>
 /// <param name="charges">charges.</param>
 /// <param name="exchangeRateInformation">exchangeRateInformation.</param>
 /// <param name="initiation">initiation (required).</param>
 /// <param name="authorisation">authorisation.</param>
 /// <param name="sCASupportData">sCASupportData.</param>
 public OBWriteInternationalConsentResponse3Data(string consentId = default(string), DateTimeOffset creationDateTime = default(DateTimeOffset), StatusEnum status = default(StatusEnum), DateTimeOffset statusUpdateDateTime = default(DateTimeOffset), DateTimeOffset cutOffDateTime = default(DateTimeOffset), DateTimeOffset expectedExecutionDateTime = default(DateTimeOffset), DateTimeOffset expectedSettlementDateTime = default(DateTimeOffset), List <OBWriteDomesticConsentResponse3DataCharges> charges = default(List <OBWriteDomesticConsentResponse3DataCharges>), OBWriteInternationalConsentResponse3DataExchangeRateInformation exchangeRateInformation = default(OBWriteInternationalConsentResponse3DataExchangeRateInformation), OBWriteInternational2DataInitiation initiation = default(OBWriteInternational2DataInitiation), OBWriteDomesticConsent3DataAuthorisation authorisation = default(OBWriteDomesticConsent3DataAuthorisation), OBWriteDomesticConsent3DataSCASupportData sCASupportData = default(OBWriteDomesticConsent3DataSCASupportData))
 {
     // to ensure "consentId" is required (not null)
     this.ConsentId            = consentId ?? throw new ArgumentNullException("consentId is a required property for OBWriteInternationalConsentResponse3Data and cannot be null");
     this.CreationDateTime     = creationDateTime;
     this.Status               = status;
     this.StatusUpdateDateTime = statusUpdateDateTime;
     // to ensure "initiation" is required (not null)
     this.Initiation                 = initiation ?? throw new ArgumentNullException("initiation is a required property for OBWriteInternationalConsentResponse3Data and cannot be null");
     this.CutOffDateTime             = cutOffDateTime;
     this.ExpectedExecutionDateTime  = expectedExecutionDateTime;
     this.ExpectedSettlementDateTime = expectedSettlementDateTime;
     this.Charges = charges;
     this.ExchangeRateInformation = exchangeRateInformation;
     this.Authorisation           = authorisation;
     this.SCASupportData          = sCASupportData;
 }
示例#27
0
        //get Offspring
        public static List <Cattle> GetAnimalsOffSpring(int UId, int AnimalID, string gender, Person person)
        {
            ac.OpenConnection();

//            create procedure GetAnimalOffspring
//@UID Bigint,
//@AID Bigint,
//@ParentGender varchar(100)

            List <Cattle> cattle = new List <Cattle>();

            //parameter and variable of this Procedure
            string[] variables = new string[] { "@UID", "@AID", "@ParentGender" };
            string[] values    = new string[] { "" + UId, AnimalID.ToString(), gender };

            //get data from  database
            DataTable data = ac.ExecuteDataTableProcedure("GetAnimalOffspring", variables, values, ac);



            if (data.Rows.Count != 0)
            {
                foreach (DataRow row in data.Rows)
                {
                    //A.PERSONID,
                    //A.AnimalTid	        0, A.AnimalType 1,	 A.AnimalBreed 2, A.AnimalCustomID 3,	 A.AnimalCurOwnerSignature 4,	 A.AnimalGender        5,
                    //A.AnimalAge            6, A.AnimalYear 7,	 A.AnimalMonth 8, A.AnimalDay      9,	 A.AnimalStatus            10,	 A.IdentificationChar  11,
                    //C.CattleParentFatherID 12,	C.CattleParentMotherID	13,C.CattleImage	14,C.CattleScotralSize	15,C.CattleColor	16,C.CattleBreedingStatus	17,
                    //C.CattleFrameSize	18,C.CattleBirthWeight	19,C.CattleWeaningWeight	20,C.CattlePostWeaningWeight	21,C.CattleAdultSxWeight 22,
                    //C.CattleCurrentAdultWeight 23,	C.CattleCurrentWeightDateTaken 24

                    //offspring
                    List <Cattle> offSpring = new List <Cattle>();
                    #region Enums
                    //frame size
                    FrameSize frmeSize = (FrameSize)Enum.Parse(typeof(FrameSize), row[19].ToString());
                    //Breeding status
                    BreedingStatus bStatus = (BreedingStatus)Enum.Parse(typeof(BreedingStatus), row[18].ToString());
                    //Status Enum
                    StatusEnum sStatus = (StatusEnum)Enum.Parse(typeof(StatusEnum), row[11].ToString());
                    //Gender Enum
                    GenderEnum gEnum = (GenderEnum)Enum.Parse(typeof(GenderEnum), row[6].ToString());
                    //animal type
                    AnimalTypeEnum animalType = (AnimalTypeEnum)Enum.Parse(typeof(AnimalTypeEnum), row[2].ToString());
                    #endregion

                    //weights
                    List <double>   weights    = DataAccessData.AnimalWeightHistory(person.PId, int.Parse(row[1].ToString())).Values.ToList();
                    List <DateTime> weightDate = DataAccessData.AnimalWeightHistory(person.PId, int.Parse(row[1].ToString())).Keys.ToList();
                    cattle.Add
                    (
                        new Cattle
                        (
                            int.Parse(row[1].ToString()), row[3].ToString(), gEnum, double.Parse(row[7].ToString()),
                            int.Parse(row[8].ToString()), int.Parse(row[9].ToString()), int.Parse(row[10].ToString()),
                            animalType, row[4].ToString(), row[5].ToString(), person.PId, person.PId, person.PName, person.PSurname, person.Dob, 14478899, int.Parse(row[13].ToString()), int.Parse(row[14].ToString()),
                            row[15].ToString()
                            , null,
                            sStatus, double.Parse(row[16].ToString()), row[17].ToString(),
                            bStatus, frmeSize,

                            double.Parse(row[20].ToString()), double.Parse(row[21].ToString()), double.Parse(row[22].ToString()),
                            double.Parse(row[23].ToString()), double.Parse(row[24].ToString()), DateTime.Parse(row[25].ToString()), null, weights, weightDate

                        ));
                }
            }


            return(cattle);
        }
示例#28
0
 //暂不存在状态转换,空方法填充
 public override void SetModelStatus(StatusEnum value, Building element, bool noAnimation = true)
 {
 }
示例#29
0
 public UIMessageEventArgs(MessageIdentifiersEnum messageIdentifiers, StatusEnum status)
 {
     MessageIdentifiers = messageIdentifiers;
     Status             = status;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApprovalRequestResponseApprovalRequestApprovers" /> class.
 /// </summary>
 /// <param name="isForceAction">代理承認済みかどうか (required).</param>
 /// <param name="resourceType">承認ステップの承認方法 * &#x60; predefined_user&#x60; - メンバー指定 (1人), * &#x60; selected_user&#x60; - 申請時にメンバー指定 * &#x60; unspecified&#x60; - 指定なし * &#x60; and_resource&#x60; - メンバー指定 (複数、全員の承認), * &#x60; or_resource&#x60; - メンバー指定 (複数、1人の承認) * &#x60; and_position&#x60; - 役職指定 (複数、全員の承認) * &#x60; or_position&#x60; - 役職指定 (複数、1人の承認) (required).</param>
 /// <param name="status">承認者の承認状態 * &#x60;initial&#x60; - 初期状態 * &#x60;approved&#x60; - 承認済 * &#x60;rejected&#x60; - 却下 * &#x60;feedback&#x60; - 差戻し (required).</param>
 /// <param name="stepId">承認ステップID (required).</param>
 /// <param name="userId">承認者のユーザーID 下記の場合はnullになります。 &lt;ul&gt;   &lt;li&gt;resource_type:selected_userの場合で承認者未指定時&lt;/li&gt;   &lt;li&gt;resource_type:or_positionで前stepで部門未指定の場合&lt;/li&gt; &lt;/ul&gt; (required).</param>
 public ApprovalRequestResponseApprovalRequestApprovers(bool isForceAction = default(bool), ResourceTypeEnum resourceType = default(ResourceTypeEnum), StatusEnum status = default(StatusEnum), int stepId = default(int), int?userId = default(int?))
 {
     this.IsForceAction = isForceAction;
     this.ResourceType  = resourceType;
     this.Status        = status;
     this.StepId        = stepId;
     // to ensure "userId" is required (not null)
     this.UserId = userId ?? throw new ArgumentNullException("userId is a required property for ApprovalRequestResponseApprovalRequestApprovers and cannot be null");
 }
 public void Deconstruct(out StatusEnum status, out TEntity entity, out bool isSuccess)
 {
     status    = Status;
     entity    = Entity;
     isSuccess = (Status == StatusEnum.Success || Status == StatusEnum.NoNeedToSave) && Entity != null;
 }
 public MethodStatus(StatusEnum status, TEntity entity = default, string tag = null)
 {
     Tag    = tag;
     Status = status;
     Entity = entity;
 }
 public void Deconstruct(out StatusEnum status, out TEntity entity)
 {
     status = Status;
     entity = Entity;
 }
        // Update content, play animation, play sound, display for a while, then automatically hide
        // Callback only used when there are two buttons
        // Might also consider adding a log, especially for errors
        public void Update(StatusEnum status, string text, ActionsEnum action, PlacementEnum placement, ActionCallBack callback = null)
        {
            // Save parameters
            Status   = status;
            Text     = text;
            Action   = action;
            CallBack = callback;

            // Reconfigure timer
            dispatcherTimer.Interval = new TimeSpan(0, 0, 7);

            // Update Content
            StatusLabel.Content = Status.ToString(); // Update status label
            switch (Status)                          // Update status icon
            {
            case StatusEnum.Event:
                // StatusIcon.Source = ...
                break;

            case StatusEnum.TimerEvent:
                // StatusIcon.Source = ...
                break;

            case StatusEnum.Notice:
                // StatusIcon.Source = ...
                dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
                break;

            case StatusEnum.Welcome:
                // StatusIcon.Source = ...
                break;

            case StatusEnum.Error:
                // StatusIcon.Source = ...
                break;

            default:
                break;
            }
            StatusTextBlock.Text = Text; // Update status text
            switch (Action)              // Update buttons
            {
            case ActionsEnum.AcceptCancel:
                LeftButton.Content      = "Accept";
                LeftButton.Visibility   = Visibility.Visible;
                RightButton.Content     = "Cancel";
                RightButton.Visibility  = Visibility.Visible;
                CenterButton.Visibility = Visibility.Hidden;
                break;

            case ActionsEnum.YesNo:
                LeftButton.Content      = "Yes";
                LeftButton.Visibility   = Visibility.Visible;
                RightButton.Content     = "No";
                RightButton.Visibility  = Visibility.Visible;
                CenterButton.Visibility = Visibility.Hidden;
                break;

            case ActionsEnum.Acknowledge:
                LeftButton.Visibility   = Visibility.Hidden;
                RightButton.Visibility  = Visibility.Hidden;
                CenterButton.Content    = "Ackownledge";
                CenterButton.Visibility = Visibility.Visible;
                break;

            case ActionsEnum.None:
                LeftButton.Visibility   = Visibility.Hidden;
                RightButton.Visibility  = Visibility.Hidden;
                CenterButton.Visibility = Visibility.Hidden;
                break;

            default:
                break;
            }

            // Restart timer
            dispatcherTimer.Stop();
            dispatcherTimer.Start();

            // Display Contents
            this.Visibility = Visibility.Visible;

            // Set window location
            Rect workingArea = new Rect(Owner.Left, Owner.Top, Owner.Width, Owner.Height);

            switch (placement)
            {
            case PlacementEnum.UpperRight:
                this.Left = workingArea.Right - this.Width - 50;
                this.Top  = workingArea.Top + 50;
                break;

            case PlacementEnum.LowerRight:
                this.Left = workingArea.Right - this.Width - 50;
                this.Top  = workingArea.Bottom - this.ActualHeight - 80;
                break;

            default:
                break;
            }
        }
 public ExceptionResult(StatusEnum Code)
 {
     StatusEnum = Code;
     Message    = EnumHelper.GetDisplayName(Code);
 }
        public void Synchronize(ProgressDelegate progress)
        {
            if (!MovingPicturesCore.Settings.FollwitEnabled) {
                logger.Warn("Attempt to call follw.it made when service is disabled.");
                return;
            }

            if (!IsOnline) {
                logger.Warn("Can not synchonize to follw.it because service is offline");
                return;
            }

            try {
                logger.Info("Synchronizing with follw.it.");
                List<DBMovieInfo> moviesToSynch;
                List<DBMovieInfo> moviesToExclude;

                if (MovingPicturesCore.Settings.RestrictSynchronizedMovies) {
                    moviesToSynch = new List<DBMovieInfo>();
                    moviesToExclude = new List<DBMovieInfo>();

                    moviesToSynch.AddRange(MovingPicturesCore.Settings.FollwitSyncFilter.Filter(DBMovieInfo.GetAll()));
                    moviesToExclude.AddRange(DBMovieInfo.GetAll().Except(moviesToSynch));

                    logger.Debug("Using synchronization filter. Syncing {0} movies. Excluding {1} movies.", moviesToSynch.Count, moviesToExclude.Count);
                }
                else {
                    moviesToSynch = DBMovieInfo.GetAll();
                    moviesToExclude = new List<DBMovieInfo>();
                    logger.Debug("Syncing {0} movies.", moviesToSynch.Count);
                }

                moviesToSynch = moviesToSynch.OrderBy(m => m.DateAdded).ToList();

                UploadMovieInfo(moviesToSynch, progress);
                RemoveFilteredMovies(moviesToExclude, progress);
            }
            catch (Exception ex) {
                logger.ErrorException("Unexpected error synchronizing with follw.it!", ex);
                _follwitAPI = null;
                Status = StatusEnum.INTERNAL_ERROR;
                return;
            }

            return;
        }
示例#37
0
 public WorkerModel(string name, int age)
 {
     _personAge  = age;
     _personName = name;
     status      = StatusEnum.Worker;
 }
 /// <summary>
 /// Turns off device
 /// </summary>
 /// <returns>Returns the status of device after operation</returns>
 public async Task<StatusEnum> TurnOff(int SlaveAddress)
 {
     var Response = await Communication.I2C_Helper.WriteRead(SlaveAddress, Communication.I2C_Helper.Mode.Mode2, (byte)Pin, 0);
     Status = StatusEnum.Off;
     return Status;
 }
示例#39
0
 private void button1_Click(object sender, EventArgs e)
 {
     Status             = Status == StatusEnum.start ? StatusEnum.stop : StatusEnum.start;
     lblHelloWorld.Text = Enum.GetName(typeof(StatusEnum), Status);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LegalNotationsOnStrataCommonProperty" /> class.
 /// </summary>
 /// <param name="legalNotationNumber">Legal Notation Number (required).</param>
 /// <param name="status">State of the Legal Notation on Title.  Only active Legal Notation are presented on Current View of Title.  (required).</param>
 /// <param name="cancellationDate">Legal Notation Cancellation Date.</param>
 /// <param name="legalNotation">legalNotation (required).</param>
 public LegalNotationsOnStrataCommonProperty(string legalNotationNumber = default, StatusEnum status = default, DateTime?cancellationDate = default, LegalNotation legalNotation = default)
 {
     // to ensure "legalNotationNumber" is required (not null)
     if (legalNotationNumber == null)
     {
         throw new InvalidDataException("legalNotationNumber is a required property for LegalNotationsOnStrataCommonProperty and cannot be null");
     }
     else
     {
         this.LegalNotationNumber = legalNotationNumber;
     }
     // to ensure "legalNotation" is required (not null)
     if (legalNotation == null)
     {
         throw new InvalidDataException("legalNotation is a required property for LegalNotationsOnStrataCommonProperty and cannot be null");
     }
     else
     {
         this.LegalNotation = legalNotation;
     }
     this.Status           = status;
     this.CancellationDate = cancellationDate;
 }
示例#41
0
        private void initialPage()
        {
            this.CommandName = CommandNameEnum.Add;
            tb_m_detail_spec detailSpec = new tb_m_detail_spec();

            detailSpec.specification_id = this.jobSample.specification_id;
            detailSpec.template_id      = this.jobSample.template_id;

            tb_m_component comp = new tb_m_component();

            comp.specification_id = this.jobSample.specification_id;
            comp.template_id      = this.jobSample.template_id;


            ddlAssignTo.Items.Clear();
            ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LOGIN_SELECT_SPEC), Convert.ToInt16(StatusEnum.LOGIN_SELECT_SPEC) + ""));
            ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.CHEMIST_TESTING), Convert.ToInt16(StatusEnum.CHEMIST_TESTING) + ""));
            ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.SR_CHEMIST_CHECKING), Convert.ToInt16(StatusEnum.SR_CHEMIST_CHECKING) + ""));
            ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.ADMIN_CONVERT_WORD), Convert.ToInt16(StatusEnum.ADMIN_CONVERT_WORD) + ""));
            ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LABMANAGER_CHECKING), Convert.ToInt16(StatusEnum.LABMANAGER_CHECKING) + ""));
            ddlAssignTo.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.ADMIN_CONVERT_PDF), Convert.ToInt16(StatusEnum.ADMIN_CONVERT_PDF) + ""));

            #region "SAMPLE"
            if (this.jobSample != null)
            {
                RoleEnum   userRole = (RoleEnum)Enum.Parse(typeof(RoleEnum), userLogin.role_id.ToString(), true);
                StatusEnum status   = (StatusEnum)Enum.Parse(typeof(StatusEnum), this.jobSample.job_status.ToString(), true);
                lbJobStatus.Text = Constants.GetEnumDescription(status);
                ddlStatus.Items.Clear();

                pRemark.Visible     = false;
                pDisapprove.Visible = false;
                pStatus.Visible     = false;
                pUploadfile.Visible = false;
                pDownload.Visible   = false;
                btnSubmit.Visible   = false;

                //lbDowloadWorkSheet.Text = this.jobSample.job_number;
                lbDownload.Text          = this.jobSample.job_number;
                pUploadWorkSheet.Visible = false;
                pCoverpage.Visible       = true;


                switch (userRole)
                {
                case RoleEnum.LOGIN:
                    if (status == StatusEnum.LOGIN_SELECT_SPEC)
                    {
                        pRemark.Visible     = false;
                        pDisapprove.Visible = false;
                        pStatus.Visible     = false;
                        pUploadfile.Visible = false;
                        pDownload.Visible   = false;
                        btnSubmit.Visible   = true;
                    }
                    break;

                case RoleEnum.CHEMIST:
                    if (status == StatusEnum.CHEMIST_TESTING)
                    {
                        pRemark.Visible          = false;
                        pDisapprove.Visible      = false;
                        pStatus.Visible          = false;
                        pUploadfile.Visible      = false;
                        pDownload.Visible        = false;
                        btnSubmit.Visible        = true;
                        pUploadWorkSheet.Visible = true;
                    }
                    break;

                case RoleEnum.SR_CHEMIST:
                    if (status == StatusEnum.SR_CHEMIST_CHECKING)
                    {
                        ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.SR_CHEMIST_APPROVE), Convert.ToInt16(StatusEnum.SR_CHEMIST_APPROVE) + ""));
                        ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.SR_CHEMIST_DISAPPROVE), Convert.ToInt16(StatusEnum.SR_CHEMIST_DISAPPROVE) + ""));
                        pRemark.Visible     = false;
                        pDisapprove.Visible = false;
                        pStatus.Visible     = true;
                        pUploadfile.Visible = false;
                        pDownload.Visible   = true;
                        btnSubmit.Visible   = true;
                    }
                    break;

                case RoleEnum.ADMIN:
                    lbDownload.Text = this.jobSample.job_number;
                    switch (status)
                    {
                    case StatusEnum.ADMIN_CONVERT_WORD:
                        pRemark.Visible     = false;
                        pDisapprove.Visible = false;
                        pStatus.Visible     = false;
                        pUploadfile.Visible = true;
                        pDownload.Visible   = true;
                        btnSubmit.Visible   = true;
                        pCoverpage.Visible  = false;

                        lbDesc.Text = "ดาวโหลดไฟล์ Excel ที่ผ่านการ Sr.Chemist Approve แล้วมาแปลงเป็นไฟล์ word";
                        break;

                    case StatusEnum.ADMIN_CONVERT_PDF:
                        pRemark.Visible     = false;
                        pDisapprove.Visible = false;
                        pStatus.Visible     = false;
                        pUploadfile.Visible = true;
                        pDownload.Visible   = true;
                        btnSubmit.Visible   = true;
                        pCoverpage.Visible  = false;
                        lbDesc.Text         = "ดาวโหลดไฟล์ word ที่ผ่านการ labManager Approve แล้วมาแปลงเป็นไฟล์ pdf";

                        break;
                    }
                    //if (status == StatusEnum.ADMIN_CONVERT_PDF || status == StatusEnum.ADMIN_CONVERT_WORD)
                    //{
                    //    pRemark.Visible = false;
                    //    pDisapprove.Visible = false;
                    //    pStatus.Visible = false;
                    //    pUploadfile.Visible = true;
                    //    pDownload.Visible = true;
                    //    btnSubmit.Visible = true;
                    //    pCoverpage.Visible = false;
                    //}
                    break;

                case RoleEnum.LABMANAGER:
                    if (status == StatusEnum.LABMANAGER_CHECKING)
                    {
                        lbDownload.Text = this.jobSample.job_number;
                        lbDesc.Text     = "ดาวโหลดไฟล์ word มาตรวจสอบ";

                        ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LABMANAGER_APPROVE), Convert.ToInt16(StatusEnum.LABMANAGER_APPROVE) + ""));
                        ddlStatus.Items.Add(new ListItem(Constants.GetEnumDescription(StatusEnum.LABMANAGER_DISAPPROVE), Convert.ToInt16(StatusEnum.LABMANAGER_DISAPPROVE) + ""));
                        pRemark.Visible     = false;
                        pDisapprove.Visible = false;
                        pStatus.Visible     = true;
                        pUploadfile.Visible = false;
                        pDownload.Visible   = true;
                        btnSubmit.Visible   = true;
                        pCoverpage.Visible  = false;
                    }
                    break;
                }
                #region "METHOD/PROCEDURE:"

                if (status == StatusEnum.CHEMIST_TESTING || userLogin.role_id == Convert.ToInt32(RoleEnum.CHEMIST))
                {
                    #region ":: STAMP ANALYZED DATE ::"
                    if (userLogin.role_id == Convert.ToInt32(RoleEnum.CHEMIST))
                    {
                        if (this.jobSample.date_chemist_alalyze == null)
                        {
                            this.jobSample.date_chemist_alalyze = DateTime.Now;
                            this.jobSample.Update();
                        }
                    }
                    #endregion
                    btnCoverPage.Visible = true;
                    btnDHS.Visible       = true;
                }
                else
                {
                    btnCoverPage.Visible = false;
                    btnDHS.Visible       = false;

                    if (userLogin.role_id == Convert.ToInt32(RoleEnum.SR_CHEMIST))
                    {
                        btnCoverPage.Visible = true;
                        btnDHS.Visible       = true;
                    }
                }
                #endregion
            }

            #endregion


            //initial button.
            btnCoverPage.CssClass = "btn blue";
            btnDHS.CssClass       = "btn green";
            //pCoverpage.Visible = true;
            pDSH.Visible = false;

            //switch (lbJobStatus.Text)
            //{
            //    case "CONVERT_PDF":
            //        litDownloadIcon.Text = "<i class=\"fa fa-file-pdf-o\"></i>";
            //        break;
            //    default:
            //        litDownloadIcon.Text = "<i class=\"fa fa-file-word-o\"></i>";
            //        break;
            //}
        }
示例#42
0
 /// <summary>
 /// 批量更新~恢复或者删除
 /// </summary>
 /// <param name="ids"></param>
 /// <param name="status"></param>
 /// <returns></returns>
 public abstract Task <JsonResult> UpdateList(string ids, StatusEnum status);
示例#43
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Boolean isValid = true;

            StatusEnum status = (StatusEnum)Enum.Parse(typeof(StatusEnum), this.jobSample.job_status.ToString(), true);

            switch (status)
            {
            case StatusEnum.CHEMIST_TESTING:

                if (FileUpload2.HasFile)    // && (Path.GetExtension(FileUpload2.FileName).Equals(".doc") || Path.GetExtension(FileUpload2.FileName).Equals(".docx")))
                {
                    string yyyy = DateTime.Now.ToString("yyyy");
                    string MM   = DateTime.Now.ToString("MM");
                    string dd   = DateTime.Now.ToString("dd");


                    String source_file     = String.Format(Configurations.PATH_SOURCE, yyyy, MM, dd, this.jobSample.job_number, Path.GetFileName(CustomUtils.removeSpacialCharacter(FileUpload2.FileName)));
                    String source_file_url = String.Format(Configurations.PATH_URL, yyyy, MM, dd, this.jobSample.job_number, Path.GetFileName(CustomUtils.removeSpacialCharacter(FileUpload2.FileName)));


                    if (!Directory.Exists(Path.GetDirectoryName(source_file)))
                    {
                        Directory.CreateDirectory(Path.GetDirectoryName(source_file));
                    }
                    FileUpload2.SaveAs(source_file);
                    this.jobSample.ad_hoc_tempalte_path = source_file_url;
                }

                this.jobSample.job_status            = Convert.ToInt32(StatusEnum.SR_CHEMIST_CHECKING);
                this.jobSample.step2owner            = userLogin.id;
                this.jobSample.date_chemist_complete = DateTime.Now;

                break;

            case StatusEnum.SR_CHEMIST_CHECKING:
                StatusEnum srChemistApproveStatus = (StatusEnum)Enum.Parse(typeof(StatusEnum), ddlStatus.SelectedValue, true);
                switch (srChemistApproveStatus)
                {
                case StatusEnum.SR_CHEMIST_APPROVE:
                    this.jobSample.job_status = Convert.ToInt32(StatusEnum.JOB_COMPLETE);
                    #region ":: STAMP COMPLETE DATE"


                    this.jobSample.date_srchemist_complate = DateTime.Now;
                    #endregion
                    break;

                case StatusEnum.SR_CHEMIST_DISAPPROVE:
                    this.jobSample.job_status = Convert.ToInt32(StatusEnum.CHEMIST_TESTING);
                    #region "LOG"
                    job_sample_logs jobSampleLog = new job_sample_logs
                    {
                        ID            = 0,
                        job_sample_id = this.jobSample.ID,
                        log_title     = String.Format("Sr.Chemist DisApprove"),
                        job_remark    = txtRemark.Text,
                        is_active     = "0",
                        date          = DateTime.Now
                    };
                    jobSampleLog.Insert();
                    #endregion
                    break;
                }
                this.jobSample.step4owner = userLogin.id;
                break;

            case StatusEnum.LABMANAGER_CHECKING:
                StatusEnum labApproveStatus = (StatusEnum)Enum.Parse(typeof(StatusEnum), ddlStatus.SelectedValue, true);
                switch (labApproveStatus)
                {
                case StatusEnum.LABMANAGER_APPROVE:
                    this.jobSample.job_status = Convert.ToInt32(StatusEnum.ADMIN_CONVERT_PDF);

                    this.jobSample.date_labman_complete = DateTime.Now;
                    break;

                case StatusEnum.LABMANAGER_DISAPPROVE:
                    this.jobSample.job_status = Convert.ToInt32(ddlAssignTo.SelectedValue);
                    #region "LOG"
                    job_sample_logs jobSampleLog = new job_sample_logs
                    {
                        ID            = 0,
                        job_sample_id = this.jobSample.ID,
                        log_title     = String.Format("Lab Manager DisApprove"),
                        job_remark    = txtRemark.Text,
                        is_active     = "0",
                        date          = DateTime.Now
                    };
                    jobSampleLog.Insert();
                    #endregion
                    break;
                }
                this.jobSample.step5owner = userLogin.id;
                break;

            case StatusEnum.ADMIN_CONVERT_WORD:
                if (FileUpload1.HasFile)    // && (Path.GetExtension(FileUpload1.FileName).Equals(".doc") || Path.GetExtension(FileUpload1.FileName).Equals(".docx")))
                {
                    string yyyy = DateTime.Now.ToString("yyyy");
                    string MM   = DateTime.Now.ToString("MM");
                    string dd   = DateTime.Now.ToString("dd");

                    String source_file     = String.Format(Configurations.PATH_SOURCE, yyyy, MM, dd, this.jobSample.job_number, Path.GetFileName(FileUpload1.FileName));
                    String source_file_url = String.Format(Configurations.PATH_URL, yyyy, MM, dd, this.jobSample.job_number, Path.GetFileName(FileUpload1.FileName));


                    if (!Directory.Exists(Path.GetDirectoryName(source_file)))
                    {
                        Directory.CreateDirectory(Path.GetDirectoryName(source_file));
                    }
                    FileUpload1.SaveAs(source_file);
                    this.jobSample.path_word  = source_file_url;
                    this.jobSample.job_status = Convert.ToInt32(StatusEnum.LABMANAGER_CHECKING);
                }
                else
                {
                    errors.Add("Invalid File. Please upload a File with extension .doc|.docx");
                }
                this.jobSample.step6owner = userLogin.id;
                break;

            case StatusEnum.ADMIN_CONVERT_PDF:
                if (FileUpload1.HasFile)    // && (Path.GetExtension(FileUpload1.FileName).Equals(".pdf")))
                {
                    string yyyy = DateTime.Now.ToString("yyyy");
                    string MM   = DateTime.Now.ToString("MM");
                    string dd   = DateTime.Now.ToString("dd");

                    String source_file     = String.Format(Configurations.PATH_SOURCE, yyyy, MM, dd, this.jobSample.job_number, Path.GetFileName(FileUpload1.FileName));
                    String source_file_url = String.Format(Configurations.PATH_URL, yyyy, MM, dd, this.jobSample.job_number, Path.GetFileName(FileUpload1.FileName));


                    if (!Directory.Exists(Path.GetDirectoryName(source_file)))
                    {
                        Directory.CreateDirectory(Path.GetDirectoryName(source_file));
                    }
                    FileUpload1.SaveAs(source_file);
                    this.jobSample.path_pdf   = source_file_url;
                    this.jobSample.job_status = Convert.ToInt32(StatusEnum.JOB_COMPLETE);
                    this.jobSample.step7owner = userLogin.id;

                    //lbMessage.Text = string.Empty;
                }
                else
                {
                    errors.Add("Invalid File. Please upload a File with extension .pdf");
                    //lbMessage.Attributes["class"] = "alert alert-error";
                    //isValid = false;
                }
                break;
            }

            if (errors.Count > 0)
            {
                litErrorMessage.Text = MessageBox.GenWarnning(errors);
                modalErrorList.Show();
            }
            else
            {
                litErrorMessage.Text = String.Empty;
                //########
                this.jobSample.Update();
                //Commit
                GeneralManager.Commit();

                removeSession();
                MessageBox.Show(this.Page, Resources.MSG_SAVE_SUCCESS, PreviousPath);
            }
        }
示例#44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Player" /> class.
 /// </summary>
 /// <param name="Id">Id.</param>
 /// <param name="Name">Name (required).</param>
 /// <param name="Password">Password (required).</param>
 /// <param name="Game">Game.</param>
 /// <param name="Role">Role.</param>
 /// <param name="Session">Session.</param>
 /// <param name="Status">Player status in a game (required).</param>
 public Player(long?Id = default(long?), string Name = default(string), string Password = default(string), Game Game = default(Game), Role Role = default(Role), string Session = default(string), StatusEnum Status = default(StatusEnum))
 {
     // to ensure "Name" is required (not null)
     if (Name == null)
     {
         throw new InvalidDataException("Name is a required property for Player and cannot be null");
     }
     else
     {
         this.Name = Name;
     }
     // to ensure "Password" is required (not null)
     if (Password == null)
     {
         throw new InvalidDataException("Password is a required property for Player and cannot be null");
     }
     else
     {
         this.Password = Password;
     }
     // to ensure "Status" is required (not null)
     if (Status == null)
     {
         throw new InvalidDataException("Status is a required property for Player and cannot be null");
     }
     else
     {
         this.Status = Status;
     }
     this.Id      = Id;
     this.Game    = Game;
     this.Role    = Role;
     this.Session = Session;
 }
示例#45
0
 public void AddStatus(StatusEnum se)
 {
     statusDic [se].Activate();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetCharactersCharacterIdMedals200Ok" /> class.
 /// </summary>
 /// <param name="corporationId">corporation_id integer (required).</param>
 /// <param name="date">date string (required).</param>
 /// <param name="description">description string (required).</param>
 /// <param name="graphics">graphics array (required).</param>
 /// <param name="issuerId">issuer_id integer (required).</param>
 /// <param name="medalId">medal_id integer (required).</param>
 /// <param name="reason">reason string (required).</param>
 /// <param name="status">status string (required).</param>
 /// <param name="title">title string (required).</param>
 public GetCharactersCharacterIdMedals200Ok(int?corporationId = default(int?), DateTime?date = default(DateTime?), string description = default(string), List <GetCharactersCharacterIdMedalsGraphic> graphics = default(List <GetCharactersCharacterIdMedalsGraphic>), int?issuerId = default(int?), int?medalId = default(int?), string reason = default(string), StatusEnum status = default(StatusEnum), string title = default(string))
 {
     // to ensure "corporationId" is required (not null)
     if (corporationId == null)
     {
         throw new InvalidDataException("corporationId is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.CorporationId = corporationId;
     }
     // to ensure "date" is required (not null)
     if (date == null)
     {
         throw new InvalidDataException("date is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.Date = date;
     }
     // to ensure "description" is required (not null)
     if (description == null)
     {
         throw new InvalidDataException("description is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.Description = description;
     }
     // to ensure "graphics" is required (not null)
     if (graphics == null)
     {
         throw new InvalidDataException("graphics is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.Graphics = graphics;
     }
     // to ensure "issuerId" is required (not null)
     if (issuerId == null)
     {
         throw new InvalidDataException("issuerId is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.IssuerId = issuerId;
     }
     // to ensure "medalId" is required (not null)
     if (medalId == null)
     {
         throw new InvalidDataException("medalId is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.MedalId = medalId;
     }
     // to ensure "reason" is required (not null)
     if (reason == null)
     {
         throw new InvalidDataException("reason is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.Reason = reason;
     }
     // to ensure "status" is required (not null)
     if (status == null)
     {
         throw new InvalidDataException("status is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.Status = status;
     }
     // to ensure "title" is required (not null)
     if (title == null)
     {
         throw new InvalidDataException("title is a required property for GetCharactersCharacterIdMedals200Ok and cannot be null");
     }
     else
     {
         this.Title = title;
     }
 }
示例#47
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VCMonitorDatastore" /> class.
 /// </summary>
 /// <param name="capacityMb">The capacity of the datastore in megabytes. (required).</param>
 /// <param name="details">Details about the datastore. (required).</param>
 /// <param name="freeSpaceMb">The free space on the datastore in megabytes. (required).</param>
 /// <param name="status">Status of the datastore. * ACCESSIBLE: The datastore is accessible. * NOT_ACCESSIBLE: The datastore is not accessible. (required).</param>
 /// <param name="type">Type of the datastore. * VMFS: VMFS datastore. * VSAN: VSAN datastore. (required).</param>
 public VCMonitorDatastore(int?capacityMb = default(int?), VCMonitorDatastoreDetails details = default(VCMonitorDatastoreDetails), int?freeSpaceMb = default(int?), StatusEnum status = default(StatusEnum), TypeEnum type = default(TypeEnum))
 {
     // to ensure "capacityMb" is required (not null)
     if (capacityMb == null)
     {
         throw new InvalidDataException("capacityMb is a required property for VCMonitorDatastore and cannot be null");
     }
     else
     {
         this.CapacityMb = capacityMb;
     }
     // to ensure "details" is required (not null)
     if (details == null)
     {
         throw new InvalidDataException("details is a required property for VCMonitorDatastore and cannot be null");
     }
     else
     {
         this.Details = details;
     }
     // to ensure "freeSpaceMb" is required (not null)
     if (freeSpaceMb == null)
     {
         throw new InvalidDataException("freeSpaceMb is a required property for VCMonitorDatastore and cannot be null");
     }
     else
     {
         this.FreeSpaceMb = freeSpaceMb;
     }
     // to ensure "status" is required (not null)
     if (status == null)
     {
         throw new InvalidDataException("status is a required property for VCMonitorDatastore and cannot be null");
     }
     else
     {
         this.Status = status;
     }
     // to ensure "type" is required (not null)
     if (type == null)
     {
         throw new InvalidDataException("type is a required property for VCMonitorDatastore and cannot be null");
     }
     else
     {
         this.Type = type;
     }
 }
 public ExceptionResult(StatusEnum Code, string message)
 {
     StatusEnum = Code;
     Message    = message;
 }
示例#49
0
 public ResultModel Load(UserModel user, int stockLogId, StatusEnum status = StatusEnum.已生效)
 {
     string cmdText = string.Format("select * from dbo.Fun_CashInStcok_Ref where StockLogId ={0} and DetailStatus = {1}", stockLogId, (int)status);
     return Load<Model.CashInStcok>(user, CommandType.Text, cmdText);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetCharactersCharacterIdContracts200Ok" /> class.
 /// </summary>
 /// <param name="AcceptorId">Who will accept the contract (required).</param>
 /// <param name="AssigneeId">ID to whom the contract is assigned, can be corporation or character ID (required).</param>
 /// <param name="Availability">To whom the contract is available (required).</param>
 /// <param name="Buyout">Buyout price (for Auctions only).</param>
 /// <param name="Collateral">Collateral price (for Couriers only).</param>
 /// <param name="ContractId">contract_id integer (required).</param>
 /// <param name="DateAccepted">Date of confirmation of contract.</param>
 /// <param name="DateCompleted">Date of completed of contract.</param>
 /// <param name="DateExpired">Expiration date of the contract (required).</param>
 /// <param name="DateIssued">Сreation date of the contract (required).</param>
 /// <param name="DaysToComplete">Number of days to perform the contract.</param>
 /// <param name="EndLocationId">End location ID (for Couriers contract).</param>
 /// <param name="ForCorporation">true if the contract was issued on behalf of the issuer&#39;s corporation (required).</param>
 /// <param name="IssuerCorporationId">Character&#39;s corporation ID for the issuer (required).</param>
 /// <param name="IssuerId">Character ID for the issuer (required).</param>
 /// <param name="Price">Price of contract (for ItemsExchange and Auctions).</param>
 /// <param name="Reward">Remuneration for contract (for Couriers only).</param>
 /// <param name="StartLocationId">Start location ID (for Couriers contract).</param>
 /// <param name="Status">Status of the the contract (required).</param>
 /// <param name="Title">Title of the contract.</param>
 /// <param name="Type">Type of the contract (required).</param>
 /// <param name="Volume">Volume of items in the contract.</param>
 public GetCharactersCharacterIdContracts200Ok(int?AcceptorId = default(int?), int?AssigneeId = default(int?), AvailabilityEnum Availability = default(AvailabilityEnum), double?Buyout = default(double?), double?Collateral = default(double?), int?ContractId = default(int?), DateTime?DateAccepted = default(DateTime?), DateTime?DateCompleted = default(DateTime?), DateTime?DateExpired = default(DateTime?), DateTime?DateIssued = default(DateTime?), int?DaysToComplete = default(int?), long?EndLocationId = default(long?), bool?ForCorporation = default(bool?), int?IssuerCorporationId = default(int?), int?IssuerId = default(int?), double?Price = default(double?), double?Reward = default(double?), long?StartLocationId = default(long?), StatusEnum Status = default(StatusEnum), string Title = default(string), TypeEnum Type = default(TypeEnum), double?Volume = default(double?))
 {
     // to ensure "AcceptorId" is required (not null)
     if (AcceptorId == null)
     {
         throw new InvalidDataException("AcceptorId is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.AcceptorId = AcceptorId;
     }
     // to ensure "AssigneeId" is required (not null)
     if (AssigneeId == null)
     {
         throw new InvalidDataException("AssigneeId is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.AssigneeId = AssigneeId;
     }
     // to ensure "Availability" is required (not null)
     if (Availability == null)
     {
         throw new InvalidDataException("Availability is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.Availability = Availability;
     }
     // to ensure "ContractId" is required (not null)
     if (ContractId == null)
     {
         throw new InvalidDataException("ContractId is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.ContractId = ContractId;
     }
     // to ensure "DateExpired" is required (not null)
     if (DateExpired == null)
     {
         throw new InvalidDataException("DateExpired is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.DateExpired = DateExpired;
     }
     // to ensure "DateIssued" is required (not null)
     if (DateIssued == null)
     {
         throw new InvalidDataException("DateIssued is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.DateIssued = DateIssued;
     }
     // to ensure "ForCorporation" is required (not null)
     if (ForCorporation == null)
     {
         throw new InvalidDataException("ForCorporation is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.ForCorporation = ForCorporation;
     }
     // to ensure "IssuerCorporationId" is required (not null)
     if (IssuerCorporationId == null)
     {
         throw new InvalidDataException("IssuerCorporationId is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.IssuerCorporationId = IssuerCorporationId;
     }
     // to ensure "IssuerId" is required (not null)
     if (IssuerId == null)
     {
         throw new InvalidDataException("IssuerId is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.IssuerId = IssuerId;
     }
     // to ensure "Status" is required (not null)
     if (Status == null)
     {
         throw new InvalidDataException("Status is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.Status = Status;
     }
     // to ensure "Type" is required (not null)
     if (Type == null)
     {
         throw new InvalidDataException("Type is a required property for GetCharactersCharacterIdContracts200Ok and cannot be null");
     }
     else
     {
         this.Type = Type;
     }
     this.Buyout          = Buyout;
     this.Collateral      = Collateral;
     this.DateAccepted    = DateAccepted;
     this.DateCompleted   = DateCompleted;
     this.DaysToComplete  = DaysToComplete;
     this.EndLocationId   = EndLocationId;
     this.Price           = Price;
     this.Reward          = Reward;
     this.StartLocationId = StartLocationId;
     this.Title           = Title;
     this.Volume          = Volume;
 }
示例#51
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetCharactersCharacterIdIndustryJobs200Ok" /> class.
 /// </summary>
 /// <param name="jobId">Unique job ID (required).</param>
 /// <param name="installerId">ID of the character which installed this job (required).</param>
 /// <param name="facilityId">ID of the facility where this job is running (required).</param>
 /// <param name="stationId">ID of the station where industry facility is located (required).</param>
 /// <param name="activityId">Job activity ID (required).</param>
 /// <param name="blueprintId">blueprint_id integer (required).</param>
 /// <param name="blueprintTypeId">blueprint_type_id integer (required).</param>
 /// <param name="blueprintLocationId">Location ID of the location from which the blueprint was installed. Normally a station ID, but can also be an asset (e.g. container) or corporation facility (required).</param>
 /// <param name="outputLocationId">Location ID of the location to which the output of the job will be delivered. Normally a station ID, but can also be a corporation facility (required).</param>
 /// <param name="runs">Number of runs for a manufacturing job, or number of copies to make for a blueprint copy (required).</param>
 /// <param name="cost">The sume of job installation fee and industry facility tax.</param>
 /// <param name="licensedRuns">Number of runs blueprint is licensed for.</param>
 /// <param name="probability">Chance of success for invention.</param>
 /// <param name="productTypeId">Type ID of product (manufactured, copied or invented).</param>
 /// <param name="status">status string (required).</param>
 /// <param name="duration">Job duration in seconds (required).</param>
 /// <param name="startDate">Date and time when this job started (required).</param>
 /// <param name="endDate">Date and time when this job finished (required).</param>
 /// <param name="pauseDate">Date and time when this job was paused (i.e. time when the facility where this job was installed went offline).</param>
 /// <param name="completedDate">Date and time when this job was completed.</param>
 /// <param name="completedCharacterId">ID of the character which completed this job.</param>
 /// <param name="successfulRuns">Number of successful runs for this job. Equal to runs unless this is an invention job.</param>
 public GetCharactersCharacterIdIndustryJobs200Ok(int? jobId = default(int?), int? installerId = default(int?), long? facilityId = default(long?), long? stationId = default(long?), int? activityId = default(int?), long? blueprintId = default(long?), int? blueprintTypeId = default(int?), long? blueprintLocationId = default(long?), long? outputLocationId = default(long?), int? runs = default(int?), double? cost = default(double?), int? licensedRuns = default(int?), float? probability = default(float?), int? productTypeId = default(int?), StatusEnum status = default(StatusEnum), int? duration = default(int?), DateTime? startDate = default(DateTime?), DateTime? endDate = default(DateTime?), DateTime? pauseDate = default(DateTime?), DateTime? completedDate = default(DateTime?), int? completedCharacterId = default(int?), int? successfulRuns = default(int?))
 {
     // to ensure "jobId" is required (not null)
     if (jobId == null)
     {
         throw new InvalidDataException("jobId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.JobId = jobId;
     }
     // to ensure "installerId" is required (not null)
     if (installerId == null)
     {
         throw new InvalidDataException("installerId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.InstallerId = installerId;
     }
     // to ensure "facilityId" is required (not null)
     if (facilityId == null)
     {
         throw new InvalidDataException("facilityId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.FacilityId = facilityId;
     }
     // to ensure "stationId" is required (not null)
     if (stationId == null)
     {
         throw new InvalidDataException("stationId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.StationId = stationId;
     }
     // to ensure "activityId" is required (not null)
     if (activityId == null)
     {
         throw new InvalidDataException("activityId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.ActivityId = activityId;
     }
     // to ensure "blueprintId" is required (not null)
     if (blueprintId == null)
     {
         throw new InvalidDataException("blueprintId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.BlueprintId = blueprintId;
     }
     // to ensure "blueprintTypeId" is required (not null)
     if (blueprintTypeId == null)
     {
         throw new InvalidDataException("blueprintTypeId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.BlueprintTypeId = blueprintTypeId;
     }
     // to ensure "blueprintLocationId" is required (not null)
     if (blueprintLocationId == null)
     {
         throw new InvalidDataException("blueprintLocationId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.BlueprintLocationId = blueprintLocationId;
     }
     // to ensure "outputLocationId" is required (not null)
     if (outputLocationId == null)
     {
         throw new InvalidDataException("outputLocationId is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.OutputLocationId = outputLocationId;
     }
     // to ensure "runs" is required (not null)
     if (runs == null)
     {
         throw new InvalidDataException("runs is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.Runs = runs;
     }
     // to ensure "status" is required (not null)
     if (status == null)
     {
         throw new InvalidDataException("status is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.Status = status;
     }
     // to ensure "duration" is required (not null)
     if (duration == null)
     {
         throw new InvalidDataException("duration is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.Duration = duration;
     }
     // to ensure "startDate" is required (not null)
     if (startDate == null)
     {
         throw new InvalidDataException("startDate is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.StartDate = startDate;
     }
     // to ensure "endDate" is required (not null)
     if (endDate == null)
     {
         throw new InvalidDataException("endDate is a required property for GetCharactersCharacterIdIndustryJobs200Ok and cannot be null");
     }
     else
     {
         this.EndDate = endDate;
     }
     this.Cost = cost;
     this.LicensedRuns = licensedRuns;
     this.Probability = probability;
     this.ProductTypeId = productTypeId;
     this.PauseDate = pauseDate;
     this.CompletedDate = completedDate;
     this.CompletedCharacterId = completedCharacterId;
     this.SuccessfulRuns = successfulRuns;
 }
示例#52
0
 public StatusOfPeople(StatusEnum statusEnumValue)
 {
     this.StatusEnumValue = statusEnumValue;
 }
        public void ProcessTasks(DateTime? forcedStartTime)
        {
            try {
                // store the current time and grab info on the last time we processed our task list
                DateTime currentSyncTime;
                DateTime lastRetrived;
                if (!DateTime.TryParse(MovingPicturesCore.Settings.LastSynchTime, new CultureInfo("en-US"), System.Globalization.DateTimeStyles.None, out lastRetrived))
                    lastRetrived = DateTime.MinValue;

                // if we have been passed a hard coded start time, use that instead
                if (forcedStartTime != null) lastRetrived = (DateTime)forcedStartTime;

                logger.Debug("Synchronizing with follw.it (last synced {0})...", lastRetrived);

                List<TaskListItem> taskList = FollwitApi.GetUserTaskList(lastRetrived, out currentSyncTime);
                logger.Debug("{0} follw.it synchronization tasks require attention.", taskList.Count);
                if (taskList.Count == 0) return;

                // first process all id changes
                foreach (TaskListItem currTask in taskList)
                    if (currTask.Task == TaskItemType.UpdatedMovieId)
                        UpdateLocalMovieId(currTask);

                // then process everything else
                foreach (TaskListItem currTask in taskList)
                    switch (currTask.Task) {
                        case TaskItemType.CoverRequest:
                            SubmitCover(currTask.MovieId);
                            break;
                        case TaskItemType.NewRating:
                            UpdateLocalRating(currTask);
                            break;
                        case TaskItemType.NewWatchedStatus:
                            UpdateLocalWatchedStatus(currTask);
                            break;
                        case TaskItemType.UpdatedMovieId:
                            // handled above
                            break;
                    }

                // set the time only at the end in case an error occured
                MovingPicturesCore.Settings.LastSynchTime = currentSyncTime.ToString(new CultureInfo("en-US"));
                logger.Info("follw.it synchronization complete...");
            }
            catch (WebException ex) {
                logger.Error("There was a problem connecting to the follw.it Server! " + ex.Message);
                Status = FollwitConnector.StatusEnum.CONNECTION_ERROR;
            }
            catch (Exception ex) {
                logger.ErrorException("Unexpected error connecting to follw.it.\n", ex);
                Status = FollwitConnector.StatusEnum.INTERNAL_ERROR;
            }
        }
示例#54
0
        public void DoWork()
        {
            List <Character> monsters = new List <Character>();
            List <Character> fate     = new List <Character>();
            List <Character> players  = new List <Character>();
            Character        user     = null;
            int craftAmount           = 0;

            _status = StatusEnum.Initializing;

            MemoryFunctions.GetCharacters(monsters, fate, players, ref user);

            while (craftAmount < MaxCrafts)
            {
                user.Refresh();
                Debug.Print(user.Status.ToString() + "  -  " + user.Status.ToString("X"));

                if (Paused)
                {
                    continue;
                }

                if ((user.Status == CharacterStatus.Idle || user.Status == CharacterStatus.Crafting_Idle || user.Status == CharacterStatus.Crafting_Idle2) && user.IsCrafting == false)
                {
                    CraftWindow craftwindow = new CraftWindow();

                    while (craftwindow.RefreshPointers() == false)
                    {
                        Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.NumPad0);
                        Thread.Sleep(350);
                    }

                    Thread.Sleep(200);

                    if (ScriptMode)
                    {
                        CraftAi.Craftwindow = craftwindow;
                        CraftAi.Synth();
                    }
                    else
                    {
                        foreach (CraftingKey keyCondition in _keyConditions)
                        {
                            while (Paused)
                            {
                                Thread.Sleep(250);
                            }

                            if (craftwindow.RefreshPointers() == false)
                            {
                                break;
                            }

                            user.Refresh();
                            craftwindow.Refresh();

                            if (craftwindow.CurrProgress == craftwindow.MaxProgress)
                            {
                                break;
                            }

                            if (keyCondition.CPCondition)
                            {
                                if (user.CurrentCP < keyCondition.CP)
                                {
                                    continue;
                                }
                            }

                            if (keyCondition.DurabilityCondition)
                            {
                                if (craftwindow.CurrDurability <= keyCondition.Durability)
                                {
                                    continue;
                                }
                            }

                            if (keyCondition.ProgressCondition)
                            {
                                if (craftwindow.CurrProgress > keyCondition.Progress)
                                {
                                    continue;
                                }
                            }

                            if (keyCondition.ConditionCondition)
                            {
                                if (craftwindow.Condition.Trim().ToLower() == keyCondition.Condition.Trim().ToLower())
                                {
                                    continue;
                                }
                            }

                            // Utilities.Keyboard.KeyBoardHelper.KeyPress(keyCondition.Key);
                            WaitForAbility(user, keyCondition.Key, keyCondition.ControlKey);
                        }
                    }

                    while (craftwindow.RefreshPointers())
                    {
                        Thread.Sleep(250);
                    }

                    craftAmount++;
                }

                Thread.Sleep(500);
            }
        }
 /// <summary>
 /// Turns on device
 /// </summary>
 /// <returns>Returns the status of device after operation</returns>
 public async Task<StatusEnum> TurnOn()
 {
     var Response = await Communication.I2C_Helper.WriteRead(I2C_Slave_Address, Communication.I2C_Helper.Mode.Mode2, (byte)Pin, 1);
     Status = StatusEnum.On;
     return Status;
 }
示例#56
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetEmailCampaign" /> class.
 /// </summary>
 /// <param name="id">ID of the campaign (required).</param>
 /// <param name="name">Name of the campaign (required).</param>
 /// <param name="subject">Subject of the campaign. Only available if &#x60;abTesting&#x60; flag of the campaign is &#x60;false&#x60;.</param>
 /// <param name="type">Type of campaign (required).</param>
 /// <param name="status">Status of the campaign (required).</param>
 /// <param name="scheduledAt">UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ).</param>
 /// <param name="abTesting">Status of A/B Test for the campaign. abTesting &#x3D; false means it is disabled, &amp; abTesting &#x3D; true means it is enabled..</param>
 /// <param name="subjectA">Subject A of the ab-test campaign. Only available if &#x60;abTesting&#x60; flag of the campaign is &#x60;true&#x60;.</param>
 /// <param name="subjectB">Subject B of the ab-test campaign. Only available if &#x60;abTesting&#x60; flag of the campaign is &#x60;true&#x60;.</param>
 /// <param name="splitRule">The size of your ab-test groups. Only available if &#x60;abTesting&#x60; flag of the campaign is &#x60;true&#x60;.</param>
 /// <param name="winnerCriteria">Criteria for the winning version. Only available if &#x60;abTesting&#x60; flag of the campaign is &#x60;true&#x60;.</param>
 /// <param name="winnerDelay">The duration of the test in hours at the end of which the winning version will be sent. Only available if &#x60;abTesting&#x60; flag of the campaign is &#x60;true&#x60;.</param>
 /// <param name="sendAtBestTime">It is true if you have chosen to send your campaign at best time, otherwise it is false.</param>
 /// <param name="testSent">Retrieved the status of test email sending. (true&#x3D;Test email has been sent  false&#x3D;Test email has not been sent) (required).</param>
 /// <param name="header">Header of the campaign (required).</param>
 /// <param name="footer">Footer of the campaign (required).</param>
 /// <param name="sender">sender (required).</param>
 /// <param name="replyTo">Email defined as the &quot;Reply to&quot; of the campaign (required).</param>
 /// <param name="toField">Customisation of the &quot;to&quot; field of the campaign (required).</param>
 /// <param name="htmlContent">HTML content of the campaign (required).</param>
 /// <param name="shareLink">Link to share the campaign on social medias.</param>
 /// <param name="tag">Tag of the campaign (required).</param>
 /// <param name="createdAt">Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) (required).</param>
 /// <param name="modifiedAt">UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) (required).</param>
 /// <param name="inlineImageActivation">Status of inline image. inlineImageActivation &#x3D; false means image can’t be embedded, &amp; inlineImageActivation &#x3D; true means image can be embedded, in the email..</param>
 /// <param name="mirrorActive">Status of mirror links in campaign. mirrorActive &#x3D; false means mirror links are deactivated, &amp; mirrorActive &#x3D; true means mirror links are activated, in the campaign.</param>
 /// <param name="recurring">FOR TRIGGER ONLY ! Type of trigger campaign.recurring &#x3D; false means contact can receive the same Trigger campaign only once, &amp; recurring &#x3D; true means contact can receive the same Trigger campaign several times.</param>
 /// <param name="sentDate">Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if &#39;status&#39; of the campaign is &#39;sent&#39;.</param>
 /// <param name="recipients">recipients (required).</param>
 /// <param name="statistics">statistics (required).</param>
 public GetEmailCampaign(long?id = default(long?), string name = default(string), string subject = default(string), TypeEnum type = default(TypeEnum), StatusEnum status = default(StatusEnum), DateTime?scheduledAt = default(DateTime?), bool?abTesting = default(bool?), string subjectA = default(string), string subjectB = default(string), int?splitRule = default(int?), string winnerCriteria = default(string), int?winnerDelay = default(int?), bool?sendAtBestTime = default(bool?), bool?testSent = default(bool?), string header = default(string), string footer = default(string), GetExtendedCampaignOverviewSender sender = default(GetExtendedCampaignOverviewSender), string replyTo = default(string), string toField = default(string), string htmlContent = default(string), string shareLink = default(string), string tag = default(string), DateTime?createdAt = default(DateTime?), DateTime?modifiedAt = default(DateTime?), bool?inlineImageActivation = default(bool?), bool?mirrorActive = default(bool?), bool?recurring = default(bool?), DateTime?sentDate = default(DateTime?), Object recipients = default(Object), Object statistics = default(Object))
 {
     // to ensure "id" is required (not null)
     if (id == null)
     {
         throw new InvalidDataException("id is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Id = id;
     }
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     // to ensure "type" is required (not null)
     if (type == null)
     {
         throw new InvalidDataException("type is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Type = type;
     }
     // to ensure "status" is required (not null)
     if (status == null)
     {
         throw new InvalidDataException("status is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Status = status;
     }
     // to ensure "testSent" is required (not null)
     if (testSent == null)
     {
         throw new InvalidDataException("testSent is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.TestSent = testSent;
     }
     // to ensure "header" is required (not null)
     if (header == null)
     {
         throw new InvalidDataException("header is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Header = header;
     }
     // to ensure "footer" is required (not null)
     if (footer == null)
     {
         throw new InvalidDataException("footer is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Footer = footer;
     }
     // to ensure "sender" is required (not null)
     if (sender == null)
     {
         throw new InvalidDataException("sender is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Sender = sender;
     }
     // to ensure "replyTo" is required (not null)
     if (replyTo == null)
     {
         throw new InvalidDataException("replyTo is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.ReplyTo = replyTo;
     }
     // to ensure "toField" is required (not null)
     if (toField == null)
     {
         throw new InvalidDataException("toField is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.ToField = toField;
     }
     // to ensure "htmlContent" is required (not null)
     if (htmlContent == null)
     {
         throw new InvalidDataException("htmlContent is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.HtmlContent = htmlContent;
     }
     // to ensure "tag" is required (not null)
     if (tag == null)
     {
         throw new InvalidDataException("tag is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Tag = tag;
     }
     // to ensure "createdAt" is required (not null)
     if (createdAt == null)
     {
         throw new InvalidDataException("createdAt is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.CreatedAt = createdAt;
     }
     // to ensure "modifiedAt" is required (not null)
     if (modifiedAt == null)
     {
         throw new InvalidDataException("modifiedAt is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.ModifiedAt = modifiedAt;
     }
     // to ensure "recipients" is required (not null)
     if (recipients == null)
     {
         throw new InvalidDataException("recipients is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Recipients = recipients;
     }
     // to ensure "statistics" is required (not null)
     if (statistics == null)
     {
         throw new InvalidDataException("statistics is a required property for GetEmailCampaign and cannot be null");
     }
     else
     {
         this.Statistics = statistics;
     }
     this.Subject               = subject;
     this.ScheduledAt           = scheduledAt;
     this.AbTesting             = abTesting;
     this.SubjectA              = subjectA;
     this.SubjectB              = subjectB;
     this.SplitRule             = splitRule;
     this.WinnerCriteria        = winnerCriteria;
     this.WinnerDelay           = winnerDelay;
     this.SendAtBestTime        = sendAtBestTime;
     this.ShareLink             = shareLink;
     this.InlineImageActivation = inlineImageActivation;
     this.MirrorActive          = mirrorActive;
     this.Recurring             = recurring;
     this.SentDate              = sentDate;
 }
示例#57
0
 public ResultModel Load(UserModel user, int subId, StatusEnum status = StatusEnum.已生效)
 {
     return stockinDAL.Load(user, subId, status);
 }
示例#58
0
 public float GetStat(StatusEnum stat)
 {
     return(status.stats[(int)stat].value);
 }
示例#59
0
        private void UpdateStatistics(StatusEnum newStatus)
        {
            Statistics.Execution thisExecution;

            if (newStatus == Job.StatusEnum.Ready)
            {
                thisExecution = new Statistics.Execution();
                this.Stat.Executions.Add(thisExecution);
                thisExecution.StartTime = DateTime.Now.ToString("u");
            }
            else
            {
                thisExecution = this.Stat.Executions.LastOrDefault();
                if (thisExecution == null)
                {
                    return;
                }
            }

            if (newStatus == StatusEnum.RunningLocal ||
                newStatus == StatusEnum.RunningOnServer)
            {
                TimeStart = DateTime.Now;
                TimeInQueue = TimeStart - TimePosted;
                thisExecution.StartTime = DateTime.Now.ToString("u");
            }
            else if (newStatus == StatusEnum.Succeeded || this.IsFailed())
            {
                TimeDone = DateTime.Now;
                if (TimeDone > TimeStart)
                    TimeTotal = TimeDone - TimeStart;
            }

            // update the execution statistics (queued -> new execution)

            if (thisExecution != null)
            {
                thisExecution.StatusTraces.Add(new Statistics.Execution.StatusTrace()
                {
                    Status = newStatus.ToString(),
                    TimeStamp = DateTime.Now.ToString("u")
                });
            }

        }
示例#60
0
 float ClampStat(StatusEnum type, float value)
 {
     return(Mathf.Clamp(value, 0, status[type].baseValue));
 }