protected void btnRegister_Click(object sender, EventArgs e) { SignetInternet_BusinessLayer.UserInfoHelper helper = new SignetInternet_BusinessLayer.UserInfoHelper(); SignetInternet_BusinessLayer.CFUserInfo info = new SignetInternet_BusinessLayer.CFUserInfo(txtUserId.Text); if (!string.IsNullOrEmpty(info.LoginName)) { ScriptManager.RegisterStartupScript(btnRegister, btnRegister.GetType(), "error", "$.ligerDialog.warn('相同的用户名已经存在,请重新输入!');", true); } else { if (helper.IsExistsSamePhone(txtPhone.Text)) { ScriptManager.RegisterStartupScript(btnRegister, btnRegister.GetType(), "error", "$.ligerDialog.warn('相同的电话号码已经注册,无法使用该电话号码注册!');", true); } else { helper.AddUserInfo(txtUserId.Text, txtPassword.Text, txtName.Text, rblSex.SelectedValue, txtPhone.Text, txtIdCard.Text); bool ret = SystemService.UserLogin(txtUserId.Text, txtPassword.Text); if (ret) { Response.Redirect("index.aspx"); } } } }
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 AddUserInfo(string loginName, string password, string realName, string sex, string phone, string idcard) { RentInfoHelper helper = new RentInfoHelper(); string tempPass = Encrypt.DESEncrypt(password); Dictionary <string, string> ret = new Dictionary <string, string>(); try { helper.GetJSONInfo("insert into cf_user values ('" + loginName + "','" + tempPass + "','','0','','" + realName + "','','" + sex + "','" + phone + "','','','" + idcard + "','','','" + DateTime.Now.ToString() + "',0,'" + DateTime.Now.ToString() + "',0,'" + DateTime.Now.ToString() + "','0')"); //添加默认权限 UserInfoHelper userhelper = new UserInfoHelper(); CFUserInfo info = new CFUserInfo(loginName); userhelper.InsertUserRole(info.UserID.ToString(), "20"); } catch (Exception ex) { } }
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); } }