Ejemplo n.º 1
0
        /// <summary>
        /// 写入场馆信息
        /// </summary>
        /// <param name="sysvenue">场馆实体</param>
        /// <param name="cmd">语句</param>
        /// <returns>成功true 失败false</returns>
        public bool Inert_SYS_Venue(SYS_VENUE sysvenue, SQLiteCommand cmd)
        {
            StringBuilder strbulid = new StringBuilder();

            strbulid.Append("Insert into sys_venue(VENUE_ID,VENUE_NAME,STAT,OPE_USER_ID,OPE_TIME)");
            strbulid.Append(" values(@VENUE_ID,@VENUE_NAME,@STAT,@OPE_USER_ID,@OPE_TIME) ");
            cmd.CommandText = strbulid.ToString();
            cmd.Parameters.Add("VENUE_ID", DbType.Int64);
            cmd.Parameters.Add("VENUE_NAME", DbType.String, 100);
            cmd.Parameters.Add("STAT", DbType.String, 1);
            cmd.Parameters.Add("OPE_USER_ID", DbType.String, 50);
            cmd.Parameters.Add("OPE_TIME", DbType.DateTime);
            cmd.Parameters["VENUE_ID"].Value    = sysvenue.VenueId;
            cmd.Parameters["VENUE_NAME"].Value  = sysvenue.VenueName;
            cmd.Parameters["STAT"].Value        = sysvenue.Stat;
            cmd.Parameters["OPE_USER_ID"].Value = sysvenue.OpeUserId;
            cmd.Parameters["OPE_TIME"].Value    = T_Date.ConvertLongToDateTime(sysvenue.OpeTime);

            int tmpRows = 0;

            try
            {
                tmpRows = cmd.ExecuteNonQuery();
                return(true);
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_Venue), ex);
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 新增黑名单信息
        /// </summary>
        /// <param name="varEmpRegisterModel">黑名单信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/22</ Remark >
        public bool InsertBlackList(SYS_BLACK_LIST varEmpRegisterModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SYS_BLACK_LIST(");
            tmpStrSql.Append("BLACK_LIST_ID,CARD_TYPE,LOSS_DT,TICKET_ID,STAT,CHIP_ID,LOSS_REASON,OPE_USER_ID,OPE_TIME,VERSION_NO)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@BLACK_LIST_ID,@CARD_TYPE,@LOSS_DT,@TICKET_ID,@STAT,@CHIP_ID,@LOSS_REASON,@OPE_USER_ID,@OPE_TIME,@VERSION_NO)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@BLACK_LIST_ID", DbType.String,     50),
                new SQLiteParameter("@CARD_TYPE",     DbType.String,      1),
                new SQLiteParameter("@LOSS_DT",       DbType.DateTime),
                new SQLiteParameter("@TICKET_ID",     DbType.String,     10),
                new SQLiteParameter("@STAT",          DbType.String,      1),
                new SQLiteParameter("@CHIP_ID",       DbType.String,     20),
                new SQLiteParameter("@LOSS_REASON",   DbType.String,    200),
                new SQLiteParameter("@OPE_USER_ID",   DbType.String,     50),
                new SQLiteParameter("@OPE_TIME",      DbType.DateTime),
                new SQLiteParameter("@VERSION_NO",    DbType.DateTime)
            };
            tmpParameters[0].Value = varEmpRegisterModel.BlackListId;
            tmpParameters[1].Value = varEmpRegisterModel.CardType;
            tmpParameters[2].Value = T_Date.ConvertLongToDateTime(varEmpRegisterModel.LossDt);
            tmpParameters[3].Value = varEmpRegisterModel.TicketId;
            tmpParameters[4].Value = varEmpRegisterModel.Stat;
            tmpParameters[5].Value = varEmpRegisterModel.ChipId;
            tmpParameters[6].Value = varEmpRegisterModel.LossReason;
            tmpParameters[7].Value = varEmpRegisterModel.OpeUserId;
            tmpParameters[8].Value = T_Date.ConvertLongToDateTime(varEmpRegisterModel.OpeTime);
            tmpParameters[9].Value = T_Date.ConvertLongToDateTime(varEmpRegisterModel.VersionNo);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_BlackList), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 更新票种信息(同步下载处理)
        /// </summary>
        /// <param name="varTicketTypeModel">票种信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/24</ Remark >
        public bool UpdateTicketType(SYS_TICKET_TYPE varTicketTypeModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("UPDATE SYS_TICKET_TYPE ");
            tmpStrSql.Append("SET TICKET_TYPE_NAME=@TICKET_TYPE_NAME,TEAM_FLAG=@TEAM_FLAG,VALIDATE_TIMES=@VALIDATE_TIMES,LESS_FLAG=@LESS_FLAG,DAY_NIGHT_FLAG=@DAY_NIGHT_FLAG,DAY_VALIDATE_FLAG=@DAY_VALIDATE_FLAG,");
            tmpStrSql.Append("PRICE=@PRICE,OPE_USER_ID=@OPE_USER_ID,OPE_TIME=@OPE_TIME,VERSION_NO=@VERSION_NO ");
            tmpStrSql.Append("WHERE TICKET_TYPE_ID=@TICKET_TYPE_ID");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@TICKET_TYPE_ID",    DbType.String,      2),
                new SQLiteParameter("@TICKET_TYPE_NAME",  DbType.String,    200),
                new SQLiteParameter("@TEAM_FLAG",         DbType.String,      1),
                new SQLiteParameter("@VALIDATE_TIMES",    DbType.Int32),
                new SQLiteParameter("@LESS_FLAG",         DbType.String,      1),
                new SQLiteParameter("@DAY_NIGHT_FLAG",    DbType.String,      1),
                new SQLiteParameter("@DAY_VALIDATE_FLAG", DbType.String,      1),
                new SQLiteParameter("@PRICE",             DbType.Int32),
                new SQLiteParameter("@OPE_USER_ID",       DbType.String,     50),
                new SQLiteParameter("@OPE_TIME",          DbType.DateTime),
                new SQLiteParameter("@VERSION_NO",        DbType.DateTime)
            };
            tmpParameters[0].Value  = varTicketTypeModel.TicketTypeId;
            tmpParameters[1].Value  = varTicketTypeModel.TicketTypeName;
            tmpParameters[2].Value  = varTicketTypeModel.TeamFlag;
            tmpParameters[3].Value  = varTicketTypeModel.ValidateTimes;
            tmpParameters[4].Value  = varTicketTypeModel.LessFlag;
            tmpParameters[5].Value  = varTicketTypeModel.DayNightFlag;
            tmpParameters[6].Value  = varTicketTypeModel.DayValidateFlag;
            tmpParameters[7].Value  = varTicketTypeModel.Price;
            tmpParameters[8].Value  = varTicketTypeModel.OpeUserId;
            tmpParameters[9].Value  = T_Date.ConvertLongToDateTime(varTicketTypeModel.OpeTime);
            tmpParameters[10].Value = T_Date.ConvertLongToDateTime(varTicketTypeModel.VersionNo);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_TicketType), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 新增字典信息
        /// </summary>
        /// <param name="varEmpRegisterModel">字典信息信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/24</ Remark >
        public bool InsertDictionary(SYS_DICTIONARY varDictionaryModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SYS_DICTIONARY(");
            tmpStrSql.Append("DICTIONARY_ID,KEY_CD,KEY_NAME,ITEM_CD,ITEM_NAME,ITEM_VAL,STAT,ORDER_NUM,VERSION_NO)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@DICTIONARY_ID,@KEY_CD,@KEY_NAME,@ITEM_CD,@ITEM_NAME,@ITEM_VAL,@STAT,@ORDER_NUM,@VERSION_NO)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@DICTIONARY_ID", DbType.String,  60),
                new SQLiteParameter("@KEY_CD",        DbType.String, 100),
                new SQLiteParameter("@KEY_NAME",      DbType.String, 100),
                new SQLiteParameter("@ITEM_CD",       DbType.String, 100),
                new SQLiteParameter("@ITEM_NAME",     DbType.String, 100),
                new SQLiteParameter("@ITEM_VAL",      DbType.String, 500),
                new SQLiteParameter("@STAT",          DbType.String,   1),
                new SQLiteParameter("@ORDER_NUM",     DbType.Int32),
                new SQLiteParameter("@VERSION_NO",    DbType.DateTime)
            };
            tmpParameters[0].Value = varDictionaryModel.DictionaryId;
            tmpParameters[1].Value = varDictionaryModel.KeyCd;
            tmpParameters[2].Value = varDictionaryModel.KeyName;
            tmpParameters[3].Value = varDictionaryModel.ItemCd;
            tmpParameters[4].Value = varDictionaryModel.ItemName;
            tmpParameters[5].Value = varDictionaryModel.ItemVal;
            tmpParameters[6].Value = varDictionaryModel.Stat;
            tmpParameters[7].Value = varDictionaryModel.OrderNum;
            tmpParameters[8].Value = T_Date.ConvertLongToDateTime(varDictionaryModel.VersionNo);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_Dictionary), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 新增票种检票规则信息
        /// </summary>
        /// <param name="varTicketTypeRule">票种检票规则信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/24</ Remark >
        public bool InsertTicketTypeRule(SYS_TICKET_TYPE_RULE varTicketTypeRule, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SYS_TICKET_TYPE_RULE(");
            tmpStrSql.Append("RULE_ID,TICKET_TYPE_ID,BEGIN_DT,END_DT,BEGIN_TIME,END_TIME,OPE_USER_ID,OPE_TIME,VERSION_NO)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@RULE_ID,@TICKET_TYPE_ID,@BEGIN_DT,@END_DT,@BEGIN_TIME,@END_TIME,@OPE_USER_ID,@OPE_TIME,@VERSION_NO)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@RULE_ID",        DbType.String,    60),
                new SQLiteParameter("@TICKET_TYPE_ID", DbType.String,     3),
                new SQLiteParameter("@BEGIN_DT",       DbType.DateTime),
                new SQLiteParameter("@END_DT",         DbType.DateTime),
                new SQLiteParameter("@BEGIN_TIME",     DbType.Int64),
                new SQLiteParameter("@END_TIME",       DbType.Int64),
                new SQLiteParameter("@OPE_USER_ID",    DbType.String,    50),
                new SQLiteParameter("@OPE_TIME",       DbType.DateTime),
                new SQLiteParameter("@VERSION_NO",     DbType.DateTime)
            };
            tmpParameters[0].Value = varTicketTypeRule.RuleId;
            tmpParameters[1].Value = varTicketTypeRule.TicketTypeId;
            tmpParameters[2].Value = T_Date.ConvertLongToDateTime(varTicketTypeRule.BeginDt);
            tmpParameters[3].Value = T_Date.ConvertLongToDateTime(varTicketTypeRule.EndDt);
            tmpParameters[4].Value = varTicketTypeRule.BeginTime;
            tmpParameters[5].Value = varTicketTypeRule.EndTime;
            tmpParameters[6].Value = varTicketTypeRule.OpeUserId;
            tmpParameters[7].Value = T_Date.ConvertLongToDateTime(varTicketTypeRule.OpeTime);
            tmpParameters[8].Value = T_Date.ConvertLongToDateTime(varTicketTypeRule.VersionNo);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_TicketTypeRule), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 新增预售期信息
        /// </summary>
        /// <param name="varEmpRegisterModel">预售期信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/26</ Remark >
        public bool InsertPeriod(SL_PERIOD varPeriodModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SL_PERIOD(");
            tmpStrSql.Append("SALE_PERIOD_ID,TICKET_TYPE_ID,SALE_PERIOD_NAME,BEGIN_DT,END_DT,DISCOUNT_PRICE,VERSION_NO)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@SALE_PERIOD_ID,@TICKET_TYPE_ID,@SALE_PERIOD_NAME,@BEGIN_DT,@END_DT,@DISCOUNT_PRICE,@VERSION_NO)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@SALE_PERIOD_ID",   DbType.String,     60),
                new SQLiteParameter("@TICKET_TYPE_ID",   DbType.String,      3),
                new SQLiteParameter("@SALE_PERIOD_NAME", DbType.String,    100),
                new SQLiteParameter("@BEGIN_DT",         DbType.DateTime),
                new SQLiteParameter("@END_DT",           DbType.DateTime),
                new SQLiteParameter("@DISCOUNT_PRICE",   DbType.Int64),
                new SQLiteParameter("@VERSION_NO",       DbType.DateTime)
            };
            tmpParameters[0].Value = varPeriodModel.SalePeriodId;
            tmpParameters[1].Value = varPeriodModel.TicketTypeId;
            tmpParameters[2].Value = varPeriodModel.SalePeriodName;
            tmpParameters[3].Value = T_Date.ConvertLongToDateTime(varPeriodModel.BeginDt);
            tmpParameters[4].Value = T_Date.ConvertLongToDateTime(varPeriodModel.EndDt);
            tmpParameters[5].Value = varPeriodModel.DiscountPrice;
            tmpParameters[6].Value = T_Date.ConvertLongToDateTime(varPeriodModel.VersionNo);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_PERIOD), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 新增参数信息
        /// </summary>
        /// <param name="varParemeterModel">参数信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/24</ Remark >
        public bool InsertParemeter(SYS_PAREMETER varParemeterModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SYS_PAREMETER(");
            tmpStrSql.Append("PAREMETER_ID,PAREMETER_NAME,PAREMETER_VAL,OPE_USER_ID,OPE_TIME,PAREMETER_TYPE,VERSION_NO)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@PAREMETER_ID,@PAREMETER_NAME,@PAREMETER_VAL,@OPE_USER_ID,@OPE_TIME,@PAREMETER_TYPE,@VERSION_NO)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@PAREMETER_ID",   DbType.String,     60),
                new SQLiteParameter("@PAREMETER_NAME", DbType.String,    100),
                new SQLiteParameter("@PAREMETER_VAL",  DbType.String,    100),
                new SQLiteParameter("@OPE_USER_ID",    DbType.String,     50),
                new SQLiteParameter("@OPE_TIME",       DbType.DateTime),
                new SQLiteParameter("@PAREMETER_TYPE", DbType.String,      1),
                new SQLiteParameter("@VERSION_NO",     DbType.DateTime)
            };
            tmpParameters[0].Value = varParemeterModel.ParemeterId;
            tmpParameters[1].Value = varParemeterModel.ParemeterName;
            tmpParameters[2].Value = varParemeterModel.ParemeterVal;
            tmpParameters[3].Value = varParemeterModel.OpeUserId;
            tmpParameters[4].Value = T_Date.ConvertLongToDateTime(varParemeterModel.OpeTime);
            tmpParameters[5].Value = varParemeterModel.ParemeterType;
            tmpParameters[6].Value = T_Date.ConvertLongToDateTime(varParemeterModel.VersionNo);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_Paremeter), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 新增票种场馆信息
        /// </summary>
        /// <param name="varTicketTypeVenueModel">票种场馆信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/24</ Remark >
        public bool InsertTicetTypeVenue(SYS_TICKET_TYPE_VENUE varTicketTypeVenueModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SYS_TICKET_TYPE_VENUE(");
            tmpStrSql.Append("TICKET_TYPE_ID,VENUE_ID,VERSION_NO,OPE_USER_ID,OPE_TIME)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@TICKET_TYPE_ID,@VENUE_ID,@VERSION_NO,@OPE_USER_ID,@OPE_TIME)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@TICKET_TYPE_ID", DbType.String,     3),
                new SQLiteParameter("@VENUE_ID",       DbType.Int32),
                new SQLiteParameter("@VERSION_NO",     DbType.DateTime),
                new SQLiteParameter("@OPE_USER_ID",    DbType.String,    50),
                new SQLiteParameter("@OPE_TIME",       DbType.DateTime)
            };
            tmpParameters[0].Value = varTicketTypeVenueModel.TicketTypeId;
            tmpParameters[1].Value = varTicketTypeVenueModel.VenueId;
            tmpParameters[2].Value = T_Date.ConvertLongToDateTime(varTicketTypeVenueModel.VersionNo);
            tmpParameters[3].Value = varTicketTypeVenueModel.OpeUserId;
            tmpParameters[4].Value = T_Date.ConvertLongToDateTime(varTicketTypeVenueModel.OpeTime);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_TicketTyptVenue), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 新增员工通行场馆信息
        /// </summary>
        /// <param name="varEmpVenue">员工通行场馆信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/22</ Remark >
        public bool InsertEmpVenue(SYS_EMP_VENUE varEmpVenue, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SYS_EMP_VENUE(");
            tmpStrSql.Append("EMP_VENUE_ID,EMP_ID,VENUE_ID,VERSION_NO)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@EMP_VENUE_ID,@EMP_ID,@VENUE_ID,@VERSION_NO)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@EMP_VENUE_ID", DbType.String, 50),
                new SQLiteParameter("@EMP_ID",       DbType.Int64),
                new SQLiteParameter("@VENUE_ID",     DbType.Int32),
                new SQLiteParameter("@VERSION_NO",   DbType.DateTime)
            };
            tmpParameters[0].Value = varEmpVenue.EmpVenueId;
            tmpParameters[1].Value = varEmpVenue.EmpId;
            tmpParameters[2].Value = varEmpVenue.VenueId;
            tmpParameters[3].Value = T_Date.ConvertLongToDateTime(varEmpVenue.VersionNo);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_EmpVenue), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 设置系统日期为服务器日期
        /// </summary>
        /// <param name="varClientId">终端编号</param>
        /// <param name="varClientName">终端名称</param>
        public bool SetSystemDT()
        {
            //调用rpc获取服务器时间
            long tmpDateTime;

            try
            {
                //获取服务器日期时间
                tmpDateTime = _rpcClient.GetSystemDateTimeRpc();
                //本地日期时间与服务器日期时间相差超过1min,设置本地日期时间
                long tmpLocal = T_Date.ConvertDataTimeToLong(DateTime.Now);
                long tmpSub   = Math.Abs(tmpLocal - tmpDateTime);
                if (tmpSub > 60000)
                {
                    T_System.SetLocalTime(T_System.ConvertDateTimeToSystemTime(T_Date.ConvertLongToDateTime(tmpDateTime)));
                }
            }
            catch (Exception ex)
            {
                _log.Error(typeof(B_BaseDataSync), ex);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 更新员工登记信息(同步下载处理)
        /// </summary>
        /// <param name="varEmpRegisterModel">员工登记信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/22</ Remark >
        public bool UpdateEmpRegister(SYS_EMP_REGISTER varEmpRegisterModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("UPDATE SYS_EMP_REGISTER ");
            tmpStrSql.Append("SET EMP_NAME=@EMP_NAME,CHIP_ID=@CHIP_ID,DEPARTMENT=@DEPARTMENT,PHOTO=@PHOTO,STAT=@STAT,CARD_TYPE=@CARD_TYPE,");
            tmpStrSql.Append("CARD_ID=@CARD_ID,MAIL=@MAIL,GENDER=@GENDER,TEL=@TEL,VERSION_NO=@VERSION_NO,OPE_USER_ID=@OPE_USER_ID,OPE_TIME=@OPE_TIME ");
            tmpStrSql.Append("WHERE EMP_ID=@EMP_ID");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@EMP_ID",      DbType.Int64),
                new SQLiteParameter("@EMP_NAME",    DbType.String,    100),
                new SQLiteParameter("@CHIP_ID",     DbType.String,     20),
                new SQLiteParameter("@DEPARTMENT",  DbType.String,    100),
                new SQLiteParameter("@PHOTO",       DbType.Binary),
                new SQLiteParameter("@STAT",        DbType.String,      1),
                new SQLiteParameter("@CARD_TYPE",   DbType.String,      2),
                new SQLiteParameter("@CARD_ID",     DbType.String,    100),
                new SQLiteParameter("@MAIL",        DbType.String,    200),
                new SQLiteParameter("@GENDER",      DbType.String,      1),
                new SQLiteParameter("@TEL",         DbType.String,     15),
                new SQLiteParameter("@VERSION_NO",  DbType.DateTime),
                new SQLiteParameter("@OPE_USER_ID", DbType.String,     60),
                new SQLiteParameter("@OPE_TIME",    DbType.DateTime)
            };
            tmpParameters[0].Value  = varEmpRegisterModel.EmpId;
            tmpParameters[1].Value  = varEmpRegisterModel.EmpName;
            tmpParameters[2].Value  = varEmpRegisterModel.ChipId;
            tmpParameters[3].Value  = varEmpRegisterModel.Department;
            tmpParameters[4].Value  = varEmpRegisterModel.Photo;
            tmpParameters[5].Value  = varEmpRegisterModel.Stat;
            tmpParameters[6].Value  = varEmpRegisterModel.CardType;
            tmpParameters[7].Value  = varEmpRegisterModel.CardId;
            tmpParameters[8].Value  = varEmpRegisterModel.Mail;
            tmpParameters[9].Value  = varEmpRegisterModel.Gender;
            tmpParameters[10].Value = varEmpRegisterModel.Tel;
            tmpParameters[11].Value = T_Date.ConvertLongToDateTime(varEmpRegisterModel.VersionNo);
            tmpParameters[12].Value = varEmpRegisterModel.OpeUserId;
            tmpParameters[13].Value = T_Date.ConvertLongToDateTime(varEmpRegisterModel.OpeTime);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_EmpRegister), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 新增终端信息
        /// </summary>
        /// <param name="varParemeterModel">终端信息实体</param>
        /// <returns>true成功 false失败</returns>
        /// <Remark>郝毅志,2017/06/24</ Remark >
        public bool InsertClient(SYS_CLIENT varClientModel, SQLiteCommand varCommand)
        {
            StringBuilder tmpStrSql = new StringBuilder();

            tmpStrSql.Append("INSERT INTO SYS_CLIENT(");
            tmpStrSql.Append("CLIENT_ID,CLIENT_NAME,CLIENT_TYPE,REGION_ID,OUTLET_ID,IP_ADDR,PORT,STAT,GATE_MODE,RUN_STAT,REPORT_TIME,TOKEN,OPE_USER_ID,OPE_TIME)");
            tmpStrSql.Append(" values (");
            tmpStrSql.Append("@CLIENT_ID,@CLIENT_NAME,@CLIENT_TYPE,@REGION_ID,@OUTLET_ID,@IP_ADDR,@PORT,@STAT,@GATE_MODE,@RUN_STAT,@REPORT_TIME,@TOKEN,@OPE_USER_ID,@OPE_TIME)");
            SQLiteParameter[] tmpParameters =
            {
                new SQLiteParameter("@CLIENT_ID",   DbType.Int64),
                new SQLiteParameter("@CLIENT_NAME", DbType.String,    200),
                new SQLiteParameter("@CLIENT_TYPE", DbType.String,      1),
                new SQLiteParameter("@REGION_ID",   DbType.Int64),
                new SQLiteParameter("@OUTLET_ID",   DbType.Int64),
                new SQLiteParameter("@IP_ADDR",     DbType.String,     20),
                new SQLiteParameter("@PORT",        DbType.String,     20),
                new SQLiteParameter("@STAT",        DbType.String,      1),
                new SQLiteParameter("@GATE_MODE",   DbType.Int32),
                new SQLiteParameter("@RUN_STAT",    DbType.Int32),
                new SQLiteParameter("@REPORT_TIME", DbType.DateTime),
                new SQLiteParameter("@TOKEN",       DbType.String,    100),
                new SQLiteParameter("@OPE_USER_ID", DbType.String,     60),
                new SQLiteParameter("@OPE_TIME",    DbType.DateTime)
            };
            tmpParameters[0].Value  = varClientModel.ClientId;
            tmpParameters[1].Value  = varClientModel.ClientName;
            tmpParameters[2].Value  = varClientModel.ClientType;
            tmpParameters[3].Value  = varClientModel.RegionId;
            tmpParameters[4].Value  = varClientModel.OutletId;
            tmpParameters[5].Value  = varClientModel.IpAddr;
            tmpParameters[6].Value  = varClientModel.Port;
            tmpParameters[7].Value  = varClientModel.Stat;
            tmpParameters[8].Value  = varClientModel.GateMode;
            tmpParameters[9].Value  = varClientModel.RunStat;
            tmpParameters[10].Value = T_Date.ConvertLongToDateTime(varClientModel.ReportTime);
            tmpParameters[11].Value = varClientModel.Token;
            tmpParameters[12].Value = varClientModel.OpeUserId;
            tmpParameters[13].Value = T_Date.ConvertLongToDateTime(varClientModel.OpeTime);
            //执行命令配置
            varCommand.CommandText = tmpStrSql.ToString();
            varCommand.CommandType = CommandType.Text;
            foreach (SQLiteParameter parm in tmpParameters)
            {
                varCommand.Parameters.Add(parm);
            }

            int tmpRows = 0;

            try
            {
                tmpRows = varCommand.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                _log.Error(typeof(D_Client), ex);
                return(false);
            }
            if (tmpRows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }