Esempio n. 1
0
    public Notif GetNotif()
    {
        Notif         notif = new Notif();
        SqlConnection conn  = Common.getConnection();
        string        query = "";
        SqlCommand    cmd   = new SqlCommand();

        cmd.Connection  = conn;
        cmd.CommandType = System.Data.CommandType.Text;

        query           = "SELECT count(*) as notif_pimpinan FROM v_notif_pimpinan";
        cmd.CommandText = query;

        conn.Open();
        SqlDataReader reader = cmd.ExecuteReader();

        while (reader.Read())
        {
            notif.Pimpinan = reader["notif_pimpinan"].ToString();
        }
        conn.Close();

        query           = "SELECT count(*) as notif_teknisi FROM t_penugasan_inventaris where status=0 ";
        cmd.CommandText = query;

        conn.Open();
        reader = cmd.ExecuteReader();
        while (reader.Read())
        {
            notif.Teknisi = reader["notif_teknisi"].ToString();
        }
        conn.Close();

        return(notif);
    }
Esempio n. 2
0
    public IEnumerator addNotif(Sprite icon, string text)
    {
        while (remove || adding)
        {
        }
        adding = true;
        int     count  = transform.childCount;
        Vector3 posAdd = prefabPos;

        if (count > 0)
        {
            posAdd    = transform.GetChild(0).localPosition;
            posAdd.y -= (count * notifYSize);
            posAdd.x -= 100f;
        }
        GameObject obj = Instantiate(notifPrefab, posAdd, Quaternion.identity, transform);

        obj.transform.localPosition = posAdd;
        obj.transform.localRotation = Quaternion.identity;
        Notif notif = obj.GetComponent <Notif> ();

        notif.icon = icon;
        notif.text = text;
        adding     = false;
        yield return(null);
    }
        private void RefreshContent(Notif obj)
        {
            SelectedCompanyId    = obj.Comp.IdCompany;
            KeyRatioLabel        = "Key Ratio of " + obj.Comp.Name;
            BalanceSheetLabel    = "Balance Sheet of " + obj.Comp.Name;
            CashFlowLabel        = "Cash Flow of " + obj.Comp.Name;
            IncomeStatementLabel = "Income Statement of " + obj.Comp.Name;

            switch (obj.Box)
            {
            case "KRComboBox":
                DisplayKeyRatios(obj.Comp.IdCompany, obj.Year);
                break;

            case "CFComboBox":
                DisplayCashFlows(obj.Comp.IdCompany, obj.Year);
                break;

            case "ISComboBox":
                DisplayIncomeStatements(obj.Comp.IdCompany, obj.Year);
                break;

            case "BSComboBox":
                DisplayBalanceSheets(obj.Comp.IdCompany, obj.Year);
                break;

            default:
                DisplayKeyRatios(obj.Comp.IdCompany, obj.Year);
                DisplayCashFlows(obj.Comp.IdCompany, obj.Year);
                DisplayIncomeStatements(obj.Comp.IdCompany, obj.Year);
                DisplayBalanceSheets(obj.Comp.IdCompany, obj.Year);
                break;
            }
        }
Esempio n. 4
0
    private IEnumerator update()
    {
        if (transform.childCount > 0)
        {
            if (transform.childCount > 1)
            {
                Vector3 posAdd = transform.GetChild(0).localPosition;
                for (int i = 1; i < transform.childCount; i++)
                {
                    Vector3 pos = transform.GetChild(i).localPosition;

                    float lerpTo = (posAdd.y - (i * notifYSize));
                    pos.y = Mathf.Lerp(pos.y, lerpTo, .25f);
                    pos.x = Mathf.Lerp(pos.x, 10f, 0.25f);
                    transform.GetChild(i).localPosition = pos;
                }
            }
            Notif   not    = transform.GetChild(0).GetComponent <Notif>();
            Vector3 lerper = not.transform.localPosition;
            lerper.y = Mathf.Lerp(lerper.y, (not.move)?280f:-70f, .1f);
            lerper.x = Mathf.Lerp(lerper.x, 10f, .25f);
            not.transform.localPosition = lerper;
            if (lerper.y >= 65f)
            {
                Destroy(not.gameObject);
            }
        }
        yield return(null);

        StartCoroutine(update());
    }
