Example #1
0
        public InterfaceOutPut GetUserLimit(string Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 1;
            try
            {
                JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
                InGetUserLimit       InParams             = javaScriptSerializer.Deserialize <InGetUserLimit>(Data);
                OutGetUserLimit      userlimitOutput      = new OutGetUserLimit();
                userlimitOutput.SetNameboard = 0;
                NameplateLimit limit = new NameplateLimit();
                if (LCNameplateLimit.GetUserLimit(InParams.UserNumber, limit))
                {
                    userlimitOutput.SetNameboard = limit.SetNameboard;
                }
                output.data   = userlimitOutput;
                output.result = 0;
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                TF.CommonUtility.LogClass.log("Interface.GetPrepareTrainmans:" + ex.Message);
                throw ex;
            }
            return(output);
        }
        public static bool GetUserLimit(string UserNumber, NameplateLimit Limit)
        {
            string strSql =
                "select * from TAB_Nameplate_TrainmanJiaolu_UserLimit where UserNumber = @UserNumber";

            SqlParameter[] sqlParams = new SqlParameter[] {
                new SqlParameter("UserNumber", UserNumber)
            };

            DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams).Tables[0];

            if (dt.Rows.Count > 0)
            {
                Limit.UserName     = TF.Utils.TFConvert.DBToString(dt.Rows[0]["UserName"], "");
                Limit.UserNumber   = TF.Utils.TFConvert.DBToString(dt.Rows[0]["UserNumber"], "");
                Limit.SetNameboard = TF.Utils.TFConvert.DBToInt(dt.Rows[0]["SetNameboard"], 0);
                return(true);
            }
            return(false);
        }
 public static bool GetUserLimit(string UserNumber, NameplateLimit Limit)
 {
     return(DBNameplateLimit.GetUserLimit(UserNumber, Limit));
 }