/// <summary> /// 更新数据目录 /// </summary> /// <param name="json"></param> /// <param name="proc"></param> /// <returns></returns> protected string GetReturnJsonInt(string json, string proc, string userId, string entid) { SqlParameter[] param = (JsonMethod.ListParameter(json, userId, entid)).ToArray();//动态解析json参数 SqlRun sql = new SqlRun(SqlRun.sqlstr); int n = sql.ExecuteNonQuery(proc, param); string r_json; string msg; if (n > 0) { msg = "更新成功"; r_json = JsonMethod.GetError(0, msg); } else { msg = "更新失败!"; r_json = JsonMethod.GetError(1, msg); } return(r_json); }
/// <summary> /// 活动绑定上架 /// </summary> /// <param name="templateCode"></param> /// <param name="status"></param> /// <returns></returns> protected string SetTemplateRelationStatu(string templateRelationCode, string status) { string r_json = ""; SqlRun sql = new SqlRun(SqlRun.sqlstr); int num = sql.ExecuteNonQuery("Pc_TemplateRelation", new SqlParameter[] { new SqlParameter("@type", "PC_UpTemplateRelationStatus"), new SqlParameter("@TemplateRelationCode", templateRelationCode), new SqlParameter("@Status", status) }); if (num > 0) { r_json = JsonMethod.GetError(0, "成功"); } else { string error = "无数据"; r_json = JsonMethod.GetError(1, error); } return(r_json); }
/// <summary> /// 保存注册信息 /// </summary> /// <param name="entId">机构</param> /// <param name="businessName">单位</param> /// <param name="telphone">电话</param> /// <param name="clinettype">客户类型</param> /// <param name="address">地址</param> /// <param name="birthday">生日</param> /// <param name="email">邮件</param> /// <param name="password">密码</param> /// <param name="name">姓名</param> /// <param name="flag"></param> /// <returns></returns> public string SaveUserInfo(string entId, string businessName, string clinettype, string telphone, string sex, string email, string password, string name, string province, string city, string prefecture, string address, string birthday, string material, out bool flag) { try { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@type", "Registered"), new SqlParameter("@entId", entId), new SqlParameter("@password", password), new SqlParameter("@sex", sex), new SqlParameter("@birthday", birthday), new SqlParameter("@telphone", telphone), new SqlParameter("@email", email), new SqlParameter("@province", province), new SqlParameter("@city", city), new SqlParameter("@prefecture", prefecture), new SqlParameter("@address", address), new SqlParameter("@businessname", businessName), new SqlParameter("@clinettype", clinettype), new SqlParameter("@name", name), new SqlParameter("@material", material) }; SqlRun sql = new SqlRun(SqlRun.sqlstr); int number = sql.ExecuteNonQuery("Proc_OperationUser", parameters); if (number > 0) { flag = true; return("账号注册成功,请等待审核!"); } else { flag = false; return("账号注册失败,请重新注册!"); } } catch (Exception ex) { flag = false; return(ex.Message.ToString()); } }
/// <summary> /// 新增充值记录 /// </summary> /// <param name="userId">充值用户</param> /// <param name="entId">充值机构</param> /// <param name="orderNo">充值订单号</param> /// <param name="goodId">订单商品</param> /// <param name="fee">订单金额</param> /// <param name="remark">订单备注</param> /// <param name="payment">支付方式</param> /// <param name="operation">操作 0【退款】 1【充值】</param> /// <param name="appId">合作伙伴ID</param> /// <param name="ruleId">充值规则</param> /// <param name="message"></param> /// <returns></returns> public bool IncreaseRecharge(string userId, string entId, string orderNo, string goodId, decimal fee, string remark, string payment, int operation, string appId, string ruleId, int rechargeType, out string message) { try { message = ""; SqlParameter[] sqls = new SqlParameter[] { new SqlParameter("@type", "IncreaseRecharge"), new SqlParameter("@orderNo", orderNo), new SqlParameter("@goodId", goodId), new SqlParameter("@ruleId", ruleId), new SqlParameter("@fee", fee), new SqlParameter("@userId", userId), new SqlParameter("@entId", entId), new SqlParameter("@remark", remark), new SqlParameter("@payment", payment), new SqlParameter("@operation", operation), new SqlParameter("@appId", appId), new SqlParameter("@rechargeType", rechargeType) }; SqlRun sql = new SqlRun(SqlRun.sqlstr); int number = sql.ExecuteNonQuery("Proc_OperationRecharge", sqls); if (number > 0) { message = "商城充值下单成功!"; return(true); } else { message = "商城充值下单失败!"; return(false); } } catch (Exception ex) { LogQueue.Write(LogType.Error, "Recharge/RechargeDal", ex.Message.ToString()); message = ex.Message.ToString(); return(false); } }
/// <summary> /// 保存模板绑定 /// </summary> /// <param name="title"></param> /// <param name="newsType"></param> /// <param name="sortId"></param> /// <param name="dates"></param> /// <param name="content"></param> /// <returns></returns> protected string SaveTemplateRelation(string promotioncode, string templatecode, string categorycode, int txtType, string templateimg, int sort_id, string id) { SqlRun sql = new SqlRun(SqlRun.sqlstr); int num = sql.ExecuteNonQuery("Pc_TemplateRelation", new SqlParameter[] { new SqlParameter("@type", "PC_AddTemplateRelation"), new SqlParameter("@PromotionCode", promotioncode), new SqlParameter("@TemplateCode", templatecode), new SqlParameter("@CategoryCode", categorycode), new SqlParameter("@TypeCode", txtType), new SqlParameter("@TemplateImg", templateimg), new SqlParameter("@Sort_id", sort_id), new SqlParameter("@strWhere", id), }); if (num > 0) { return(JsonMethod.GetError(0, "操作成功")); } else { return(JsonMethod.GetError(1, "操作失败")); } }
/// <summary> /// 批量删除 /// </summary> /// <param name="ids"></param> /// <returns></returns> public bool BatchDelete(int[] ids) { if (ids.Length == 0) { return(false); } SqlRun sqlhelper = new SqlRun(SqlRun.sqlstr); int flag = 0; for (int i = 0; i < ids.Length; i++) { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@id", ids[i]) }; flag += sqlhelper.ExecuteNonQuery("Proc_DeleteCustomForm", sqlParams); } if (flag > 0) { return(true); } else { return(false); } }