コード例 #1
0
        public DataTable GetAllMessages()
        {
            string    sql = "select top 5 * from t_web_text order by wt_time desc ";
            DataTable dt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];

            return(dt);
        }
コード例 #2
0
ファイル: RentInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public DataTable GetStatisticTimeData(string category, string type, string year, string month, string day, string psName, string userId)
        {
            DataTable dataTable = null;

            SqlParameter[] parameters =
            {
                new SqlParameter("@statistictype",  SqlDbType.VarChar,  50),
                new SqlParameter("@statisticyear",  SqlDbType.VarChar,  50),
                new SqlParameter("@statisticmonth", SqlDbType.VarChar,  50),
                new SqlParameter("@statisticday",   SqlDbType.VarChar,  50),
                new SqlParameter("@psname",         SqlDbType.NVarChar, 50),
                new SqlParameter("@userId",         SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = type;
            parameters[1].Value = year;
            parameters[2].Value = month;
            parameters[3].Value = day;
            parameters[4].Value = psName;
            parameters[5].Value = userId;
            if (!string.IsNullOrEmpty(category) || category == "0")
            {
                dataTable = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(CommandType.StoredProcedure, "up_RentReport_RentStatisticByPoliceStation", parameters)).Tables[0];
            }
            else
            {
                dataTable = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(CommandType.StoredProcedure, "up_RentReport_RentHouseStatisticByPoliceStation", parameters)).Tables[0];
            }
            return(dataTable);
        }
コード例 #3
0
ファイル: LockManager.cs プロジェクト: Tony9866/anxinsu
        public void AddLockLog(string deviceId, string action)
        {
            string id  = Guid.NewGuid().ToString();
            string sql = "insert into Rent_Lock_Logs values ('" + id + "','" + deviceId + "','" + action + "','" + DateTime.Now.ToString() + "','')";

            MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
        }
