コード例 #1
0
            /// <summary>
            /// 对象实体绑定数据
            /// </summary>
            public Lebi_Supplier_Verified_Log ReaderBind(IDataReader dataReader)
            {
                Lebi_Supplier_Verified_Log model = new Lebi_Supplier_Verified_Log();
                object ojb;

                ojb = dataReader["id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.id = (int)ojb;
                }
                model.ImageUrl = dataReader["ImageUrl"].ToString();
                ojb            = dataReader["Type_id_SupplierVerifiedStatus"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Type_id_SupplierVerifiedStatus = (int)ojb;
                }
                ojb = dataReader["Time_Add"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Time_Add = (DateTime)ojb;
                }
                ojb = dataReader["Verified_id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Verified_id = (int)ojb;
                }
                ojb = dataReader["Supplier_id"];
                if (ojb != null && ojb != DBNull.Value)
                {
                    model.Supplier_id = (int)ojb;
                }
                return(model);
            }
コード例 #2
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_Supplier_Verified_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_Supplier_Verified_Log] set ");
                strSql.Append("ImageUrl= @ImageUrl,");
                strSql.Append("Type_id_SupplierVerifiedStatus= @Type_id_SupplierVerifiedStatus,");
                strSql.Append("Time_Add= @Time_Add,");
                strSql.Append("Verified_id= @Verified_id,");
                strSql.Append("Supplier_id= @Supplier_id");
                strSql.Append(" where id=@id");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@id",                             SqlDbType.Int,         4),
                    new SqlParameter("@ImageUrl",                       SqlDbType.NVarChar,  200),
                    new SqlParameter("@Type_id_SupplierVerifiedStatus", SqlDbType.Int,         4),
                    new SqlParameter("@Time_Add",                       SqlDbType.DateTime),
                    new SqlParameter("@Verified_id",                    SqlDbType.Int,         4),
                    new SqlParameter("@Supplier_id",                    SqlDbType.Int, 4)
                };
                parameters[0].Value = model.id;
                parameters[1].Value = model.ImageUrl;
                parameters[2].Value = model.Type_id_SupplierVerifiedStatus;
                parameters[3].Value = model.Time_Add;
                parameters[4].Value = model.Verified_id;
                parameters[5].Value = model.Supplier_id;

                SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters);
            }
コード例 #3
0
            /// <summary>
            /// 增加一条数据
            /// </summary>
            public int Add(Lebi_Supplier_Verified_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("insert into [Lebi_Supplier_Verified_Log](");
                strSql.Append("ImageUrl,Type_id_SupplierVerifiedStatus,Time_Add,Verified_id,Supplier_id)");
                strSql.Append(" values (");
                strSql.Append("@ImageUrl,@Type_id_SupplierVerifiedStatus,@Time_Add,@Verified_id,@Supplier_id)");
                strSql.Append(";select @@IDENTITY");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@ImageUrl",                       model.ImageUrl),
                    new SqlParameter("@Type_id_SupplierVerifiedStatus", model.Type_id_SupplierVerifiedStatus),
                    new SqlParameter("@Time_Add",                       model.Time_Add),
                    new SqlParameter("@Verified_id",                    model.Verified_id),
                    new SqlParameter("@Supplier_id",                    model.Supplier_id)
                };

                object obj = SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters);

                if (obj == null)
                {
                    return(1);
                }
                else
                {
                    return(Convert.ToInt32(obj));
                }
            }
コード例 #4
0
        public string GetVerifiedImage(int vid)
        {
            string where = "Verified_id = " + vid + " and Supplier_id = " + supplier.id + "";
            Lebi_Supplier_Verified_Log log = B_Lebi_Supplier_Verified_Log.GetModel(where);

            if (log == null)
            {
                return("");
            }
            return(log.ImageUrl);
        }
コード例 #5
0
ファイル: EX_Supplier.cs プロジェクト: yzbjack/LebiShop
        //获取商家身份验证项目
        public static Lebi_Supplier_Verified_Log GetVerified_Log(int id, int user_id)
        {
            Lebi_Supplier_Verified_Log model = B_Lebi_Supplier_Verified_Log.GetModel("Verified_id =" + id + " and Supplier_id = " + user_id + "");

            if (model == null)
            {
                model = new Lebi_Supplier_Verified_Log();
                return(model);
            }
            return(model);
        }
