Ejemplo n.º 1
0
        /// <summary>
        /// 查询规则
        /// </summary>
        public InterfaceOutPut QueryRule(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 1;
            try
            {
                JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
                InQueryRule          InParams             = javaScriptSerializer.Deserialize <InQueryRule>(Data);
                OutQueryRule         OutParams            = new OutQueryRule();
                output.data = OutParams;
                string         strSql    = "SELECT * from Tab_MealTicket_Rule where strWorkShopGUID = @strWorkShopGUID and iType = @iType";
                SqlParameter[] sqlParams = new SqlParameter[] {
                    new SqlParameter("strWorkShopGUID", InParams.WorkShopGUID),
                    new SqlParameter("iType", InParams.AType)
                };
                DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.ConnString, CommandType.Text, strSql, sqlParams).Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MealTicketRule rule = new MealTicketRule();
                    PS.PSMealTicket.MealTicketRuleFromDB(rule, dt.Rows[i]);
                    OutParams.RuleList.Add(rule);
                }
                output.result = 0;
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                LogClass.log("Interface.QueryRule:" + ex.Message);
                throw ex;
            }
            return(output);
        }
Ejemplo n.º 2
0
 public static void MealTicketRuleFromDB(MealTicketRule Rule, DataRow DR)
 {
     Rule.strName         = DR["strName"].ToString();
     Rule.strGUID         = DR["strGUID"].ToString();
     Rule.strWorkShopGUID = DR["strWorkShopGUID"].ToString();
     Rule.iA    = TFParse.DBToInt(DR["iA"], 0);
     Rule.iB    = TFParse.DBToInt(DR["iB"], 0);
     Rule.iType = TFParse.DBToInt(DR["iType"], 0);
 }