/// <summary> /// 更新一条数据 /// </summary> public void Update(KeyWords model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update KeyWords set "); strSql.Append("WebTitle=@WebTitle,"); strSql.Append("WebKeyWord=@WebKeyWord,"); strSql.Append("description=@description,"); strSql.Append("RoseID=@RoseID,"); strSql.Append("UserName=@UserName"); strSql.Append(" where UserName=@UserName and RoseID =@RoseID"); SqlParameter[] parameters = { new SqlParameter("@WebTitle", SqlDbType.NVarChar), new SqlParameter("@WebKeyWord", SqlDbType.NVarChar), new SqlParameter("@description", SqlDbType.NVarChar), new SqlParameter("@RoseID", SqlDbType.Int,4), new SqlParameter("@UserName", SqlDbType.VarChar, 50) }; parameters[0].Value = model.WebTitle; parameters[1].Value = model.WebKeyWord; parameters[2].Value = model.description; parameters[3].Value = model.RoseID; parameters[4].Value = model.UserName; crm.ExecuteSqls(strSql.ToString(), parameters); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Tz888.Model.dp.SysRoleTab model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update SysRoleTab set "); strSql.Append("SRName=@SRName,"); strSql.Append("SRDoc=@SRDoc,"); strSql.Append("SysCode=@SysCode,"); strSql.Append("SRDate=@SRDate"); strSql.Append(" where SRoleID=@SRoleID "); SqlParameter[] parameters = { new SqlParameter("@SRoleID", SqlDbType.Int, 4), new SqlParameter("@SRName", SqlDbType.VarChar, 100), new SqlParameter("@SRDoc", SqlDbType.VarChar, 200), new SqlParameter("@SysCode", SqlDbType.VarChar, 100), new SqlParameter("@SRDate", SqlDbType.DateTime) }; parameters[0].Value = model.SRoleID; parameters[1].Value = model.SRName; parameters[2].Value = model.SRDoc; parameters[3].Value = model.SysCode; parameters[4].Value = model.SRDate; crm.ExecuteSqls(strSql.ToString(), parameters); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Tz888.Model.dp.SysPermissionTab model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update SysPermissionTab set "); strSql.Append("RoleID=@RoleID,"); strSql.Append("SPCode=@SPCode"); //strSql.Append("SPDate=@SPDate"); strSql.Append(" where SPID=@SPID "); SqlParameter[] parameters = { new SqlParameter("@SPID", SqlDbType.Int, 4), new SqlParameter("@RoleID", SqlDbType.Int, 4), new SqlParameter("@SPCode", SqlDbType.VarChar, 2000) //new SqlParameter("@SPDate", SqlDbType.DateTime) }; parameters[0].Value = model.SPID; parameters[1].Value = model.RoleID; parameters[2].Value = model.SPCode; //parameters[4].Value = model.SPDate; int a = crm.ExecuteSqls(strSql.ToString(), parameters); if (a > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(int sid) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from SysMenuTab "); strSql.Append(" where sid=@sid "); SqlParameter[] parameters = { new SqlParameter("@sid", SqlDbType.Int, 4) }; parameters[0].Value = sid; int a = crm.ExecuteSqls(strSql.ToString(), parameters); if (a > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Tz888.Model.dp.System model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update System set "); strSql.Append("Tem=@Tem"); strSql.Append(" where EmployeeID=@EmployeeID "); SqlParameter[] parameters = { new SqlParameter("@EmployeeID", SqlDbType.NVarChar), new SqlParameter("@Tem", SqlDbType.VarChar, 100) }; parameters[0].Value = model.EmployeeID; parameters[1].Value = model.Tem; if (crm.ExecuteSqls(strSql.ToString(), parameters) > 0) { return(true); } else { return(false); } }
/// <summary> /// 修改展厅信息 /// </summary> /// <param name="model"></param> /// <param name="id"></param> /// <returns></returns> public int ModfiyShow(CompanyShow model, int id) { int num = 0; StringBuilder strSql = new StringBuilder(); strSql.Append("update CompanyShow set "); strSql.Append("UserName=@UserName,"); strSql.Append("UserPwd=@UserPwd,"); strSql.Append("TelPhone=@TelPhone,"); strSql.Append("Mobile=@Mobile,"); strSql.Append("Email=@Email,"); strSql.Append("Audit=@Audit,"); strSql.Append("StartTime=@StartTime,"); strSql.Append("Valid=@Valid,"); strSql.Append("TypeName=@TypeName,"); strSql.Append("Hit=@Hit,"); strSql.Append("RoleId=@RoleId,"); strSql.Append("Countrycode=@Countrycode,"); strSql.Append("Provinceid=@Provinceid,"); strSql.Append("Cityid=@Cityid,"); strSql.Append("Countyid=@Countyid,"); strSql.Append("OrderId=@OrderId,"); strSql.Append("Recomm=@Recomm1"); strSql.Append(" where CompanyID=@CompanyID "); SqlParameter[] parameters = { new SqlParameter("@CompanyID", SqlDbType.Int, 4), new SqlParameter("@UserName", SqlDbType.VarChar, 50), new SqlParameter("@UserPwd", SqlDbType.VarBinary, 50), new SqlParameter("@TelPhone", SqlDbType.VarChar, 50), new SqlParameter("@Mobile", SqlDbType.VarChar, 50), new SqlParameter("@Email", SqlDbType.VarChar, 50), new SqlParameter("@Audit", SqlDbType.Int, 4), new SqlParameter("@StartTime", SqlDbType.DateTime), new SqlParameter("@Valid", SqlDbType.Int, 4), new SqlParameter("@TypeName", SqlDbType.VarChar, 20), new SqlParameter("@Hit", SqlDbType.Int, 4), new SqlParameter("@RoleId", SqlDbType.Int, 4), new SqlParameter("@Countrycode", SqlDbType.VarChar, 20), new SqlParameter("@Provinceid", SqlDbType.VarChar, 20), new SqlParameter("@Cityid", SqlDbType.VarChar, 20), new SqlParameter("@Countyid", SqlDbType.VarChar, 20), new SqlParameter("@OrderId", SqlDbType.Int, 4), new SqlParameter("@Recomm1", SqlDbType.VarChar, 50) }; model.CompanyID = id; parameters[0].Value = model.CompanyID; parameters[1].Value = model.UserName; parameters[2].Value = model.UserPwd; parameters[3].Value = model.TelPhone; parameters[4].Value = model.Mobile; parameters[5].Value = model.Email; parameters[6].Value = model.Audit; parameters[7].Value = model.StartTime; parameters[8].Value = model.Valid; parameters[9].Value = model.TypeName; parameters[10].Value = model.Hit; parameters[11].Value = model.RoleId; parameters[12].Value = model.Countrycode; parameters[13].Value = model.Provinceid; parameters[14].Value = model.Cityid; parameters[15].Value = model.Countyid; parameters[16].Value = model.OrderId; parameters[17].Value = model.Recomm; num = Convert.ToInt32(crm.ExecuteSqls(strSql.ToString(), parameters)); //num = Convert.ToInt32(crm.ExecuteSqls(strSql.ToString(), parameters)); return(num); }