/// <summary> /// 获得客户信息 /// </summary> /// <param name="mobile"></param> /// <param name="address"></param> /// <returns></returns> public CustomerModel getCustomerModel(string mobile, string address) { CustomerModel model = new CustomerModel(); string strSql = "select * from BM_CustomerManage where (Addr=@Addr or Mobile=@Mobile) and IsDel=0 and Status in(1,3,4,5)"; var parms = new[] { new SqlParameter("@Addr", address), new SqlParameter("@Mobile", mobile) }; using (IDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parms)) { model = DbHelperSQLP.GetEntity <CustomerModel>(dr); } return(model); }
/// <summary> /// 获得客户信息 /// </summary> /// <param name="mobile"></param> /// <param name="address"></param> /// <returns></returns> public CustomerModel getCustomerModel(int cid) { //审核状态 1已同意 2已拒绝 3未生成订单 4已生成订单,5已失效 CustomerModel model = new CustomerModel(); string strSql = "select * from BM_CustomerManage where ID=@ID and IsDel=0 and Status in(1,3,4,5)"; var parms = new[] { new SqlParameter("@ID", cid) }; using (IDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parms)) { model = DbHelperSQLP.GetEntity <CustomerModel>(dr); } return(model); }
public static DataSet frmXSKHQKreportDO(string BegDate) { DataSet ds = new DataSet(); SqlParameter[] parameters = { new SqlParameter("@FBeginDate", SqlDbType.VarChar, 50) }; parameters[0].Value = BegDate; DbHelperSQLP DbHelperSQLP = new DbHelperSQLP(PubConstant.GetConnectionString("ConnectionString_RZP")); ds = DbHelperSQLP.RunProcedure("sp_DzpChuiKuanBiao_czq_2018_qiu", parameters, "test"); return(ds); }
/// <summary> /// 修改现金券 /// </summary> /// <param name="model">The model.</param> /// <returns>true if XXXX, false otherwise.</returns> /// <exception cref="System.NotImplementedException"></exception> public bool UpdateCashCoupon(CashCouponModel model) { string strSql = "update BM_CashCoupon set Title=@Title,Money=@Money,StartTime=@StartTime,EndTime=@EndTime,IsEnable=@IsEnable,Remark=@Remark where CouponId=@CouponId"; var parm = new[] { new SqlParameter("@Title", model.Title), new SqlParameter("@Money", model.Money), new SqlParameter("@StartTime", model.StartTime), new SqlParameter("@EndTime", model.EndTime), new SqlParameter("@IsEnable", model.IsEnable), new SqlParameter("@CouponId", model.CouponId), new SqlParameter("@Remark", model.Remark) }; return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parm) > 0); }
//得到道具名称 public string GetItemName(string value) { try { DbHelperSQLP spg = new DbHelperSQLP(); spg.connectionString = ConnStrDigGameDB; string sql = @"SELECT ( F_Vocation + ' ' + F_EquipType +' '+ F_StarLevel + ' ' + ' ' + F_Level + ' ' + F_SuitName) as F_Name FROM T_BaseGameItem WHERE (F_ExcelID = " + value + ") "; return(value + "." + spg.GetSingle(sql).ToString()); } catch (System.Exception ex) { return(value); } }
//得到文本名称 public string GetTextName(string value) { try { DbHelperSQLP spg = new DbHelperSQLP(); spg.connectionString = ConnStrDigGameDB; string sql = @"SELECT top 1 F_Name FROM T_BaseGameName WHERE (F_ExcelID = " + value + ") "; return(spg.GetSingle(sql).ToString()); } catch (System.Exception ex) { return(value); } }
//得到角色名称 public static string GetRoleName(string bigzone, string value) { try { DbHelperSQLP spg = new DbHelperSQLP(); spg.connectionString = ConnStrDigGameDB; string sql = @"SELECT F_RoleName FROM T_BaseRoleCreate WHERE (F_BigZoneID = 1) AND (F_RoleID = 2) " + value + ") "; return(string.Format("({0}){1}", value, spg.GetSingle(sql))); } catch (System.Exception ex) { return(value); } }
/// <summary> /// 根据用户ID和优惠券ID,获取优惠券记录ID /// </summary> /// <param name="userId">The user identifier.</param> /// <param name="couponId">The coupon identifier.</param> /// <returns>System.Int32.</returns> public CashCouponLogModel GetCashCouponLogIDByUserID(int userId, int couponId) { string strSql = @"select top 1 L.*,C.Remark from BM_GetCashCouponLog L left join BM_CashCoupon C on C.CouponId=L.CouponId where L.UserId=@UserId and L.CouponId=@CouponId and L.IsGet=0 and L.IsShare=1 and L.IsDel=0"; var param = new[] { new SqlParameter("@UserId", userId), new SqlParameter("@CouponId", couponId) }; using (IDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, strSql, param)) { return(DbHelperSQLP.GetEntity <CashCouponLogModel>(dr)); } }
//得到角色名称 public string GetRoleName(string bigzone, string roleid) { try { DbHelperSQLP spg = new DbHelperSQLP(); spg.connectionString = ConnStrDigGameDB; string sql = @"SELECT F_RoleName FROM T_BaseRoleCreate with(nolock) WHERE (F_BigZoneID =" + bigzone + ") AND (F_RoleID = " + roleid + ") "; return(string.Format("({0}) {1}", roleid, spg.GetSingle(sql))); } catch (System.Exception ex) { return(roleid); } }
/// <summary> /// 获得现金卷列表 /// </summary> /// <param name="shopId"></param> /// <returns></returns> public List <CashCouponModel> getEnabledCashCouponList(int shopId) { List <CashCouponModel> list = new List <CashCouponModel>(); string strSql = "select * from BM_CashCoupon where ShopId=@ShopId and EndTime>@Date and IsEnable=1 and IsDel=0 order by CouponId desc"; var parms = new[] { new SqlParameter("@ShopId", shopId), new SqlParameter("@Date", DateTime.Now) }; using (IDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, strSql, parms)) { list = DbHelperSQLP.GetEntityList <CashCouponModel>(dr); } return(list); }
//得到文本名称 public string GetTextName(string value) { try { DbHelperSQLP spg = new DbHelperSQLP(); spg.connectionString = ConnStrDigGameDB; string sql = @"SELECT ( cast(F_ExcelID as varchar(9)) +' '+F_Name+' '+F_Type+' '+F_TypeP ) as F_Name FROM T_BaseGameName with(nolock) WHERE (F_ExcelID = " + value + ") "; return(spg.GetSingle(sql).ToString()); } catch (System.Exception ex) { return(value); } }
/// <summary> /// 获取优惠卷信息 /// </summary> /// <param name="mobile"></param> /// <param name="cashNo"></param> /// <returns></returns> public CashCouponLogModel getEnableCashCouponLogModel(string mobile, string cashNo) { CashCouponLogModel model = new CashCouponLogModel(); string strSql = "select * from BM_GetCashCouponLog where CouponNo=@CouponNo and Mobile=@Mobile and IsGet=1 and IsDel=0 "; var parms = new[] { new SqlParameter("@CouponNo", cashNo), new SqlParameter("@Mobile", mobile) }; using (IDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parms)) { model = DbHelperSQLP.GetEntity <CashCouponLogModel>(dr); } return(model); }
//得到角色名称 public string GetRoleName(string value) { try { DbHelperSQLP spg = new DbHelperSQLP(); spg.connectionString = ConnStrDigGameDB; string sql = @"SELECT F_RoleName FROM T_BaseRoleCreate with(nolock) where F_RoleID=" + value + ""; return(spg.GetSingle(sql).ToString()); } catch (System.Exception ex) { return(value); } }
/// <summary> /// 获取来源表体数据 /// </summary> /// <param name="dt"></param> /// <param name="pdt"></param> /// <param name="apidata"></param> /// <returns></returns> public override System.Data.DataSet SetFromTabets(Model.Synergismlogdt dt, Model.Synergismlogdt pdt, Model.APIData apidata) { ApiService.DAL.TaskLog.ITaskLogDetail dtdal = ClassFactory.GetITaskLogDetailDAL(apidata.TaskType); //ClassFactory.GetITaskLogMain(3);; Model.ConnectInfo cimodel = dtdal.GetConnectInfo(pdt); string sql = "select b.*,lt.cWhCode as cWhCode,lb.iquantity as iquantity,lt.cRdCode as cCode "; sql += " from v_mom_orderdetail_wf b with(nolock) left join v_mom_order_wf t with(nolock) on b.moid = t.moid left join " + bodytable + " lb with(nolock) on lb.mocode = t.mocode left join " + headtable + " lt with(nolock) on lt.id = lb.id where lt.id =" + U8.Interface.Bus.Comm.Convert.ConvertDbValueFromPro(pdt.Id, "string") + " "; DbHelperSQLP help = new DbHelperSQLP(cimodel.Constring); DataSet ds = help.Query(sql); ApiService.BLL.Common.ErrorMsg(ds, "未能获取其他入库单表体信息"); return(ds); }
/// <summary> /// 生成银行订单 /// </summary> /// <param name="merId">商户号</param> /// <param name="orderId">订单ID</param> /// <param name="txnTime">订单开始时间</param> /// <param name="total_fee">总金额分</param> /// <param name="R">是否成功生成订单</param> /// <returns></returns> public string GenerateBankOrder(string CommunityId, string out_trade_no, string txnTime, string total_fee, ref bool R, ref string prepay_str) { DataTable CommunityTable = new DbHelperSQLP(PubConstant.GetConnectionString("APPConnection")).Query("SELECT * FROM Tb_HSPR_Community WHERE CommID='" + CommunityId.ToString() + "'").Tables[0]; Dictionary <string, string> sPara = new Dictionary <string, string>(); sPara.Add("partner", c.partner.ToString()); sPara.Add("seller_id", c.seller_id.ToString()); sPara.Add("out_trade_no", out_trade_no.ToString()); if (CommunityTable != null && CommunityTable.Columns.Contains("CommName") && CommunityTable.Rows.Count > 0) { sPara.Add("subject", CommunityTable.Rows[0]["CommName"].ToString() + "-物管费用"); } else { sPara.Add("subject", "物管费用"); } sPara.Add("body", CommunityId); sPara.Add("total_fee", total_fee.ToString()); sPara.Add("notify_url", c.notify_url.ToString()); sPara.Add("service", c.service.ToString()); sPara.Add("payment_type", c.payment_type.ToString()); //支付类型 sPara.Add("_input_charset", c.input_charset.ToString()); //参数编码字符集 sPara.Add("it_b_pay", "30m"); //未付款交易的超时时间 //将获取的订单信息,按照“参数=参数值”的模式用“&”字符拼接成字符串. string data = Core.CreateLinkString(sPara); //使用商户的私钥进行RSA签名,并且把sign做一次urleccode. string sign = System.Web.HttpUtility.UrlEncode(RSA.sign(data, c.private_key, c.input_charset)); sPara.Add("sign", sign); //签名 sPara.Add("sign_type", c.sign_type); //签名方式 //拼接请求字符串(注意:不要忘记参数值的引号). data = data + "&sign=\"" + sign + "\"&sign_type=\"" + c.sign_type + "\""; log.Info("支付宝订单请求:" + data.ToString()); //返回给客户端请求. //prepay_str = data; prepay_str = JSONHelper.FromObject(sPara); R = true; return("success"); }
public static DataTable HSPR_BillUse_GetBillsSignUseRange(int CommID, string UserCode, string UseRange) { SqlParameter[] parameters = { new SqlParameter("@CommID", SqlDbType.Int), new SqlParameter("@UserCode", SqlDbType.VarChar), new SqlParameter("@UseRange", SqlDbType.VarChar), }; parameters[0].Value = CommID; parameters[1].Value = UserCode; parameters[2].Value = UseRange; DataSet Ds = new DbHelperSQLP(ConnectionString).RunProcedure("Proc_HSPR_BillUse_GetBillsSignUseRange", parameters, "Ds"); return(Ds.Tables[0]); }
/// <summary> /// 修改密码 /// </summary> /// <param name="userId">The user identifier.</param> /// <param name="oldPassword">The old password.</param> /// <param name="password">The password.</param> /// <returns>true if XXXX, false otherwise.</returns> public bool ChanagePassword(int userId, int useridentity, string oldPassword, string password) { string strSql = "update BM_Manager set LoginPassword=@NewLoginPassword where ID=@ID and LoginPassword=@OldLoginPassword"; if (useridentity != 0) { strSql = "update BM_ShopManage set LoginPassword=@NewLoginPassword where ShopID=@ID and LoginPassword=@OldLoginPassword"; } SqlParameter[] param = { new SqlParameter("@NewLoginPassword", EncryptHelper.MD5(password)), new SqlParameter("@ID", userId), new SqlParameter("@OldLoginPassword", EncryptHelper.MD5(oldPassword)) }; return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0); }
/// <summary> /// 根据盟友ID,获取盟友的现金券列表 /// </summary> /// <param name="userId">The user identifier.</param> /// <returns>List<CashCouponModel>.</returns> public List <CashCouponModel> GetEnableCashCouponListByUserId(int userId) { string strSql = @"select g.CouponId as CouponId,c.Title,g.CouponNo,g.StartTime,g.EndTime,g.Money from BM_GetCashCouponLog g left join BM_CashCoupon c on c.CouponId = g.CouponId where c.IsEnable = 1 and g.UserId =@UserId and g.EndTime>@Date and isShare=0 and c.IsDel=0 order by g.ID desc"; var parms = new[] { new SqlParameter("@UserId", userId), new SqlParameter("@Date", DateTime.Now) }; using (IDataReader dr = DbHelperSQLP.ExecuteReader(WebConfig.getConnectionString(), CommandType.Text, strSql, parms)) { return(DbHelperSQLP.GetEntityList <CashCouponModel>(dr)); } }
public static DataSet frmBTpfskDO(string fDate, string syy) { DataSet ds = new DataSet(); SqlParameter[] parameters = { new SqlParameter("@fdate", SqlDbType.VarChar, 50), new SqlParameter("@syy", SqlDbType.VarChar, 50) }; parameters[0].Value = fDate; parameters[1].Value = syy; DbHelperSQLP DbHelperSQLP = new DbHelperSQLP(PubConstant.GetConnectionString("ConnectionString_ERP")); ds = DbHelperSQLP.RunProcedure("frmbtskb", parameters, "test"); return(ds); }
/// <summary> /// 获取最小商城等级 /// 作者:郭孟稳 /// </summary> /// <param name="customerid"></param> /// <param name="type"></param> /// <returns></returns> public int GetMinLevelID(int customerid, int type) { StringBuilder sql = new StringBuilder(); sql.AppendFormat("SELECT TOP 1 UL_ID FROM Mall_UserLevel WHERE UL_CustomerID={0} order by UL_Level", customerid); object obj = DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, sql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 获取来源表头数据 /// </summary> /// <param name="dt"></param> /// <param name="pdt"></param> /// <param name="apidata"></param> /// <returns></returns> public override System.Data.DataSet SetFromTabet(Model.Synergismlogdt dt, Model.Synergismlogdt pdt, Model.APIData apidata) { ApiService.DAL.TaskLog.ITaskLogDetail dtdal = ClassFactory.GetITaskLogDetailDAL(apidata.TaskType); Model.ConnectInfo cimodel = dtdal.GetConnectInfo(pdt); string sql = "select t.*,lt.cWhCode as cWhCode ,lt.cRdCode as cCode "; sql += ",'" + System.DateTime.Now.ToString(SysInfo.dateFormat) + "' as ddate "; sql += ",'生产订单' as cSource "; sql += " from v_mom_order_wf t with(nolock) left join " + bodytable + " lb with(nolock) on lb.mocode = t.mocode left join " + headtable + " lt with(nolock) on lt.id = lb.id where lt.id ='" + pdt.Id + "' "; DbHelperSQLP help = new DbHelperSQLP(cimodel.Constring); DataSet ds = help.Query(sql); ApiService.BLL.Common.ErrorMsg(ds, "未能获取生产订单表头信息"); return(ds); }
private static DataSet GetDispatchLists(string code, string constring) { string sql = "select * from Sales_FHD_W with(nolock) where DLID=(select DLID from DispatchList with(nolock) where cdlcode='" + code + "' and cvouchtype = '05' )"; DbHelperSQLP help = new DbHelperSQLP(constring); DataSet ds = help.Query(sql); if (code.ToLower().Equals("03")) //added by liuxzha 2014.11.27 { BLL.Common.ErrorMsg(ds, "未能获取发货单表体信息"); } else { BLL.Common.ErrorMsg(ds, "未能获取发货单表体信息"); } return(ds); }
public static DataSet frmKHQKBAQJreportNew(DateTime BegDate, DateTime EndDate) { DataSet ds = new DataSet(); SqlParameter[] parameters = { new SqlParameter("@begindate", SqlDbType.DateTime, 50), new SqlParameter("@enddate", SqlDbType.DateTime, 50) }; parameters[0].Value = BegDate; parameters[1].Value = EndDate; DbHelperSQLP DbHelperSQLP = new DbHelperSQLP(PubConstant.GetConnectionString("ConnectionString_RZP")); ds = DbHelperSQLP.RunProcedure("sp_getICCredit_new_qiu", parameters, "test"); return(ds); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(string orderId, int status) { StringBuilder strSql = new StringBuilder(); strSql.Append("update BM_Orders set "); strSql.Append(" OrderStatus=@OrderStatus,FinishedTime=@FinishedTime"); strSql.Append(" where orderId=@orderId "); SqlParameter[] parameters = { new SqlParameter("@OrderStatus", status), new SqlParameter("@FinishedTime", DateTime.Now), new SqlParameter("@orderId", orderId) }; return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql.ToString(), parameters)); }
//获取报事信息 private string GetIncidentInfo_RongXin(DataRow row) { if (!row.Table.Columns.Contains("CustID") || string.IsNullOrEmpty(row["CustID"].ToString())) { return(JSONHelper.FromString(false, "业主ID不能为空")); } string sql = ""; sql += "select i.CustID,i.IncidentID,RoomSign,IncidentDate,IncidentMan,IncidentContent,DispTypeState,DispDate,State,MainEndDate,ISNULL(f.DueAmount,0) IncidnetAmount"; sql += " from view_HSPR_IncidentSeach_Filter i left join Tb_HSPR_Fees f on i.CommID=f.CommID and i.IncidentID=f.IncidentID"; sql += " where ISNULL(i.IsDelete,0)=0 and i.CustID=" + row["CustID"].ToString(); DataSet ds = new DbHelperSQLP(ConnStrRX).Query(sql.ToString()); return(JSONHelper.FromString(ds.Tables[0])); }
/// <summary> /// 设置通用变量 /// </summary> /// <param name="apidata"></param> /// <param name="dt"></param> public static void SetNormalValue(Model.APIData apidata, Model.Synergismlogdt dt) { string vt_id = "vt_id"; Model.U8NameValue nv = DAL.Common.U8NameValueFind(apidata.HeadData, vt_id); if (nv != null) { if (string.IsNullOrEmpty(nv.U8FieldValue)) { DbHelperSQLP help = new DbHelperSQLP(apidata.ConnectInfo.Constring); string sql = string.Format("select def_id from vouchers_base with(nolock) where CardNumber='{0}'", dt.Cvouchertype); nv.U8FieldValue = help.GetSingle(sql).NullToString(); } } string iinvexchrate = "iinvexchrate"; if (apidata.SfcBodyData != null && apidata.SfcBodyData.Count > 0) { foreach (Model.BodyRow sfcrow in apidata.SfcBodyData) { Model.U8NameValue nv_iinvexchrate = DAL.Common.U8NameValueFind(sfcrow.BodyCols, iinvexchrate); if (nv_iinvexchrate != null) { if (string.IsNullOrEmpty(nv_iinvexchrate.U8FieldValue)) { nv_iinvexchrate.U8FieldValue = "0"; } } } } else { foreach (List <Model.U8NameValue> list in apidata.BodyData) { Model.U8NameValue nv_iinvexchrate = DAL.Common.U8NameValueFind(list, iinvexchrate); if (nv_iinvexchrate != null) { if (string.IsNullOrEmpty(nv_iinvexchrate.U8FieldValue)) { nv_iinvexchrate.U8FieldValue = "0"; } } } } }
private string GetWaitWorkCount_Business(DataRow Row) { string Result = JSONHelper.FromString(false, "未知错误!");; string strSQL = " and UserCode = '" + Row["UserCode"].ToString() + "' "; SqlParameter[] parameters = { new SqlParameter("@SQLEx", SqlDbType.VarChar) }; parameters[0].Value = strSQL; DataTable dTable = new DbHelperSQLP(PubConstant.hmWyglConnectionString.ToString()).RunProcedure("Proc_Sys_TakePicWork_Filter", parameters, "RetDataSet").Tables[0]; bool temp = false; if (dTable.Columns.Contains("Counts")) { temp = true; } int Total = 0; foreach (DataRow DRow in dTable.Rows) { if (temp) { Total = Total + AppGlobal.StrToInt(DRow["Counts"].ToString()); continue; } Total = Total + AppGlobal.StrToInt(DRow["InsBatchFeesCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["InsOneFeesCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["OffsetPrecCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["WaivCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["ReceCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["RefundCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["PrecRefundCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["LeaseContCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["ContCount"].ToString()); Total = Total + AppGlobal.StrToInt(DRow["RoomStateCount"].ToString()); } Result = Total.ToString(); return(JSONHelper.FromString(true, Result)); }
public string GetBattleLines()//得到单条线列表 { JSONHelper json = new JSONHelper(); if (VerirySecurityIP(GetIP4Address())) { json.success = false; json.error = msgNoSafe + Context.Request.UserHostAddress + "<>" + GSSServerIP + ""; Log.Warn(json.error); return(json.ToString()); } try { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT F_NGSID, F_Name, F_ZoneID, F_MaxUser, F_Ip, F_Port,F_Main_State, F_Sub_State, F_DBISID, F_PingPort"); strSql.Append(" FROM T_BattleLine WITH(NOLOCK) "); DbHelperSQLP sp = new DbHelperSQLP(); sp.connectionString = ConnStrGameCoreDB; DataSet ds = sp.Query(strSql.ToString()); json.success = true; foreach (DataRow dr in ds.Tables[0].Rows) { json.AddItem("F_NGSID", dr["F_NGSID"].ToString()); json.AddItem("F_Name", dr["F_Name"].ToString().Trim()); json.AddItem("F_ZoneID", dr["F_ZoneID"].ToString()); json.AddItem("F_MaxUser", dr["F_MaxUser"].ToString()); json.AddItem("F_Ip", dr["F_Ip"].ToString().Trim()); json.AddItem("F_Port", dr["F_Port"].ToString()); json.AddItem("F_Main_State", dr["F_Main_State"].ToString()); json.AddItem("F_Sub_State", dr["F_Sub_State"].ToString()); json.AddItem("F_DBISID", dr["F_DBISID"].ToString()); json.AddItem("F_PingPort", dr["F_PingPort"].ToString()); json.ItemOk(); } json.totlalCount = ds.Tables[0].Rows.Count; return(json.ToString()); } catch (System.Exception ex) { Log.Warn("GetBattleLines", ex); json.success = false; json.error = msgWSVError + ex.Message + ""; return(json.ToString()); } }
public void Send() { Bll.Sms_outbox bll = new Bll.Sms_outbox(); Bll.BIF01022 bll2 = new Bll.BIF01022(); string phone = "", Name = "", AddTime = ""; string _add_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string dsNow = DateTime.Now.ToString("yyyy-MM-dd"); //string dsNow = "2019-12-30"; DbHelperSQLP db = new DbHelperSQLP(PubConstant.GetConnectionString("ConnectionStringOnline")); string sql = "select name, tel,addTime from Smoke where datediff(day, dateadd(dd,0,addTime),getdate())=1 and tel!=''"; DataSet ds = db.Query(sql); if (ds != null && ds.Tables[0].Rows.Count != 0) { DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { AddTime = dr["addTime"] + ""; Name = dr["name"] + ""; phone = dr["tel"] + ""; //phone = "15261277153"; Model.Sms_outbox model = new Model.Sms_outbox(); model.sismsid = Guid.NewGuid().ToString(); model.extcode = "01"; model.destaddr = phone; model.messagecontent = "5272718510019"; model.reqdeliveryreport = 1; model.msgfmt = 15; model.sendmethod = 2; model.requesttime = _add_time; model.applicationid = "APP128"; if (bll.Add(model)) { Model.BIF01022 model2 = new Model.BIF01022(); model2.Patient_id = Name; model2.Patient_name = Name; model2.Item_name = Name; model2.Current_result = AddTime; model2.EmpMobileNum = phone; model2.EMPNAME = "戒烟"; model2.State = 12; model2.Add_time = _add_time; bll2.Add(model2); } } } }
/// <summary> /// 更新焦点广告图 /// </summary> /// <param name="model">The model.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> /// <exception cref="System.NotImplementedException"></exception> public bool UpdateFocusPic(FocusPicModel model) { string strSql = @"update BM_BannerManage set Title = @Title,PicUrl = @PicUrl,Description = @Description,IsEnable = @IsEnable,Sort = @Sort,LinkUrl = @LinkUrl where ID = @ID"; var param = new[] { new SqlParameter("@Title", model.Title), new SqlParameter("@PicUrl", model.PicUrl), new SqlParameter("@Description", model.Description), new SqlParameter("@IsEnable", model.IsEnable), new SqlParameter("@Sort", model.Sort), new SqlParameter("@LinkUrl", model.LinkUrl), new SqlParameter("@ID", model.ID) }; return(DbHelperSQLP.ExecuteNonQuery(WebConfig.getConnectionString(), CommandType.Text, strSql, param) > 0); }