Esempio n. 5
0
 public void Pause()
 {
     Notif.SetActive(false);
     PauseMenuUI.SetActive(true);
     Time.timeScale = 0f;
     GameIsPaused   = true;
 }
Esempio n. 6
0
 public void Resume()
 {
     Notif.SetActive(true);
     PauseMenuUI.SetActive(false);
     Time.timeScale = 1f;
     GameIsPaused   = false;
 }
Esempio n. 7
0
 private void Tmr_Tick(object sender, EventArgs e)
 {
     c++;
     if (c == 10)
     {
         Tmr.Stop();
         Notif.ShowBalloonTip(1200);
     }
 }
Esempio n. 8
0
 void Awake()
 {
     vCam = GameObject.FindWithTag("MainCamera");
     vT   = gameObject.GetComponent <Turret>();
     vU   = vCam.GetComponent <Ui>();
     vN   = vCam.GetComponent <Notif>();
     vM   = gameObject.GetComponent <Meshes>();
     vS   = vCam.GetComponent <S>();
     PopulateUpgrades();
     PopulateTech();
 }
Esempio n. 9
0
    void Awake()
    {
        cheatCode = new string[] { "b", "o", "o", "p" };
        index     = 0;

        cheatCode2 = new string[] { "w", "o", "o", "p" };
        index2     = 0;

        vT   = gameObject.GetComponent <Turret>();
        vCam = GameObject.FindWithTag("MainCamera");
        vN   = vCam.GetComponent <Notif>();
    }
Esempio n. 10
0
        private async Task <HttpResponseMessage> SendNotificationToServer(Notif notif, string content)
        {
            HttpClient         client  = new HttpClient();
            HttpRequestMessage message = new HttpRequestMessage
            {
                Method     = new HttpMethod("POST"),
                Content    = new StringContent(content),
                RequestUri = new Uri(LocalIP + (int)notif)
            };
            var result = await client.SendAsync(message);

            return(result);
        }
Esempio n. 11
0
    void Awake()
    {
        fwd            = vGun.transform.rotation;
        lft            = vScPos1.transform.rotation;
        rght           = vScPos2.transform.rotation;
        targetPosition = vGunC.transform.localPosition;
        FindNearest();
        vExpLeft = vExpBase;

        vCam = GameObject.FindWithTag("MainCamera");
        vN   = vCam.GetComponent <Notif>();
        vS   = vCam.GetComponent <Sound>();
        vM   = gameObject.GetComponent <Meshes>();
    }
Esempio n. 12
0
    void Awake()
    {
        WindowUpgrades = new Rect(70, 60, 600, 400);
        WindowResearch = new Rect(70, 60, 600, 400);
        WindowStatus   = new Rect(70, 60, 200, 360);
        WindowOptions  = new Rect(70, 60, 300, 220);

        vT    = vTurret.GetComponent <Turret>();
        vW    = vTurret.GetComponent <Waves>();
        vU    = vTurret.GetComponent <Upgrades>();
        vS    = gameObject.GetComponent <Sound>();
        vN    = gameObject.GetComponent <Notif>();
        vC    = gameObject.GetComponent <CameraToggler>();
        vSave = gameObject.GetComponent <S>();
    }
Esempio n. 13
0
        public void ClearAllSession()
        {
            Session.Clear();
            string JSONString = string.Empty;

            Notif d = new Notif();

            d.type  = "success";
            d.notes = "Semua session telah dihapus";
            d.head  = "Success!";

            JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write("{\"data\": " + JSONString + "}");
        }
Esempio n. 14
0
        public List <Notif> notificationlist()
        {
            var          l  = db.notifications.ToList();
            List <Notif> nl = new List <Notif>();

            foreach (var x in l)
            {
                Notif n = new Notif();
                n.id          = x.Id;
                n.author      = x.teacher.name;
                n.title       = x.title;
                n.description = x.description;
                n.authorid    = x.author;
                nl.Add(n);
            }
            return(nl);
        }