コード例 #4
0
ファイル: RentInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public void UpdateRent(RentInfo rentInfo)
        {
            StringBuilder strSql = new StringBuilder();

            if (IsExistsRentNo(rentInfo.RentNo))
            {
                //Update
                strSql.Append("Update Rent_Rent set ");
                strSql.Append(" RDName='" + rentInfo.RDName + "',RSName='" + rentInfo.RSName + "',RRName='" + rentInfo.RRName + "',");
                strSql.Append(" RPSParentName = '" + rentInfo.RPSParentName + "', RPSName = '" + rentInfo.RPSName + "',RAddress='" + rentInfo.RAddress + "',RDoor='" + rentInfo.RDoor + "',");
                strSql.Append(" RTotalDoor='" + rentInfo.RTotalDoor + "',RRoomType='" + rentInfo.RRoomType + "',RDirection='" + rentInfo.RDirection + "',");
                strSql.Append(" RStructure='" + rentInfo.RStructure + "',RBuildingType='" + rentInfo.RBuildingType + "',RFloor='" + rentInfo.RFloor + "', ");
                strSql.Append(" RTotalFloor='" + rentInfo.RTotalFloor + "', RHouseAge='" + rentInfo.RHouseAge + "',RProperty='" + rentInfo.RProperty + "', ");
                strSql.Append(" RRentArea='" + rentInfo.RRentArea + "' ,RBuildArea='" + rentInfo.RBuildArea + "', ROwner='" + rentInfo.ROwner + "',");
                strSql.Append(" ROwnerTel='" + rentInfo.ROwnerTel + "' ,RIDCard='" + rentInfo.RIDCard + "', RLocationDescription='" + rentInfo.RLocationDescription + "',");
                strSql.Append(" RMapID='" + rentInfo.RMapID + "' ,RPSID='" + rentInfo.RPSID + "',");
                strSql.Append(" RModifiedBy='" + rentInfo.RModifiedBy + "',");
                strSql.Append(" RModifiedDate='" + rentInfo.RModifiedDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "',RRentType='" + rentInfo.RentType + "',ROwnType='" + rentInfo.OwnType + "'");
                strSql.Append(" where RentNo = '" + rentInfo.RentNo + "'");
                SysLogHelper.AddLog(rentInfo.RModifiedBy, "修改房源信息ID:" + rentInfo.RentNo, "修改-房源信息");
            }
            else
            {
                //Insert
                strSql.Append("Insert into Rent_Rent ([RentNO],[RDName],[RSName],[RRName]," +
                              "[RPSName],[RAddress],[RDoor],[RTotalDoor]," +
                              "[RRoomType],[RDirection],[RStructure],[RBuildingType]," +
                              "[RFloor] ,[RTotalFloor],[RHouseAge] ,[RProperty]," +
                              "[RRentArea],[RBuildArea],[ROwner],[ROwnerTel]," +
                              "[RIDCard],[RLocationDescription],[RMapID],[RPSID]," +
                              "[RCreatedBy],[RCreatedDate],[RModifiedBy]," +
                              "[RModifiedDate],[RPSParentName],[RRentType],[ROwntype],[IsAvailable],[IsObsoleted],[RentNumber]) values (");
                strSql.Append("'" + rentInfo.RentNo + "','" + rentInfo.RDName + "','" + rentInfo.RSName + "','" + rentInfo.RRName + "',");
                strSql.Append("'" + rentInfo.RPSName + "','" + rentInfo.RAddress + "','" + rentInfo.RDoor + "','" + rentInfo.RTotalDoor + "',");
                strSql.Append("'" + rentInfo.RRoomType + "','" + rentInfo.RDirection + "','" + rentInfo.RStructure + "','" + rentInfo.RBuildingType + "',");
                strSql.Append("'" + rentInfo.RFloor + "','" + rentInfo.RTotalFloor + "','" + rentInfo.RHouseAge + "','" + rentInfo.RProperty + "',");
                strSql.Append("'" + rentInfo.RRentArea + "','" + rentInfo.RBuildArea + "','" + rentInfo.ROwner + "','" + rentInfo.ROwnerTel + "',");
                strSql.Append("'" + rentInfo.RIDCard + "','" + rentInfo.RLocationDescription + "','" + rentInfo.RMapID + "','" + rentInfo.RPSID + "',");
                strSql.Append("'" + rentInfo.RCreatedBy + "','" + rentInfo.RCreatedDate.ToString("yyyy-MM-dd hh:mm:ss") + "','" + rentInfo.RCreatedBy + "',");
                strSql.Append("'" + rentInfo.RCreatedDate.ToString("yyyy-MM-dd hh:mm:ss") + "','" + rentInfo.RPSParentName + "','" + rentInfo.RentType + "','" + rentInfo.OwnType + "','" + rentInfo.IsAvailable + "','" + rentInfo.IsObsoleted + "','0'");
                strSql.Append(")");
                UpdateRentExternal(rentInfo);
                SysLogHelper.AddLog(rentInfo.RCreatedBy, "添加房源信息ID:" + rentInfo.RentNo, "添加-房源信息");
            }
            MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(strSql.ToString()));
            if (!string.IsNullOrEmpty(rentInfo.Longitude) && !string.IsNullOrEmpty(rentInfo.Latitude))
            {
                StringBuilder strSql1 = new StringBuilder();
                if (IsExistsMapInfo(rentInfo.RentNo))
                {
                    strSql1.Append("Update Rent_Map set Longitude='" + rentInfo.Longitude + "', Latitude='" + rentInfo.Latitude + "' where RentNO='" + rentInfo.RentNo + "'");
                }
                else
                {
                    strSql1.Append("Insert into Rent_Map values('" + rentInfo.RentNo + "', '" + rentInfo.Longitude + "', '" + rentInfo.Latitude + "')");
                }

                MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(strSql1.ToString()));
            }
        }
コード例 #5
0
ファイル: RentInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public string GetRentNo(string RDID)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select LDShortName,LDName from Rent_District WITH (NOLOCK) where LDID='" + RDID + "'");
            DataTable rentTable = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString())).Tables[0];

            string ldName    = rentTable.Rows[0]["LDName"].ToString();
            string shortName = rentTable.Rows[0]["LDShortName"].ToString();

            StringBuilder sqlStrId = new StringBuilder();

            sqlStrId.Append("select top 1 substring(RentNo,charindex('-',RentNo)+1 ,len(RentNo)) as [LatestNo] from Rent_Rent where RDName='" + RDID + "' order by RID desc");
            DataTable rentTable1 = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStrId.ToString())).Tables[0];

            if (rentTable1 != null && rentTable1.Rows.Count > 0)
            {
                int maxRentNo = Convert.ToInt32(rentTable1.Rows[0]["LatestNo"]) + 1;
                return(shortName + "-" + maxRentNo.ToString());
            }

            else
            {
                return(shortName + "-10000001");
            }
        }
