public string GetName(string Code) { string sql = @"SELECT NAME FROM PUB_EMP WHERE CODE= '" + Code + "'"; string name = sqlDBHelper.GetScalar(sql).ToString(); return(name); }
public string DalMaxParentID(string TYPE) { string sql = @"select max(parentid) from sys_object where type= '" + TYPE + "'"; string FirstValue = sqlDBHelper.GetScalar(sql).ToString(); return(FirstValue); }
public char getTarget(decimal ID) { string sql = @"SELECT TARGET FROM MMIS_BOUT_TYPE WHERE ID = " + ID + ""; char target = Convert.ToChar(sqlDBHelper.GetScalar(sql)); return(target); }
//获取当日最大单据号 public decimal?GetMaxID(string RQ) { string sql = @"select max(ID) from MMIS_BOUT_TEMP_MAIN WHERE ID LIKE '%' || '" + RQ + "' || '%'"; object obj = sqlDBHelper.GetScalar(sql); decimal?maxID; if (obj.Equals(DBNull.Value)) { maxID = 0; } else { maxID = Convert.ToDecimal(obj); } decimal?rq; if (maxID == 0) { rq = Convert.ToDecimal(RQ + "00001"); } else { rq = maxID + 1; } return(rq); }
public decimal?MaxSeq(decimal ID) { string sql = @"SELECT MAX(SEQ) FROM MMIS_BPRICE_TEMP_DETAIL WHERE ID = " + ID + ""; string Value = sqlDBHelper.GetScalar(sql).ToString(); decimal?FirstValue; if (Value == null || Value.Equals(string.Empty)) { FirstValue = 0; } else { FirstValue = decimal.Parse(sqlDBHelper.GetScalar(sql).ToString()); } return(FirstValue); }
public string DalPY(string type, string mark) { string sql = @"select " + type + " from SYSINPUTCODE where HZ= '" + mark + "'"; string FirstValue = sqlDBHelper.GetScalar(sql).ToString(); return(FirstValue); }
/*用户权限管理*/ public string GetPower(string Code) { string sql = @"SELECT POWER FROM PUB_EMP WHERE CODE = " + Code + ""; string power = sqlDBHelper.GetScalar(sql).ToString(); return(power); }
//获取当前账册余额 public string Dalbalance(decimal acc_ID) { string sql = @"select BALANCE FROM MMIS_ACCOUNT_BALANCE WHERE ID = " + acc_ID + ""; object Balance = sqlDBHelper.GetScalar(sql); string balance = Balance.ToString(); return(balance); }
public static User AddUser(User user) { string sql = "INSERT Users" + "(LoginId,LoginPwd,Name,Address,Phone,Mail,UserRoleId,UserStateId,LastOnlineTime,PersonalSynopsis) VALUES" + "(@LoginId,@LoginPwd,@Name,@Address,@Phone,@Mail,@UserRoleId,@UserStateId,@LastOnlineTime,@PersonalSynopsis)"; sql += "; SELECT @@IDENTITY"; SqlParameter[] para = new SqlParameter[] { new SqlParameter("@UserStateId", user.userState.id), new SqlParameter("@UserRoleId", user.userRole.id), new SqlParameter("@LoginId", user.loginId), new SqlParameter("@LoginPwd", user.loginPwd), new SqlParameter("@Name", user.name), new SqlParameter("@Address", user.address), new SqlParameter("@Phone", user.phone), new SqlParameter("@Mail", user.mail), new SqlParameter("@LastOnlineTime", DateTime.Now), new SqlParameter("@PersonalSynopsis", "还没有个性签名哦!") }; int id = SqlDBHelper.GetScalar(sql, para); return(GetUserById(id)); }