Esempio n. 15
0
        public void ClearSessionInfo()
        {
            if (!string.IsNullOrEmpty(Session["INFO"] as string))
            {
                Session["INFO"] = string.Empty;
            }
            string JSONString = string.Empty;

            Notif d = new Notif();

            d.type  = "success";
            d.notes = "Session telah dihapus";
            d.head  = "Success!";

            JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write("{\"data\": " + JSONString + "}");
        }
Esempio n. 16
0
 private void Form1_Load(object sender, EventArgs e)
 {
     ChatData.ColumnCount = 2;
     PokemonLuchando1     = EquipoJugador1.GetPokemon(0);
     PokemonLuchando2     = EquipoJugador2.GetPokemon(0);
     timer.Interval       = (2000);
     timer.Tick          += new EventHandler(timer_Tick);
     timer1.Interval      = (3000);
     timer1.Tick         += new EventHandler(timer1_Tick);
     pokeball1.Image      = (Image)pokeball;
     pokeball2.Image      = (Image)pokeball;
     pokeball3.Image      = (Image)pokeball; //Pokeballs que aparecen en la barra de abajo
     pokeball4.Image      = (Image)pokeball;
     pokeball5.Image      = (Image)pokeball;
     pokeball6.Image      = (Image)pokeball;
     Notif.Parent         = Fondo;
     Notif.Font           = new Font(pfc.Families[0], 10, FontStyle.Regular);
     Notif.Location       = new Point(15, 5);
     Notif.BringToFront();
     timer.Start();
     Jug1.Text = Jugador1;
     Jug2.Text = Jugador2;
 }
Esempio n. 17
0
        public void InputProsesFromCalendar(List <CalendarEventObj> listObj)
        {
            string JSONString = string.Empty;
            string modifier   = Session["NIK"].ToString();
            string nik        = modifier;
            string nama       = Session["NAMA"].ToString();

            List <string>   line    = new List <string>();
            List <string[]> lineObj = new List <string[]>();

            for (int i = 0; i < listObj.Count; i++)
            {
                line.Clear();
                line.Add(listObj[i].id.Replace('-', '/'));
                line.Add(string.Empty);
                line.Add(listObj[i].menu);
                line.Add(listObj[i].startHour);
                line.Add(listObj[i].endHour);

                lineObj.Add(line.ToArray());
            }

            string[][] lineObjArray = lineObj.ToArray();
            DataLogic.inserttoDB(nik, nama, lineObjArray, modifier);

            Notif d = new Notif();

            d.type  = "success";
            d.notes = "Berhasil update booking makan";
            d.head  = "Success!";

            JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write("{\"data\": " + JSONString + "}");
        }
Esempio n. 18
0
        public async Task <HttpResponseMessage> Get()
        {
            LogWriter._noti(TAG, string.Format(@"[>>] Request: [****]"));
            HttpResponseMessage  message  = new HttpResponseMessage();
            NotificationResponse response = new NotificationResponse();
            string ip       = httpUtil.GetClientIPAddress(HttpContext.Current.Request);
            string secToken = string.Empty;

            try
            {
                secToken = HttpContext.Current.Request.Headers["Authorization"].Replace("Basic ", "").Trim();
                if (dbconn.idbStatOK())
                {
                    string insId    = string.Empty;
                    string insPhone = string.Empty;
                    if (dbconn.tabletCheckToken(secToken, out insId, out insPhone))
                    {
                        LogWriter._noti(TAG, string.Format(@"Request Token: [{0}], InstallerId: [{1}]", secToken, insId));
                        DataTable       dt       = dbconn.getTable(tabletQuery.getNoifList(insId));
                        List <ReadStat> readList = dbconn.getTable(tabletQuery.getReadList(insId)).AsEnumerable().Select(s => new ReadStat
                        {
                            notifId = s["NOTIF_ID"].ToString(),
                            userId  = s["READ_USER"].ToString()
                        }).ToList();
                        List <Notif> notiList = new List <Notif>();
                        foreach (DataRow item in dt.Rows)
                        {
                            Notif  noti   = new Notif();
                            string notiId = item["NOTIF_ID"].ToString();
                            noti.notificationId   = int.Parse(notiId);
                            noti.notificationName = item["NOTIF_NAME"].ToString();
                            noti.notificationText = item["NOTIF_TXT"].ToString();
                            noti.cDate            = item["CDATE"].ToString();
                            noti.readStatus       = isRead(readList, notiId);
                            notiList.Add(noti);
                        }
                        response.isSuccess     = true;
                        response.errorCode     = Convert.ToString((int)HttpStatusCode.OK);
                        response.resultMessage = "success";
                        response.notifications = notiList;
                    }
                    else
                    {
                        response.isSuccess     = false;
                        response.errorCode     = Convert.ToString((int)HttpStatusCode.Unauthorized);
                        response.resultMessage = "Session has expired";
                    }
                }
                else
                {
                    response.isSuccess     = false;
                    response.errorCode     = Convert.ToString((int)HttpStatusCode.InternalServerError);
                    response.resultMessage = "Internal Error";
                }
            }
            catch (Exception ex)
            {
                LogWriter._error(TAG, string.Format(@"Token: [{0}], Exception: [{1}]", secToken, ex.ToString()));
                response.isSuccess     = false;
                response.errorCode     = Convert.ToString((int)HttpStatusCode.InternalServerError);
                response.resultMessage = ex.Message;
            }
            LogWriter._noti(TAG, string.Format(@"[<<] ClientIp: [{0}], Response: [{1}]", ip, serializer.Serialize(response)));
            message = Request.CreateResponse(HttpStatusCode.OK, response);
            return(message);
        }
