示例#1
0
        public virtual bool AddPayWay(PayWayInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT TOP 0 * FROM Pay_Way";
            DtAdd  = DBHelper.Query(SqlAdd);
            DrAdd  = DtAdd.NewRow();
            DrAdd["Pay_Way_Type"]   = entity.Pay_Way_Type;
            DrAdd["Pay_Way_Name"]   = entity.Pay_Way_Name;
            DrAdd["Pay_Way_Sort"]   = entity.Pay_Way_Sort;
            DrAdd["Pay_Way_Status"] = entity.Pay_Way_Status;
            DrAdd["Pay_Way_Cod"]    = entity.Pay_Way_Cod;
            DrAdd["Pay_Way_Img"]    = entity.Pay_Way_Img;
            DrAdd["Pay_Way_Intro"]  = entity.Pay_Way_Intro;
            DrAdd["Pay_Way_Site"]   = entity.Pay_Way_Site;
            DtAdd.Rows.Add(DrAdd);
            try {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex) {
                throw ex;
            }
            finally {
                DtAdd.Dispose();
            }
        }
示例#2
0
        public virtual PayWayInfo GetPayWayByID(int ID)
        {
            PayWayInfo    entity  = null;
            SqlDataReader RdrList = null;

            try {
                string SqlList;
                SqlList = "SELECT * FROM Pay_Way WHERE Pay_Way_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity                = new PayWayInfo();
                    entity.Pay_Way_ID     = Tools.NullInt(RdrList["Pay_Way_ID"]);
                    entity.Pay_Way_Type   = Tools.NullInt(RdrList["Pay_Way_Type"]);
                    entity.Pay_Way_Name   = Tools.NullStr(RdrList["Pay_Way_Name"]);
                    entity.Pay_Way_Sort   = Tools.NullInt(RdrList["Pay_Way_Sort"]);
                    entity.Pay_Way_Status = Tools.NullInt(RdrList["Pay_Way_Status"]);
                    entity.Pay_Way_Cod    = Tools.NullInt(RdrList["Pay_Way_Cod"]);
                    entity.Pay_Way_Img    = Tools.NullStr(RdrList["Pay_Way_Img"]);
                    entity.Pay_Way_Intro  = Tools.NullStr(RdrList["Pay_Way_Intro"]);
                    entity.Pay_Way_Site   = Tools.NullStr(RdrList["Pay_Way_Site"]);
                }
                return(entity);
            }
            catch (Exception ex) {
                throw ex;
            }
            finally {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
示例#3
0
文件: PayWay.cs 项目: Abnertd/public
 public virtual bool EditPayWay(PayWayInfo entity, RBACUserInfo UserPrivilege)
 {
     if (RBAC.CheckPrivilege(UserPrivilege, "a47a2618-e716-44e3-95b4-bee4c21c34f3"))
     {
         return(MyDAL.EditPayWay(entity));
     }
     else
     {
         throw new TradePrivilegeException("没有权限,权限代码:a47a2618-e716-44e3-95b4-bee4c21c34f3错误");
     }
 }
示例#4
0
文件: PayWay.cs 项目: Abnertd/public
 public virtual bool AddPayWay(PayWayInfo entity, RBACUserInfo UserPrivilege)
 {
     if (RBAC.CheckPrivilege(UserPrivilege, "7950ffdc-827d-4432-a177-eb1d96ad4c3e"))
     {
         return(MyDAL.AddPayWay(entity));
     }
     else
     {
         throw new TradePrivilegeException("没有权限,权限代码:7950ffdc-827d-4432-a177-eb1d96ad4c3e错误");
     }
 }
示例#5
0
        public virtual IList <PayWayInfo> GetPayWays(QueryInfo Query)
        {
            int PageSize;
            int CurrentPage;
            IList <PayWayInfo> entitys = null;
            PayWayInfo         entity = null;
            string             SqlList, SqlField, SqlOrder, SqlParam, SqlTable;
            SqlDataReader      RdrList = null;

            try {
                CurrentPage = Query.CurrentPage;
                PageSize    = Query.PageSize;
                SqlTable    = "Pay_Way";
                SqlField    = "*";
                SqlParam    = DBHelper.GetSqlParam(Query.ParamInfos);
                SqlOrder    = DBHelper.GetSqlOrder(Query.OrderInfos);
                SqlList     = DBHelper.GetSqlPage(SqlTable, SqlField, SqlParam, SqlOrder, CurrentPage, PageSize);
                RdrList     = DBHelper.ExecuteReader(SqlList);
                if (RdrList.HasRows)
                {
                    entitys = new List <PayWayInfo>();
                    while (RdrList.Read())
                    {
                        entity                = new PayWayInfo();
                        entity.Pay_Way_ID     = Tools.NullInt(RdrList["Pay_Way_ID"]);
                        entity.Pay_Way_Type   = Tools.NullInt(RdrList["Pay_Way_Type"]);
                        entity.Pay_Way_Name   = Tools.NullStr(RdrList["Pay_Way_Name"]);
                        entity.Pay_Way_Sort   = Tools.NullInt(RdrList["Pay_Way_Sort"]);
                        entity.Pay_Way_Status = Tools.NullInt(RdrList["Pay_Way_Status"]);
                        entity.Pay_Way_Cod    = Tools.NullInt(RdrList["Pay_Way_Cod"]);
                        entity.Pay_Way_Img    = Tools.NullStr(RdrList["Pay_Way_Img"]);
                        entity.Pay_Way_Intro  = Tools.NullStr(RdrList["Pay_Way_Intro"]);
                        entity.Pay_Way_Site   = Tools.NullStr(RdrList["Pay_Way_Site"]);
                        entitys.Add(entity);
                        entity = null;
                    }
                }
                return(entitys);
            }
            catch (Exception ex) {
                throw ex;
            }
            finally {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
示例#6
0
文件: PayWay.cs 项目: Abnertd/public
    public void EditPayWay()
    {
        int    Pay_Way_ID     = tools.CheckInt(Request.Form["Pay_Way_ID"]);
        int    Pay_Way_Type   = tools.CheckInt(Request.Form["Pay_Way_Type"]);
        string Pay_Way_Name   = tools.CheckStr(Request.Form["Pay_Way_Name"]);
        int    Pay_Way_Sort   = tools.CheckInt(Request.Form["Pay_Way_Sort"]);
        int    Pay_Way_Status = tools.CheckInt(Request.Form["Pay_Way_Status"]);
        string Pay_Way_Img    = tools.CheckStr(Request.Form["Pay_Way_Img"]);
        int    Pay_Way_Cod    = tools.CheckInt(Request.Form["Pay_Way_Cod"]);
        string Pay_Way_Intro  = Request.Form["Pay_Way_Intro"];

        if (Pay_Way_Name.Length == 0)
        {
            Public.Msg("error", "错误信息", "请填写支付方式名称", false, "{back}"); return;
        }

        PayWayInfo entity = new PayWayInfo();

        entity.Pay_Way_ID     = Pay_Way_ID;
        entity.Pay_Way_Type   = Pay_Way_Type;
        entity.Pay_Way_Name   = Pay_Way_Name;
        entity.Pay_Way_Sort   = Pay_Way_Sort;
        entity.Pay_Way_Status = Pay_Way_Status;
        entity.Pay_Way_Cod    = Pay_Way_Cod;
        entity.Pay_Way_Img    = Pay_Way_Img;
        entity.Pay_Way_Intro  = Pay_Way_Intro;
        entity.Pay_Way_Site   = Public.GetCurrentSite();

        if (MyBLL.EditPayWay(entity, Public.GetUserPrivilege()))
        {
            Public.Msg("positive", "操作成功", "操作成功", true, "pay_way_list.aspx");
        }
        else
        {
            Public.Msg("error", "错误信息", "操作失败,请稍后重试", false, "{back}");
        }
    }
示例#7
0
        public virtual bool EditPayWay(PayWayInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Pay_Way WHERE Pay_Way_ID = " + entity.Pay_Way_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Pay_Way_ID"]     = entity.Pay_Way_ID;
                    DrAdd["Pay_Way_Type"]   = entity.Pay_Way_Type;
                    DrAdd["Pay_Way_Name"]   = entity.Pay_Way_Name;
                    DrAdd["Pay_Way_Sort"]   = entity.Pay_Way_Sort;
                    DrAdd["Pay_Way_Status"] = entity.Pay_Way_Status;
                    DrAdd["Pay_Way_Cod"]    = entity.Pay_Way_Cod;
                    DrAdd["Pay_Way_Img"]    = entity.Pay_Way_Img;
                    DrAdd["Pay_Way_Intro"]  = entity.Pay_Way_Intro;
                    DrAdd["Pay_Way_Site"]   = entity.Pay_Way_Site;
                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex) {
                throw ex;
            }
            finally {
                DtAdd.Dispose();
            }
            return(true);
        }