コード例 #6
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public void DeleteRelationShip(string userId)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("delete from Rent_user_dept_relationship where t_wu_user_id=" + userId);
            MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString()));
        }
コード例 #7
0
        public RentAttribute(int rraId)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("SELECT * FROM Rent_RentAttribute  WHERE RRAID=@RRAID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@RRAID", SqlDbType.Int),
            };
            parameters[0].Value = rraId;

            DataTable rentTable = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString(), parameters)).Tables[0];

            if (rentTable != null && rentTable.Rows.Count > 0)
            {
                m_RRAID              = Convert.ToInt16(rentTable.Rows[0]["RRAID"]);
                m_RentNo             = rentTable.Rows[0]["RentNo"].ToString();
                m_RRAContactName     = rentTable.Rows[0]["RRAContactName"].ToString();
                m_RRAContactTel      = rentTable.Rows[0]["RRAContactTel"].ToString();
                m_RRANationName      = rentTable.Rows[0]["RRANationName"].ToString();
                m_RRAIDCard          = rentTable.Rows[0]["RRAIDCard"].ToString();
                m_RRentPrice         = Convert.ToDecimal(rentTable.Rows[0]["RRentPrice"]);
                m_RRAContactProvince = rentTable.Rows[0]["RRAContactProvince"].ToString();
                m_RRAStartDate       = DateTime.Parse(rentTable.Rows[0]["RRAStartDate"].ToString());
                m_RRAEndDate         = DateTime.Parse(rentTable.Rows[0]["RRAEndDate"].ToString());
                if (!rentTable.Rows[0].IsNull("RRARealEndDate"))
                {
                    m_RRARealEndDate = DateTime.Parse(rentTable.Rows[0]["RRARealEndDate"].ToString());
                }
                RRACheckOutPerson = rentTable.Rows[0]["RRACheckOutPerson"].ToString();
                RRACheckOutReason = rentTable.Rows[0]["RRACheckOutReason"].ToString();
                m_RRADescription  = rentTable.Rows[0]["RRADescription"].ToString();
                m_RRACreatedBy    = rentTable.Rows[0]["RRACreatedBy"].ToString();
                m_RRACreatedDate  = DateTime.Parse(rentTable.Rows[0]["RRACreatedDate"].ToString());
                m_RRAModifiedBy   = rentTable.Rows[0]["RRAModifiedBy"].ToString();
                if (rentTable.Rows[0]["RRAStatus"] != null)
                {
                    m_Status = rentTable.Rows[0]["RRAStatus"].ToString();
                }

                if (rentTable.Rows[0]["RRAModifiedDate"] == null || string.IsNullOrEmpty(rentTable.Rows[0]["RRAModifiedDate"].ToString()))
                {
                    m_RRAModifiedDate = null;
                }
                else
                {
                    m_RRAModifiedDate = DateTime.Parse(rentTable.Rows[0]["RRAModifiedDate"].ToString());
                }

                m_RRAIsActive = Convert.ToBoolean(rentTable.Rows[0]["RRAIsActive"].ToString());
            }

            string    sql = "select * from Rent_RentAttribute_External where RRAID=" + rraId;
            DataTable dt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];

            if (dt.Rows.Count > 0)
            {
                m_tenantId = dt.Rows[0]["HZTenantID"].ToString();
            }
        }
コード例 #8
0
        /// <summary>
        /// 添加消费记录
        /// </summary>
        /// <param name="rennteeIDCard"></param>
        /// <param name="ownerIDCard"></param>
        /// <param name="fee"></param>
        /// <param name="payType">0:微信,1:钱包</param>
        /// <returns></returns>
        public string AddBillLog(string rennteeIDCard, string ownerIDCard, string fee, string payType)
        {
            Dictionary <string, string> ret = new Dictionary <string, string>();

            try
            {
                string rate = ConfigurationManager.AppSettings["FeeRate"];
                string sql  = "Insert into sys_bill values ('" + Guid.NewGuid().ToString() + "','房费','" + rennteeIDCard + "','" + ownerIDCard + "','" + payType + "','0','" + DateTime.Now.ToString() + "','收入'," + fee + ")";
                MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
                decimal rateFee = 0;
                rateFee = decimal.Parse(fee) * decimal.Parse(rate);
                if (rateFee > 0)
                {
                    sql = "Insert into sys_bill values ('" + Guid.NewGuid().ToString() + "','平台手续费','" + ownerIDCard + "','云上之家服务平台','" + payType + "','1','" + DateTime.Now.ToString() + "','支出'," + rateFee.ToString() + ")";
                    MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
                }

                ret.Add("ret", "0");
                ret.Add("msg", "Success");
            }
            catch (Exception ex)
            {
                ret.Add("ret", "1");
                ret.Add("msg", ex.Message);
            }

            return(JSONHelper.ToJson(ret));
        }
