Exemplo n.º 1
0
        public static bool Verify(string code, out Clamp outClamp, out string msg)
        {
            try
            {
                List <Clamp> list = GetList(string.Format("SELECT * FROM [dbo].[{0}] WHERE [Code] = '{1}'", TableName, code), out msg);
                if (list.Count() > 0)
                {
                    outClamp = list[0];
                    msg      = string.Empty;
                    return(true);
                }
                msg = "用户名或密码错误";
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }

            outClamp = null;
            return(false);
        }
Exemplo n.º 2
0
 public static bool Update(Clamp newClamp, out string msg)
 {
     return(Database.NonQuery(string.Format("UPDATE [dbo].[{0}] SET [BindTime] = '{1}' WHERE [Id] = {2}", TableName, newClamp.BindTime, newClamp.Id), out msg));
 }
Exemplo n.º 3
0
 public static int Add(Clamp addClamp, out string msg)
 {
     return(Database.Insert(string.Format("INSERT INTO [dbo].[{0}] ([Code], [UserId], [StationId], [BindTime]) VALUES ('{1}', {2}, '{3}', GETDATE())", TableName, addClamp.Code, TengDa.WF.Current.user.Id, addClamp.StationId), out msg));
 }