Esempio n. 19
0
        public void PressedOk()
        {
            //todo if didnt enter name - handle

            Notif?.Invoke();
        }
Esempio n. 20
0
        public static QAResponse <ICollection <Notif> > GetNotificationsPage(long UID, NotificationType type, int tzOffset, DateTime?from = null, DateTime?to = null, int lang = 1, int pageNumber = 1, int pageSize = 1, string conStr = "", bool content = true)
        {
            QAResponse <ICollection <Notif> > response = new QAResponse <ICollection <Notif> >();
            IDictionary <string, Notif>       notifs   = new Dictionary <string, Notif>();
            int outp = 0;

            using (SqlConnection connection = new SqlConnection(conStr))
            {
                SqlCommand cmd = new SqlCommand("sp_ManageNotification", connection);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@Mode", Value = "readyToSendPagination"
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@Type", Value = (byte)type
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@TimeZoneOffset", Value = tzOffset
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@UserId", Value = UID
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@FromDate", Value = from
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@ToDate", Value = to
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@LanguageId", Value = lang
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@PageSize", Value = pageSize
                });
                cmd.Parameters.Add(new SqlParameter()
                {
                    ParameterName = "@PageNumber", Value = pageNumber
                });
                SqlParameter outPara = new SqlParameter();
                outPara.ParameterName = "@RemainingPages";
                outPara.DbType        = DbType.Int32;
                outPara.SqlDbType     = SqlDbType.Int;
                outPara.Direction     = ParameterDirection.Output;
                cmd.Parameters.Add(outPara);
                connection.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        long   id       = Convert.ToInt64(reader["Id"]);
                        int    userLang = Convert.ToInt32(reader["LanguageId"]);
                        string key      = string.Concat(id, '_', userLang);

                        Notif notif = new Notif
                        {
                            Id      = id,
                            Title   = reader["Title"].ToString(),
                            Content = content ? reader["Content"].ToString() : "",
                            Date    = reader["StartDate"] != DBNull.Value ? Convert.ToDateTime(reader["StartDate"]) : default(DateTime?)
                        };
                        if (!notifs.Keys.Contains(key))
                        {
                            notifs.Add(key, notif);
                        }
                        else
                        {
                            notif = notifs[key];
                        }
                    }
                    reader.NextResult();
                }
                outp = Convert.ToInt32(cmd.Parameters["@RemainingPages"].Value);
                connection.Close();
            }
            response.Content = notifs.Values;
            response.Extras.Add("RemainingPages", outp.ToString());
            return(response);
        }
Esempio n. 21
0
 private void ViewModel_NotificationHandler(string message)
 {
     Notif.Show(message, 2000);
 }