コード例 #9
0
        /// <summary>
        /// 用户充值
        /// </summary>
        /// <param name="idcard"></param>
        /// <param name="fee"></param>
        public string DepositUserWallet(string idcard, string fee)
        {
            Dictionary <string, string> ret = new Dictionary <string, string>();

            ret.Add("ret", "0");
            string    sql    = "select * from v_CF_User_View where IDCard='" + idcard + "'";
            DataTable dt     = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];
            string    userId = dt.Rows[0]["UserID"].ToString();

            sql = "select * from CF_User_Extenal where UserID=" + dt.Rows[0]["UserID"].ToString();
            dt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];
            string feeRate = ConfigurationManager.AppSettings["FeeRate"];

            if (dt.Rows.Count > 0)
            {
                decimal wallet = decimal.Parse(dt.Rows[0]["Wallet"].ToString()) + decimal.Parse(fee);
                sql = "update CF_User_Extenal set wallet = " + wallet.ToString() + " where ExternalID=" + dt.Rows[0]["ExternalID"].ToString();
                MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
                ret.Add("fee", wallet.ToString());
            }
            else
            {
                decimal wallet = decimal.Parse(fee);
                sql = "Insert into CF_User_Extenal values (" + userId + "," + wallet.ToString() + ",0,'','','')";
                MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
                ret.Add("fee", wallet.ToString());
            }
            return(JSONHelper.ToJson(ret));
        }
コード例 #10
0
        public DataTable GetRentAttribute(string id)
        {
            string  sql = "select * from  Rent_RentAttribute where RRAIsActive=0 and RRAID=" + id;
            DataSet ds  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));

            return(ds.Tables[0]);
        }
コード例 #11
0
        public void DeleteRentAttribute(RentAttribute rentAttribute)
        {
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();

            strSql1.Append(" Update Rent_Rent set IsAvailable=0");
            strSql1.Append(" where RentNo = '" + rentAttribute.RentNo + "'");

            //Update
            strSql.Append(" Update Rent_RentAttribute set RRAIsActive=1, RRAStatus='5', ");
            strSql.Append(" RRAModifiedBy='" + rentAttribute.RRAModifiedBy + "',");
            strSql.Append(" RRAModifiedDate='" + rentAttribute.RRAModifiedDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "'");
            strSql.Append(" where RRAID = '" + rentAttribute.RRAID + "'");
            SysLogHelper.AddLog(rentAttribute.RRAModifiedBy, "删除租赁信息ID:" + rentAttribute.RentNo, "删除-租赁信息");

            List <SqlCommand> listSQL = new List <SqlCommand>();

            listSQL.Add(MySQLHelper.CreateCommand(strSql.ToString()));
            listSQL.Add(MySQLHelper.CreateCommand(strSql1.ToString()));

            MySQLHelper.ExecuteNonQueryTrans(SqlConnString, listSQL);

            //清除密码和IC卡信息
            ClearPasswordToLock(rentAttribute.RRAID.ToString());
        }
コード例 #12
0
ファイル: CorporationHelper.cs プロジェクト: Tony9866/anxinsu
        public void DeleteCorporation(string corpId)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("delete from  t_corporation where co_corp_id='" + corpId + "'");
            MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString()));
        }
コード例 #13
0
        public void UpdateMessage(string title, string content, string id)
        {
            string guid = Guid.NewGuid().ToString();
            string sql  = "update t_web_text set wt_title='" + title + "',wt_text='" + content + "' where wt_serial_id='" + id + "'";

            MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
        }
コード例 #14
0
        public void DeleteMessage(string msgId)
        {
            string guid = Guid.NewGuid().ToString();
            string sql  = "delete from t_web_text where wt_serial_id='" + msgId + "'";

            MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
        }
