Esempio n. 1
0
        public static void DeleteLocation(Int32 serverKey)
        {
            if (!Login.OnLineMode)
            {
                using (CEConn localDB = new CEConn())
                {
                    string strSql;
                    strSql  = "Delete from Locations ";
                    strSql += " Where ServerKey = " + serverKey;

                    localDB.runQuery(strSql);
                }
            }
            else
            {
                string strSql;

                strSql  = "Delete from Locations ";
                strSql += " Where ID_Location = " + serverKey;

                RConnection.RConnection OnConn = new RConnection.RConnection();
                OnConn.Url = Login.webConURL;
                OnConn.runQuery(strSql);
            }
        }
Esempio n. 2
0
        public static void EditLocation(String TagID, String LocationNo, String LocationName, Int32 ServerKey, int usageCount)
        {
            if (!Login.OnLineMode)
            {
                using (CEConn localDB = new CEConn())
                {
                    string strSql;
                    strSql  = "Update Locations Set Name = '" + LocationName.Replace("'", "''") + "'" + ",LocationNo = '" + LocationNo.Replace("'", "''") + "',Date_Modified = getDate(),";
                    strSql += "ModifiedBy = " + Login.ID + ",RowStatus = " + Convert.ToInt32(RowStatus.Modify);
                    strSql += " Where ServerKey = " + ServerKey;

                    //strSql = " insert into Locations(TagID,Name,LocationNo,Date_Modified,ModifiedBy,RowStatus,serverKey)";
                    //strSql += " values('" + TagID + "','" + LocationName.Replace("'", "''") + "','" + LocationNo.Replace("'", "''") + "',getDate()," + Login.ID + "," + Convert.ToInt32(RowStatus.New) + "," + Skey + ")";
                    localDB.runQuery(strSql);
                }
            }
            else
            {
                string strSql;

                strSql  = "Update Locations Set Name = '" + LocationName.Replace("'", "''") + "'" + ",LocationNo = '" + LocationNo.Replace("'", "''") + "',Date_Modified = getDate(),";
                strSql += "Last_Modified_By = " + Login.ID + ",UsageCount = UsageCount + " + usageCount;
                strSql += " Where ID_Location = " + ServerKey;

                RConnection.RConnection OnConn = new RConnection.RConnection();
                OnConn.Url = Login.webConURL;
                OnConn.runQuery(strSql);
            }
        }
Esempio n. 3
0
        public void AssignNewTag(String TagNo)
        {
            Int32 p;

            if (_RowStatus != Convert.ToInt32(RowStatus.New))
            {
                p = Convert.ToInt32(RowStatus.TagWrite);
            }
            else
            {
                p = _RowStatus;
            }

            if (!Login.OnLineMode)
            {
                using (CEConn localDB = new CEConn())
                {
                    string strSql;
                    strSql = " update Employees set TagID='" + TagNo + "' , Date_MOdified=getDate(), ModifiedBy=" + Login.ID + ", RowStatus=" + p + " where ServerKey=" + _ServerKey;
                    localDB.runQuery(strSql);
                    _TagID     = TagNo;
                    _RowStatus = p;
                }
            }
            else
            {
                RConnection.RConnection OnConn = new RConnection.RConnection();
                OnConn.Url = Login.webConURL;
                string strSql;
                strSql = " update Employees set TagID='" + TagNo + "' , Date_MOdified=getDate(), Last_Modified_By=" + Login.ID + " where ID_Employee=" + _ServerKey;
                OnConn.runQuery(strSql);
                _TagID     = TagNo;
                _RowStatus = p;
                //throw new ApplicationException("Online Employee functionality not implemented yet.");
            }
        }