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()); }
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())); } }
public string AddRentAttribute(RentAttribute rentAttribute) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); //strSql1.Append(" Update Rent_Rent set IsAvailable=1"); //strSql1.Append(" where RentNo = '" + rentAttribute.RentNo + "'"); //Update strSql.Append("INSERT INTO Rent_RentAttribute ([RentNo],[RRAContactName],[RRAContactTel],[RRANationName],[RRAIDCard]," + "[RRentPrice],[RRAContactProvince],[RRAStartDate],[RRAEndDate],[RRARealEndDate],[RRACheckOutPerson],[RRACheckOutReason],[RRADescription],[RRACreatedBy]," + "[RRACreatedDate],[RRAModifiedBy],[RRAModifiedDate],[RRAIsActive],[RRAStatus],[AppId],[Body],[MchId],[TradeNO],[TotalFee],[PrepayID]) values ("); strSql.Append(" '" + rentAttribute.RentNo + "',"); strSql.Append(" '" + rentAttribute.RRAContactName + "',"); strSql.Append(" '" + rentAttribute.RRAContactTel + "',"); strSql.Append(" '" + rentAttribute.RRANationName + "',"); strSql.Append(" '" + rentAttribute.RRAIDCard + "',"); strSql.Append(" '" + rentAttribute.RRentPrice + "', "); strSql.Append(" '" + rentAttribute.RRAContactProvince + "' ,"); strSql.Append(" '" + rentAttribute.RRAStartDate + "','" + rentAttribute.RRAEndDate + "',null,'','',"); strSql.Append(" '" + rentAttribute.RRADescription + "',"); strSql.Append(" '" + rentAttribute.RRACreatedBy + "',"); strSql.Append(" '" + rentAttribute.RRACreatedDate.ToString("yyyy-MM-dd HH:mm:ss") + "', "); strSql.Append("'" + rentAttribute.RRACreatedBy + "','" + rentAttribute.RRACreatedDate.ToString("yyyy-MM-dd HH:mm:ss") + "', 0 ,'" + rentAttribute.Status + "','','','','',0,''"); strSql.Append(" )"); strSql.Append(" select @@identity"); List <SqlCommand> listSQL = new List <SqlCommand>(); listSQL.Add(MySQLHelper.CreateCommand(strSql.ToString())); DataSet ds = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(strSql.ToString())); string sql = "select top 1 * from Rent_RentAttribute where RentNo = '" + rentAttribute.RentNo + "' order by RRAID desc"; DataTable dt2 = MySQLHelper.ExecuteDataset(SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0]; SMS.CommonServices service = new SMS.CommonServices(); string approveMsg = ConfigurationManager.AppSettings["ApproveMessage"].ToString(); RentInfo info = new RentInfo(rentAttribute.RentNo); service.SendMsg(info.ROwnerTel, approveMsg); CFUserInfo userInfo = new CFUserInfo(info.RIDCard, false); LockManager manager = new LockManager(); manager.SendMessageToDevice(userInfo.DeviceID, approveMsg, dt2.Rows[0]["RRAID"].ToString(), userInfo.IDCard); SysLogHelper.AddLog(rentAttribute.RRACreatedBy, "增加租赁信息ID:" + rentAttribute.RentNo, "增加-租赁信息"); return(dt2.Rows[0]["RRAID"].ToString()); }
public void UpdateCorporation(CorporationInfo corpInfo) { StringBuilder strSql = new StringBuilder(); if (IsExists(corpInfo.CorpID)) { //Update strSql.Append("Update t_corporation set "); strSql.Append(" co_corp_name='" + corpInfo.CorpName + "',co_sort_id='" + corpInfo.SortID + "',co_alias_name='" + corpInfo.AliasName + "',"); strSql.Append(" co_full_name = '" + corpInfo.FullName + "',co_corp_class='" + corpInfo.CorpClass + "',co_type='" + corpInfo.CorpType + "',"); strSql.Append(" co_area_id='" + corpInfo.AreaID.Trim() + "',co_boss='" + corpInfo.BossName + "',co_boss_idcard='" + corpInfo.BossIDCard + "',"); strSql.Append(" co_address='" + corpInfo.Address + "',co_linker='" + corpInfo.Linker + "',co_link_way='" + corpInfo.LinkWay + "', "); strSql.Append(" co_post_code='" + corpInfo.PostCode + "', co_tax_no='" + corpInfo.TaxNo + "',co_account_no='" + corpInfo.AccountNo + "', "); strSql.Append(" co_password='******' ,co_other_no='" + corpInfo.OtherNo + "', co_creator='" + corpInfo.Creator + "',"); strSql.Append(" co_create_date='" + corpInfo.CreateDate.ToString("yyyy-MM-dd hh:mm:ss") + "' ,co_who_cancel='" + corpInfo.Canceller + "',"); if (corpInfo.CancelDate.HasValue) { strSql.Append(" co_cancel_date ='" + corpInfo.CancelDate.Value.ToString() + "',"); } else { strSql.Append(" co_cancel_date = null,"); } strSql.Append(" co_cancel_type='" + corpInfo.CancelType + "' ,co_cancel_reason='" + corpInfo.CancelReason + "',co_status='" + corpInfo.Status + "' ,"); strSql.Append(" co_memo='" + corpInfo.Memo + "' ,co_biz_id='" + corpInfo.BizNo + "'"); strSql.Append(" where co_corp_id = '" + corpInfo.CorpID + "'"); SysLogHelper.AddLog(corpInfo.Creator, "修改企业信息ID:" + corpInfo.CorpID, "修改-企业信息"); } else { //Insert strSql.Append("Insert into t_corporation values ("); strSql.Append("'" + corpInfo.CorpID + "','" + corpInfo.CorpName + "','" + corpInfo.SortID + "','" + corpInfo.AliasName + "','" + corpInfo.FullName + "',"); strSql.Append("'" + corpInfo.CorpClass + "','" + corpInfo.CorpType + "','" + corpInfo.AreaID + "','" + corpInfo.BossName + "','" + corpInfo.BossIDCard + "',"); strSql.Append("'" + corpInfo.Address + "','" + corpInfo.PostCode + "','" + corpInfo.Linker + "','" + corpInfo.LinkWay + "','" + corpInfo.TaxNo + "',"); strSql.Append("'" + corpInfo.AccountNo + "','" + corpInfo.OtherNo + "','" + corpInfo.PassWord + "','" + corpInfo.Creator + "','" + corpInfo.CreateDate.ToString("yyyy-MM-dd hh:mm:ss") + "',"); if (corpInfo.CancelDate.HasValue) { strSql.Append("'" + corpInfo.Canceller + "','" + corpInfo.CancelDate.Value.ToString("yyyy-MM-dd hh:mm:ss") + "',"); } else { strSql.Append("'" + corpInfo.Canceller + "',null,"); } strSql.Append("'" + corpInfo.CancelType + "','" + corpInfo.CancelReason + "','" + corpInfo.Status + "','" + corpInfo.Memo + "','" + corpInfo.BizNo + "'"); strSql.Append(")"); UpdateCorporationID(corpInfo.Region, corpInfo.RegionName); SysLogHelper.AddLog(corpInfo.Creator, "添加企业信息ID:" + corpInfo.CorpID, "添加-企业信息"); } MySQLHelper.ExecuteNonQuery(SqlConnString, MySQLHelper.CreateCommand(strSql.ToString())); }
/// <summary> /// 推送数据到华泽 /// </summary> /// <param name="rraId"></param> /// <param name="rentNo"></param> public void UploadDataToHZ(string rraId, string rentNo) { string uploadHZ = ConfigurationManager.AppSettings["UploadDataToHZ"]; if (uploadHZ.Equals("1")) //upload data to HZ { LogManager.WriteLog("UploadHZ:Start"); string hzUrl = ConfigurationManager.AppSettings["HZDataService"]; HuaZeServiceHelper hzHelper = new HuaZeServiceHelper(); string bbb = hzHelper.UploadRentInfoToHZ(new RentInfo(rentNo), new RentAttribute(int.Parse(rraId))); LogManager.WriteLog("UploadHZ:" + bbb); } SysLogHelper.AddLog("租户", "订单付费", "租赁信息"); }
public void UpdateOrderInfo(string id, string appId, string body, string mchId, string tradeNo, string fee, string prepayId) { StringBuilder strSql = new StringBuilder(); strSql.Append(" Update Rent_RentAttribute set "); strSql.Append(" AppId='" + appId + "',"); strSql.Append(" Body='" + body + "',"); strSql.Append(" MchId='" + mchId + "',"); strSql.Append(" TradeNO='" + tradeNo + "',"); strSql.Append(" TotalFee=" + fee + ","); strSql.Append(" PrepayID='" + prepayId + "'"); strSql.Append(" where RRAID = " + id); SysLogHelper.AddLog("0", "更新租赁订单信息ID:" + id, "修改-租赁信息"); List <SqlCommand> listSQL = new List <SqlCommand>(); listSQL.Add(MySQLHelper.CreateCommand(strSql.ToString())); //listSQL.Add(MySQLHelper.CreateCommand(strSql1.ToString())); MySQLHelper.ExecuteNonQueryTrans(SqlConnString, listSQL); }
public void UpdateRentAttribute(RentAttribute rentAttribute) { StringBuilder strSql = new StringBuilder(); strSql.Append(" Update Rent_RentAttribute set "); strSql.Append(" RRAContactName='" + rentAttribute.RRAContactName + "',"); strSql.Append(" RRAContactTel='" + rentAttribute.RRAContactTel + "',RRANationName='" + rentAttribute.RRANationName + "',"); strSql.Append(" RRAIDCard = '" + rentAttribute.RRAIDCard + "', RRentPrice = '" + rentAttribute.RRentPrice + "',"); strSql.Append(" RRAContactProvince='" + rentAttribute.RRAContactProvince + "',"); strSql.Append(" RRAStartDate='" + rentAttribute.RRAStartDate + "',RRAEndDate='" + rentAttribute.RRAEndDate + "',"); strSql.Append(" RRADescription='" + rentAttribute.RRADescription + "',"); 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); }