コード例 #15
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public DataTable GetUserRegRelationList(string userId)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select * from Rent_user_dept_relationship where t_wu_user_id=" + userId);
            return(MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString())).Tables[0]);
        }
コード例 #16
0
        public void UploadPersonInfo(string id, string motorNo)
        {
            //type: 0-出租屋,1-印章系统,2-车辆
            string sql = "insert into T_Person_Info values ('" + Guid.NewGuid().ToString() + "','" + id + "','" + motorNo + "','" + motorNo + "','2','" + DateTime.Now.ToString() + "','0','','RZF','天津市河西区天塔街环湖南里','120004056','120004056','0','','')";

            MySQLHelper.ExecuteNonQuery(MySQLHelper.DataSynConnectionString, MySQLHelper.CreateCommand(sql));
        }
コード例 #17
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public void InsertRelationShip(string userId, string region)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("insert into Rent_user_dept_relationship values ('" + Guid.NewGuid().ToString() + "'," + userId + ",'" + region + "','1','')");
            MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString()));
        }
コード例 #18
0
        /// <summary>
        /// 添加密码到电子锁
        /// </summary>
        /// <param name="rentNO"></param>
        /// <param name="pass"></param>
        /// <param name="startdate"></param>
        /// <param name="enddate"></param>
        /// <param name="phone"></param>
        /// <returns></returns>
        public string AddPassword(string rentNO, string pass, string startdate, string enddate, string phone)
        {
            Dictionary <string, string> ret = new Dictionary <string, string>();
            string    sql = "select * from Rent_Locks where rentNo='" + rentNO + "' and Status='0'";
            DataTable dt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];

            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["DeviceType"].ToString() == "1") //新锁
                {
                    NewLockManager managerNew = new NewLockManager();
                    string         r          = managerNew.GetPostInterface(dt.Rows[0]["DeviceID"].ToString(), phone, "2", pass, startdate, enddate); //设置临时密码
                    ret = JSONHelper.FromJson <Dictionary <string, string> >(r);
                }
                else //旧锁
                {
                    LockManager manager = new LockManager();
                    manager.AddPassword(dt.Rows[0]["DeviceID"].ToString(), pass, startdate, enddate);
                    string r = manager.UpdatePassengerInfoToDevice(dt.Rows[0]["DeviceID"].ToString(), "", "", "", pass, DateTime.Parse(startdate).ToString("yyyyMMddHHmm").Substring(2, 10), DateTime.Parse(enddate).ToString("yyyyMMddHHmm").Substring(2, 10), "3");
                    ret = JSONHelper.FromJson <Dictionary <string, string> >(r);
                }
            }
            else
            {
                ret.Add("ret", "1");
                ret.Add("msg", "未发现智能锁信息,无法添加密码");
            }

            return(JSONHelper.ToJson(ret));
        }
コード例 #19
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public void DeleteCommunityRelationship(string guid)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("delete from Rent_user_community_relationship where t_fun_guid='" + guid + "'");
            MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString()));
        }
コード例 #20
0
        /// <summary>
        /// 获取随行人员
        /// </summary>
        /// <param name="rraId"></param>
        /// <returns></returns>
        public DataTable GetRetinues(string rraId)
        {
            string    sql = "select * from Rent_Retinues where RRAID = '" + rraId + "'";
            DataTable dt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];

            return(dt);
        }
コード例 #21
0
ファイル: AttachmentInfo.cs プロジェクト: Tony9866/anxinsu
        public AttachmentInfo(int attachmentId)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select * from t_signet_attachment where sa_attachment_id=@attachmentId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@attachmentId", SqlDbType.BigInt),
            };
            parameters[0].Value = attachmentId;
            DataTable attachmentTable = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString(), parameters)).Tables[0];

            if (attachmentTable != null && attachmentTable.Rows.Count > 0)
            {
                m_attachmentId    = attachmentId;
                m_signetId        = attachmentTable.Rows[0]["sa_signet_id"].ToString();
                m_attachmentTitle = attachmentTable.Rows[0]["sa_attachment_description"].ToString();
                m_attachmentDemo  = attachmentTable.Rows[0]["sa_attachment_demo"].ToString();
                m_createDate      = DateTime.Parse(attachmentTable.Rows[0]["sa_attachment_date"].ToString());
                if (!attachmentTable.Rows[0].IsNull("sa_attachment_mark"))
                {
                    m_fileInfo = (byte[])attachmentTable.Rows[0]["sa_attachment_mark"];
                    FileStream fileStream = new FileStream(System.Web.HttpContext.Current.Server.MapPath("~") + "\\temp_" + attachmentId.ToString() + ".jpg", FileMode.Create, FileAccess.ReadWrite);
                    fileStream.Write(m_fileInfo, 0, m_fileInfo.Length);
                    fileStream.Flush();
                    fileStream.Dispose();
                }
            }
        }
