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 ConfirmRentAttribute(string id, string fee, string RRAContactProvince) { //UpdateStatus(id, ((int)RentAttributeHelper.AttributeStatus.NeedPay).ToString()); string sql1 = "update Rent_RentAttribute set rrastatus='" + ((int)RentAttributeHelper.AttributeStatus.NeedPay).ToString() + "',rrentprice='" + fee + "', RRAContactProvince='" + RRAContactProvince + "' where rraid=" + id; MySQLHelper.ExecuteNonQuery(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql1)); string sql = "select * from Rent_RentAttribute where rraid=" + id; DataTable dt = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0]; if (dt.Rows.Count > 0) { SMS.CommonServices service = new SMS.CommonServices(); string approveMsg = ConfigurationManager.AppSettings["NeedPayMessage"].ToString(); service.SendMsg(dt.Rows[0]["RRAContactTel"].ToString(), approveMsg); CFUserInfo userInfo = new CFUserInfo(dt.Rows[0]["RRAIDCard"].ToString(), false); LockManager manager = new LockManager(); manager.SendMessageToDevice(userInfo.DeviceID, approveMsg, id, userInfo.IDCard); } }