コード例 #6
0
ファイル: ajax_config.aspx.cs プロジェクト: zwkjgs/LebiShop
        /// <summary>
        /// 编辑身份验证项目
        /// </summary>
        public void Verified_Edit()
        {
            if (!Power("supplier_verified", "身份验证"))
            {
                AjaxNoPower();
                return;
            }
            int  id = RequestTool.RequestInt("id", 0);
            int  Type_id_BillType = RequestTool.RequestInt("Type_id_BillType", 0);
            bool addflag          = false;

            string where = "";
            where        = "Verified_id = " + id + " and Supplier_id = " + CurrentSupplier.id + "";
            Lebi_Supplier_Verified Verified = B_Lebi_Supplier_Verified.GetModel(id);

            if (Verified == null)
            {
                Verified = new Lebi_Supplier_Verified();
            }
            Lebi_Supplier_Verified_Log model = B_Lebi_Supplier_Verified_Log.GetModel(where);

            if (model == null)
            {
                addflag = true;
                model   = new Lebi_Supplier_Verified_Log();
            }
            model = B_Lebi_Supplier_Verified_Log.SafeBindForm(model);
            model.Type_id_SupplierVerifiedStatus = 9020;
            model.Time_Add = DateTime.Now;
            if (addflag)
            {
                model.Verified_id = id;
                model.Supplier_id = CurrentSupplier.id;
                B_Lebi_Supplier_Verified_Log.Add(model);
                id = B_Lebi_Supplier_Verified_Log.GetMaxId();
                Log.Add("身份验证", "Supplier_Verified", id.ToString(), CurrentSupplier, Lang(Verified.Name));
            }
            else
            {
                B_Lebi_Supplier_Verified_Log.Update(model);
                Log.Add("身份验证", "Supplier_Verified", id.ToString(), CurrentSupplier, Lang(Verified.Name));
            }
            string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}";

            Response.Write(result);
        }
