// GET: Main public ActionResult Index() { string id = Session["UserId"].ToString(); var user = _service.Get(id); Session["CON_STR"] = ToolsCommon.FromBase64(user.ConnString); return(View(user)); }
//是否已经提货 public static bool IsFined(string userId, string orderId) { var service = new UserService(); var user = service.Get(userId); var sql = $"SELECT State FROM MD_BuyPreConsume WHERE ExchNo = '{orderId}'"; var table = SqlHelper.ExecuteDataTable(sql, ToolsCommon.FromBase64(user.ConnString)); //如果没有预订单,则返回true if (table.Rows.Count == 0) { return(true); } return(table.Rows[0]["State"].ToString() != "0"); }
//是否存现购单和预订单 public static bool IsExistOrder(string userId, string orderId) { //if (string.IsNullOrWhiteSpace(Global.CON_STR)) //{ var service = new UserService(); var user = service.Get(userId); //Global.CON_STR = ToolsCommon.FromBase64(user.ConnString); //} var sql = $" SELECT SUM(COUNT) AS Count FROM (" + $" SELECT COUNT(ExchNo) AS Count FROM MD_BuySaleConsume Where ExchNo = '{orderId}'" + $" UNION ALL" + $" SELECT COUNT(ExchNo) AS Count FROM MD_BuyPreConsume Where ExchNo = '{orderId}'" + $" ) X"; var table = SqlHelper.ExecuteDataTable(sql, ToolsCommon.FromBase64(user.ConnString)); return(table.Rows[0]["Count"].ToString() != "0"); }
public static ProdInfo GetProd(string userId, string prodNo) { var service = new UserService(); var user = service.Get(userId); var table = SqlHelper.ExecuteDataTable($"SELECT TOP 1 ProdNo,ProdName,ProdUnit,CONVERT(FLOAT,Price) AS Price FROM Dict_ProdInfo WHERE State != 1 AND ProdNo = '{prodNo}'", ToolsCommon.FromBase64(user.ConnString)); if (table.Rows.Count == 0) { return(new ProdInfo()); } return(new ProdInfo() { ProdNo = table.Rows[0]["ProdNo"].ToString(), ProdName = table.Rows[0]["ProdName"].ToString(), ProdUnit = table.Rows[0]["ProdUnit"].ToString(), Price = table.Rows[0]["Price"].ToString() }); }
public Bak365Util(string connString) { _sqlUtil = new SqlUtil(ToolsCommon.FromBase64(connString)); }