コード例 #22
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        //up_SignetInternet_RegDeptSelectAll
        public DataTable GetRegDeptList()
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select * from Rent_PoliceStation where parentID>0");
            return(MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString())).Tables[0]);
        }
コード例 #23
0
ファイル: RentInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public bool IsExistsSameAddressRent(string rdName, string rsName, string rrName, string rDoor)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select 1 from Rent_Rent where RDName=@rdName AND RSName=@rsName AND RRName=@rrName and RDoor=@rDoor");
            SqlParameter[] parameters =
            {
                new SqlParameter("@rdName", SqlDbType.NVarChar, 50),
                new SqlParameter("@rsName", SqlDbType.NVarChar, 50),
                new SqlParameter("@rrName", SqlDbType.NVarChar, 50),
                new SqlParameter("@rDoor",  SqlDbType.NVarChar, 50),
            };
            parameters[0].Value = rdName;
            parameters[1].Value = rsName;
            parameters[2].Value = rrName;
            parameters[3].Value = rDoor;
            DataTable rentTable = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString(), parameters)).Tables[0];

            if (rentTable != null && rentTable.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #24
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public DataTable GetDeptList()
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select * from CF_Department");
            return(MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString())).Tables[0]);
        }
コード例 #25
0
ファイル: RentInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public void DeleteCorporation(string rentNo)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("delete from  Rent_Rent where RentNo='" + rentNo + "'");
            MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString()));
        }
コード例 #26
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public DataTable GetCummunityList()
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select * from Rent_Road");
            return(MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString())).Tables[0]);
        }
コード例 #27
0
ファイル: RentInfoHelper.cs プロジェクト: Tony9866/anxinsu
 public DataTable GetDataTable(string sql)
 {
     SqlParameter[] parameters =
     {
     };
     return(MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sql, parameters)).Tables[0]);
 }
コード例 #28
0
ファイル: UserInfoHelper.cs プロジェクト: Tony9866/anxinsu
        public DataTable GetCFUserList(string deptId)
        {
            StringBuilder sqlStr = new StringBuilder();

            sqlStr.Append("select * from cf_user where DeptId=" + deptId);
            return(MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sqlStr.ToString())).Tables[0]);
        }
コード例 #29
0
ファイル: LockManager.cs プロジェクト: Tony9866/anxinsu
        public DataTable GetDeviceDetailInfo(string deviceId)
        {
            string    sql = "select * from Rent_Locks where ID=" + deviceId;
            DataTable dt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];

            return(dt);
        }
コード例 #30
0
        public string GetIOLetInfos()
        {
            Dictionary <string, string> kv = new Dictionary <string, string>();

            kv.Add("ResourceId", "iolets");
            kv.Add("RequestId", "EBA1001S");
            //kv.Add("Host", "http://qxw2332340157.my3w.com");
            kv.Add("Token", "TJ_TIANTAJ_PS");
            string retStr = LigerRM.Common.WebRequestHelper.WebRequestPoster.GetJson(IOLET_URL, kv);
            Dictionary <string, string> ret = new Dictionary <string, string>();

            ret = JSONHelper.FromJson <Dictionary <string, string> >(retStr);
            if (ret["rsc"].ToString() == "200")
            {
                string sql = "delete from Motor_IOLetInfo";
                MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
                IOLets[] partRet = JSONHelper.FromJson <IOLets[]>(ret["iolets"]);
                foreach (IOLets io in partRet)
                {
                    sql = "Insert into Motor_IOLetInfo values ('" + io.id + "','" + io.name + "','" + io.parklot + "','" + DateTime.Now.ToString() + "','')";
                    MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql));
                }
            }

            return(retStr);
        }