コード例 #7
0
            /// <summary>
            /// 得到一个对象实体 by id
            /// </summary>
            public Lebi_Supplier_Verified_Log GetModel(int id)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("select  top 1  * from [Lebi_Supplier_Verified_Log] ");
                strSql.Append(" where id=@id");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@id", SqlDbType.Int, 4)
                };
                parameters[0].Value = id;

                Lebi_Supplier_Verified_Log model = new Lebi_Supplier_Verified_Log();
                DataSet ds = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString(), parameters);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                    {
                        model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                    }
                    model.ImageUrl = ds.Tables[0].Rows[0]["ImageUrl"].ToString();
                    if (ds.Tables[0].Rows[0]["Type_id_SupplierVerifiedStatus"].ToString() != "")
                    {
                        model.Type_id_SupplierVerifiedStatus = int.Parse(ds.Tables[0].Rows[0]["Type_id_SupplierVerifiedStatus"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Time_Add"].ToString() != "")
                    {
                        model.Time_Add = DateTime.Parse(ds.Tables[0].Rows[0]["Time_Add"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Verified_id"].ToString() != "")
                    {
                        model.Verified_id = int.Parse(ds.Tables[0].Rows[0]["Verified_id"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Supplier_id"].ToString() != "")
                    {
                        model.Supplier_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_id"].ToString());
                    }
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
コード例 #8
0
            /// <summary>
            /// 得到一个对象实体 by where条件
            /// </summary>
            public Lebi_Supplier_Verified_Log GetModel(string strWhere)
            {
                if (strWhere.IndexOf("lbsql{") > 0)
                {
                    SQLPara para = new SQLPara(strWhere, "", "");
                    return(GetModel(para));
                }
                StringBuilder strSql = new StringBuilder();

                strSql.Append("select  top 1  * from [Lebi_Supplier_Verified_Log] ");
                strSql.Append(" where " + strWhere + "");
                Lebi_Supplier_Verified_Log model = new Lebi_Supplier_Verified_Log();
                DataSet ds = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString());

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                    {
                        model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                    }
                    model.ImageUrl = ds.Tables[0].Rows[0]["ImageUrl"].ToString();
                    if (ds.Tables[0].Rows[0]["Type_id_SupplierVerifiedStatus"].ToString() != "")
                    {
                        model.Type_id_SupplierVerifiedStatus = int.Parse(ds.Tables[0].Rows[0]["Type_id_SupplierVerifiedStatus"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Time_Add"].ToString() != "")
                    {
                        model.Time_Add = DateTime.Parse(ds.Tables[0].Rows[0]["Time_Add"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Verified_id"].ToString() != "")
                    {
                        model.Verified_id = int.Parse(ds.Tables[0].Rows[0]["Verified_id"].ToString());
                    }
                    if (ds.Tables[0].Rows[0]["Supplier_id"].ToString() != "")
                    {
                        model.Supplier_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_id"].ToString());
                    }
                    return(model);
                }
                else
                {
                    return(null);
                }
            }
コード例 #9
0
            /// <summary>
            /// 增加一条数据
            /// </summary>
            public int Add(Lebi_Supplier_Verified_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("insert into [Lebi_Supplier_Verified_Log](");
                strSql.Append("[ImageUrl],[Type_id_SupplierVerifiedStatus],[Time_Add],[Verified_id],[Supplier_id])");
                strSql.Append(" values (");
                strSql.Append("@ImageUrl,@Type_id_SupplierVerifiedStatus,@Time_Add,@Verified_id,@Supplier_id)");
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@ImageUrl",                       model.ImageUrl),
                    new OleDbParameter("@Type_id_SupplierVerifiedStatus", model.Type_id_SupplierVerifiedStatus),
                    new OleDbParameter("@Time_Add",                       model.Time_Add.ToString("yyyy-MM-dd hh:mm:ss")),
                    new OleDbParameter("@Verified_id",                    model.Verified_id),
                    new OleDbParameter("@Supplier_id",                    model.Supplier_id)
                };

                AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters);
                return(1);
            }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int id  = RequestTool.RequestInt("id", 0);
            int vid = RequestTool.RequestInt("vid", 0);

            if (!Power("supplier_verified", "身份验证"))
            {
                WindowNoPower();
            }
            Verified = B_Lebi_Supplier_Verified.GetModel(id);
            if (Verified == null)
            {
                Verified = new Lebi_Supplier_Verified();
            }
            model = B_Lebi_Supplier_Verified_Log.GetModel("Supplier_id = " + CurrentSupplier.id + " and id =" + vid + "");
            if (model == null)
            {
                model = new Lebi_Supplier_Verified_Log();
            }
        }
コード例 #11
0
            /// <summary>
            /// 更新一条数据
            /// </summary>
            public void Update(Lebi_Supplier_Verified_Log model)
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("update [Lebi_Supplier_Verified_Log] set ");
                strSql.Append("[ImageUrl]=@ImageUrl,");
                strSql.Append("[Type_id_SupplierVerifiedStatus]=@Type_id_SupplierVerifiedStatus,");
                strSql.Append("[Time_Add]=@Time_Add,");
                strSql.Append("[Verified_id]=@Verified_id,");
                strSql.Append("[Supplier_id]=@Supplier_id");
                strSql.Append(" where id=" + model.id);
                OleDbParameter[] parameters =
                {
                    new OleDbParameter("@ImageUrl",                       model.ImageUrl),
                    new OleDbParameter("@Type_id_SupplierVerifiedStatus", model.Type_id_SupplierVerifiedStatus),
                    new OleDbParameter("@Time_Add",                       model.Time_Add.ToString("yyyy-MM-dd hh:mm:ss")),
                    new OleDbParameter("@Verified_id",                    model.Verified_id),
                    new OleDbParameter("@Supplier_id",                    model.Supplier_id)
                };

                AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters);
            }
コード例 #12
0
 /// <summary>
 /// 安全方式绑定对象表单
 /// </summary>
 public Lebi_Supplier_Verified_Log SafeBindForm(Lebi_Supplier_Verified_Log model)
 {
     if (HttpContext.Current.Request["ImageUrl"] != null)
     {
         model.ImageUrl = Shop.Tools.RequestTool.RequestSafeString("ImageUrl");
     }
     if (HttpContext.Current.Request["Type_id_SupplierVerifiedStatus"] != null)
     {
         model.Type_id_SupplierVerifiedStatus = Shop.Tools.RequestTool.RequestInt("Type_id_SupplierVerifiedStatus", 0);
     }
     if (HttpContext.Current.Request["Time_Add"] != null)
     {
         model.Time_Add = Shop.Tools.RequestTool.RequestTime("Time_Add", System.DateTime.Now);
     }
     if (HttpContext.Current.Request["Verified_id"] != null)
     {
         model.Verified_id = Shop.Tools.RequestTool.RequestInt("Verified_id", 0);
     }
     if (HttpContext.Current.Request["Supplier_id"] != null)
     {
         model.Supplier_id = Shop.Tools.RequestTool.RequestInt("Supplier_id", 0);
     }
     return(model);
 }
コード例 #13
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public static void Update(Lebi_Supplier_Verified_Log model)
 {
     D_Lebi_Supplier_Verified_Log.Instance.Update(model);
 }
コード例 #14
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public static int Add(Lebi_Supplier_Verified_Log model)
 {
     return(D_Lebi_Supplier_Verified_Log.Instance.Add(model));
 }
コード例 #15
0
 /// <summary>
 /// 安全方式绑定表单数据
 /// </summary>
 public static Lebi_Supplier_Verified_Log SafeBindForm(Lebi_Supplier_Verified_Log model)
 {
     return(D_Lebi_Supplier_Verified_Log.Instance.SafeBindForm(model));
 }
コード例 #16
0
        /// <summary>
        /// 用户这注册
        /// </summary>
        public void User_Reg()
        {
            string verifycode = RequestTool.RequestString("verifycode");
            string code       = CurrentCheckCode;
            string UserName   = RequestTool.RequestSafeString("UserName");

            //检查用户名存在
            if (CurrentUser.id == 0 || CurrentUser.IsAnonymous == 1)
            {
                Response.Write("{\"msg\":\"" + Tag("请登录") + "\"}");
                return;
            }
            if (SYS.Verifycode_SupplierRegister == "1")
            {
                if (code != verifycode)
                {
                    Response.Write("{\"msg\":\"" + Tag("验证码错误") + "\"}");
                    return;
                }
            }
            //检查用户名存在
            int count = B_Lebi_Supplier.Counts("UserName !='' and UserName=lbsql{'" + CurrentUser.UserName + "'}");

            if (count > 0)
            {
                Response.Write("{\"msg\":\"" + Tag("商家已注册") + "\"}");
                return;
            }
            Lebi_Supplier model = B_Lebi_Supplier.GetModel("User_id=" + CurrentUser.id + "");

            if (model == null)
            {
                model = new Lebi_Supplier();
            }
            Lebi_Supplier_Group group = B_Lebi_Supplier_Group.GetModel(RequestTool.RequestInt("Supplier_Group_id"));

            if (group == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            B_Lebi_Supplier.SafeBindForm(model);
            model.User_id                = CurrentUser.id;
            model.UserName               = CurrentUser.UserName;
            model.Email                  = RequestTool.RequestSafeString("Email");
            model.RealName               = RequestTool.RequestSafeString("RealName");
            model.Company                = RequestTool.RequestSafeString("Company");
            model.Name                   = RequestTool.RequestSafeString("Name");
            model.Name                   = "[{\"L\":\"" + Language.DefaultLanguage().Code + "\",\"C\":\"" + model.Name + "\"}]";
            model.SubName                = RequestTool.RequestSafeString("SubName");
            model.MobilePhone            = RequestTool.RequestSafeString("MobilePhone");
            model.Phone                  = RequestTool.RequestSafeString("Phone");
            model.QQ                     = RequestTool.RequestSafeString("QQ");
            model.Language               = CurrentLanguage.Code;
            model.Time_Reg               = DateTime.Now;
            model.Time_This              = DateTime.Now;
            model.Time_Last              = DateTime.Now;
            model.Count_Login            = 1;
            model.IP_This                = RequestTool.GetClientIP();
            model.IP_Last                = RequestTool.GetClientIP();
            model.Type_id_SupplierStatus = 441;
            model.BillingDays            = group.BillingDays;
            model.Money_Service          = group.ServicePrice;
            model.Money_Margin           = group.MarginPrice;
            model.Time_Begin             = DateTime.Now;
            model.Time_End               = DateTime.Now.AddDays(group.ServiceDays);
            if (model.id == 0)
            {
                B_Lebi_Supplier.Add(model);
                model.id = B_Lebi_Supplier.GetMaxId();
            }
            else
            {
                B_Lebi_Supplier.Update(model);
            }
            if (group.Verified_ids != "")
            {
                List <Lebi_Supplier_Verified> models = B_Lebi_Supplier_Verified.GetList("id in (" + group.Verified_ids + ")", "Sort desc");
                foreach (Lebi_Supplier_Verified m in models)
                {
                    string where = "Verified_id = " + m.id + " and Supplier_id = " + model.id + "";
                    Lebi_Supplier_Verified_Log log = B_Lebi_Supplier_Verified_Log.GetModel(where);
                    if (log == null)
                    {
                        log = new Lebi_Supplier_Verified_Log();
                    }
                    //log = B_Lebi_Supplier_Verified_Log.SafeBindForm(log);
                    log.ImageUrl = RequestTool.RequestSafeString("Image" + m.id);
                    log.Type_id_SupplierVerifiedStatus = 9020;
                    log.Time_Add    = DateTime.Now;
                    log.Verified_id = m.id;
                    log.Supplier_id = model.id;
                    if (log.id == 0)
                    {
                        B_Lebi_Supplier_Verified_Log.Add(log);
                    }
                    else
                    {
                        B_Lebi_Supplier_Verified_Log.Update(log);
                    }
                }
            }
            EX_Supplier.SupplierRegister(model);//触发事件
            Response.Write("{\"msg\":\"OK\"}");
        }