Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             goodsid = KillSqlIn.Form_ReplaceByString(Request.QueryString["id"], 20);
             string strSQL = "select  * from T_Goods_info where menuid='" + goodsid + "';";
             strSQL += "select * from T_Menu_Sign;";
             strSQL += "select * from T_Menu_SignBind where menuid='" + goodsid + "';";
             AdoHelper adohelper = AdoHelper.CreateHelper(StarTech.Util.AppConfig.DBInstance);
             DataSet   ds        = adohelper.ExecuteSqlDataset(strSQL);
             llName.Text = ds.Tables[0].Rows[0]["goodsName"].ToString();
             llCode.Text = ds.Tables[0].Rows[0]["goodsCode"].ToString();
             List <string> signList = new List <string>();
             for (int i = 0; i < ds.Tables[2].Rows.Count; i++)
             {
                 signList.Add(ds.Tables[2].Rows[i]["signid"].ToString());
             }
             string llText = "";
             for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
             {
                 if (signList.Contains(ds.Tables[1].Rows[i]["signid"].ToString()))
                 {
                     llText += "<input checked='checked' type='checkbox' signname='" + ds.Tables[1].Rows[i]["signname"].ToString() + "' signid='" + ds.Tables[1].Rows[i]["signid"].ToString() + "' class='ckSign' />";
                 }
                 else
                 {
                     llText += "<input type='checkbox' signname='" + ds.Tables[1].Rows[i]["signname"].ToString() + "' signid='" + ds.Tables[1].Rows[i]["signid"].ToString() + "' class='ckSign' />";
                 }
                 llText += ds.Tables[1].Rows[i]["signname"].ToString();
                 if ((i + 1) % 6 == 0)
                 {
                     llText += "<br/>";
                 }
             }
             llSign.Text = llText;
         }
     }
 }
Beispiel #2
0
    /// <summary>
    ///
    /// </summary>
    protected void GetItem()
    {
        string  strSQL = "select * from T_Menu_Item where itemid='" + itemid + "';";
        DataSet ds     = adoHelper.ExecuteSqlDataset(strSQL);

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            txtItemName.Text = ds.Tables[0].Rows[0]["itemname"].ToString();
            txtOrderby.Text  = ds.Tables[0].Rows[0]["orderby"].ToString();
            txtRemark.Text   = ds.Tables[0].Rows[0]["remark"].ToString();
            txtUnit.Text     = ds.Tables[0].Rows[0]["unit"].ToString();
            if (Convert.ToInt32(ds.Tables[0].Rows[0]["ifbuy"]) == 1)
            {
                rbChoose.Checked = true;
                hfGoodsId.Value  = ds.Tables[0].Rows[0]["goodsid"].ToString();
            }
            //ddlItemType.SelectedValue = ds.Tables[0].Rows[0]["itemType"].ToString();
            imgItem.ImageUrl = ds.Tables[0].Rows[0]["itemImgSrc"].ToString();
            ifShowImg        = true;
            hfImgSrc.Value   = ds.Tables[0].Rows[0]["itemImgSrc"].ToString();
        }
    }
Beispiel #3
0
        /// <summary>
        /// 1,创建临时抢单库(用户付款后,创建抢单库,将任务写入其中)
        /// </summary>
        /// <param name="orderId">订单号</param>
        /// <returns></returns>
        public static int CreateWaitingDeal(string orderId)
        {
            orderId = KillSqlIn.Form_ReplaceByString(orderId, 50);
            string strSQL = "select * from T_Order_Info where orderId='" + orderId + "';";

            strSQL += "select * from T_Order_InfoDetail where orderId='" + orderId + "';";
            string guid = Guid.NewGuid().ToString();

            SqlErr(strSQL, "CreateWaitingDeal");
            DataSet ds = adoHelper.ExecuteSqlDataset(strSQL);

            //strSQL += "insert T_Order_WaitingDeal select '"+guid+"',";
            if (ds == null || ds.Tables.Count < 2 || ds.Tables[0].Rows.Count < 1 || ds.Tables[1].Rows.Count < 1)
            {
                return(-1);
            }
            strSQL = "";
            for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
            {
                string   sysnumber  = Guid.NewGuid().ToString() + "" + i;
                string   detailId   = ds.Tables[1].Rows[i]["sysnumber"].ToString();
                string   goodsName  = ds.Tables[1].Rows[i]["goodsName"].ToString();;
                string   goodsId    = ds.Tables[1].Rows[i]["goodsId"].ToString();;
                int      num        = Convert.ToInt32(ds.Tables[1].Rows[i]["Quantity"].ToString());
                decimal  price      = Convert.ToDecimal(ds.Tables[1].Rows[i]["price"].ToString());
                decimal  totalprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["OrderAllMoney"].ToString());
                DateTime payTime    = Convert.ToDateTime(ds.Tables[0].Rows[0]["payTime"].ToString());
                DateTime start      = Convert.ToDateTime(ds.Tables[0].Rows[0]["ztTime"].ToString());
                DateTime end        = Convert.ToDateTime(ds.Tables[0].Rows[0]["ztTimeEnd"].ToString());
                string   marketId   = ds.Tables[0].Rows[0]["marketId"].ToString();
                strSQL += "insert into T_Order_WaitingDeal values('" + sysnumber + "','" + detailId + "','" + orderId + "',0,'1991-1-1',0,'1991-1-1','','" + goodsName + "','" + goodsId + "'," + num + "," + price + "," + totalprice + ",'" + payTime + "','" + start + "','" + end + "','" + marketId + "','');";
            }
            int rows = adoHelper.ExecuteSqlNonQuery(strSQL);

            return(rows);
        }
Beispiel #4
0
    /// <summary>
    /// 微信分享赠送(批量领取)
    /// </summary>
    /// <param name="MemberId"></param>
    /// <returns></returns>
    protected int GetCouponShareBat(string MemberId)
    {
        AdoHelper ado = AdoHelper.CreateHelper("DB_Instance");
        //config
        DataTable dtConfig = ado.ExecuteSqlDataset("select * from T_Base_Coupon where GetPlaceInfo='微信分享赠送' and CouponType='抵用券' and  isEffect=1 ").Tables[0];

        if (dtConfig.Rows.Count == 0)
        {
            return(-1);
        }

        //add
        int result = 0;
        int flag   = 10;

        foreach (DataRow row in dtConfig.Rows)
        {
            List <SqlParameter> plist = new List <SqlParameter>();
            string guid     = Guid.NewGuid().ToString();
            string CouponId = MemberId + DateTime.Now.ToString("yyMMddHHmmss") + flag;
            plist.Add(new SqlParameter("@Sysnumber", guid));
            plist.Add(new SqlParameter("@MemberId", MemberId));
            plist.Add(new SqlParameter("@CouponId", CouponId));
            plist.Add(new SqlParameter("@CouponType", "抵用券"));
            plist.Add(new SqlParameter("@CouponValue", row["CouponValue"]));
            plist.Add(new SqlParameter("@StartTime", row["StartTime"]));
            plist.Add(new SqlParameter("@EndTime", row["EndTime"]));
            plist.Add(new SqlParameter("@IsUsed", "0"));
            plist.Add(new SqlParameter("@Remark", row["Context"]));
            plist.Add(new SqlParameter("@GetPlaceInfo", "微信分享赠送"));
            plist.Add(new SqlParameter("@minPrice", row["minPrice"]));
            plist.Add(new SqlParameter("@maxPrice", row["maxPrice"]));
            SqlParameter[] p = plist.ToArray();
            result += StarTech.DBCommon.InsertData("T_Member_Coupon", p);
            flag++;
        }
        return(result);
    }
    protected void BindTotalNum(string testSysnumber)
    {
        AdoHelper ado   = AdoHelper.CreateHelper("DB_Instance");
        DataSet   ds    = ado.ExecuteSqlDataset("select categoryId,Questions,qtype,num from T_Test_day_item where testSysnumber='" + testSysnumber + "'");
        int       total = 0;
        string    info  = "";

        if (ds.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                int one = int.Parse(row["num"].ToString());

                total += one;
                //info += GetCategoryName(row["categoryId"].ToString()) + " " + one + ";";
            }
            this.txtQuestionTotalNum.Text = total + "";
        }
        else
        {
            this.txtQuestionTotalNum.Text = "0";
        }
    }
    protected void CreateInfo(string goodsId)
    {
        DataTable dt = new GoodsBll().GetMorePropertyInfo(goodsId);

        if (dt != null && dt.Rows.Count > 0)
        {
            string    html      = "";
            string    allIds    = "";
            string    strSQL    = "select * from T_Goods_MoreProperty where goodsid='" + goodsId + "';;";
            AdoHelper adohelper = AdoHelper.CreateHelper(StarTech.Util.AppConfig.DBInstance);
            DataTable dtValue   = adohelper.ExecuteSqlDataset(strSQL).Tables[0];
            //DataTable dtValue = new TableObject("T_Goods_MoreProperty").Util_GetList("*", "goodsid='" + goodsId + "'");
            foreach (DataRow row in dt.Rows)
            {
                if (row["porpertyFlag"].ToString() == "input")
                {
                    string v   = (dtValue.Select("PropertyId='" + row["propertyId"].ToString() + "'").Length > 0) ? dtValue.Select("PropertyId='" + row["propertyId"].ToString() + "'")[0]["PropertyValue"].ToString() : "";
                    string uid = "MorePropertyId_" + row["propertyId"].ToString();
                    html += "<tr><td class='td_title'  style='width:100px;'>" + row["propertyName"].ToString() + ":</td><td class='td_info1' style='width:330px;'><input type='text' id='" + uid + "' name='" + uid + "' value='" + v + "' style='width:300px;height:16px;'></td></tr>";

                    allIds += uid + ",";
                }
            }
            if (allIds != "")
            {
                allIds = allIds.TrimEnd(',');
            }
            html            += "<input type='hidden' name='MorePropertyId_AllIds' value='" + allIds + "'>";
            this.ltHtml.Text = html;
        }
        else
        {
            this.btn_1.Visible = false;
            this.btn_2.Visible = true;
        }
    }
Beispiel #7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModIACenter_MarketUser GetModel(int uniqueId)
        {
            StringBuilder strSql = new StringBuilder();

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

            ModIACenter_MarketUser model = new ModIACenter_MarketUser();
            DataSet ds = ado.ExecuteSqlDataset(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["uniqueId"].ToString() != "")
                {
                    model.uniqueId = int.Parse(ds.Tables[0].Rows[0]["uniqueId"].ToString());
                }
                model.userName = ds.Tables[0].Rows[0]["userName"].ToString();
                model.password = ds.Tables[0].Rows[0]["password"].ToString();
                model.trueName = ds.Tables[0].Rows[0]["trueName"].ToString();
                if (ds.Tables[0].Rows[0]["userType"].ToString() != "")
                {
                    model.userType = int.Parse(ds.Tables[0].Rows[0]["userType"].ToString());
                }
                if (ds.Tables[0].Rows[0]["isUse"].ToString() != "")
                {
                    model.isUse = int.Parse(ds.Tables[0].Rows[0]["isUse"].ToString());
                }
                if (ds.Tables[0].Rows[0]["isSuperAdmin"].ToString() != "")
                {
                    model.isSuperAdmin = int.Parse(ds.Tables[0].Rows[0]["isSuperAdmin"].ToString());
                }
                if (ds.Tables[0].Rows[0]["addTime"].ToString() != "")
                {
                    model.addTime = DateTime.Parse(ds.Tables[0].Rows[0]["addTime"].ToString());
                }
                model.sex = ds.Tables[0].Rows[0]["sex"].ToString();
                if (ds.Tables[0].Rows[0]["age"].ToString() != "")
                {
                    model.age = int.Parse(ds.Tables[0].Rows[0]["age"].ToString());
                }
                model.tel    = ds.Tables[0].Rows[0]["tel"].ToString();
                model.mobile = ds.Tables[0].Rows[0]["mobile"].ToString();
                if (ds.Tables[0].Rows[0]["departId"].ToString() != "")
                {
                    model.departId = int.Parse(ds.Tables[0].Rows[0]["departId"].ToString());
                }
                if (ds.Tables[0].Rows[0]["orderBy"].ToString() != "")
                {
                    model.orderBy = int.Parse(ds.Tables[0].Rows[0]["orderBy"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #8
0
    /// <summary>
    /// 获取基础分类
    /// </summary>
    /// <param name="typeid"></param>
    /// <returns></returns>
    protected string GetAllFormate(string typeid)
    {
        string strSQL = "select * from T_Goods_MorePropertySet order by porpertyFlag;";

        if (typeid != "")
        {
            strSQL += "select * from T_Goods_Category_MoreProperty where categoryId='" + KillSqlIn.Form_ReplaceByString(typeid, 10) + "';";
        }
        AdoHelper adohelper = StarTech.DBUtility.AdoHelper.CreateHelper(AppConfig.DBInstance);
        DataSet   ds        = adohelper.ExecuteSqlDataset(strSQL);
        bool      istype    = false;

        if (ds == null)
        {
            return("");
        }
        List <string> strType = new List <string>();

        if (ds.Tables.Count > 1)
        {
            istype = true;
            for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
            {
                strType.Add(ds.Tables[1].Rows[i]["morePropertyId"].ToString());
            }
        }
        string returnStr = "";
        int    index     = 0;
        int    indextype = 0;

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            if (indextype == 0 && ds.Tables[0].Rows[i]["porpertyFlag"].ToString() == "select")
            {
                indextype  = 1;
                index      = 0;
                returnStr += "<br/><p style='width:100%;font-weight:bold;'>可选择属性</p>";
            }
            else if (i == 0)
            {
                returnStr += "<p style='width:100%;font-weight:bold;'>仅显示属性</p>";
            }
            if (istype)
            {
                if (index == 5)
                {
                    returnStr += "<br/>";
                    index      = -1;
                }
                string isCheck = "";
                if (strType.Contains(ds.Tables[0].Rows[i]["propertyId"].ToString()))
                {
                    isCheck = "checked='checked'";
                }
                returnStr += "<span style='float:left;'><input tid='" + KillSqlIn.Form_ReplaceByString(ds.Tables[0].Rows[i]["propertyId"].ToString(), 10) + "' " + isCheck + " type='checkbox' id='fck" + KillSqlIn.Form_ReplaceByString(ds.Tables[0].Rows[i]["propertyId"].ToString(), 10) + "'>" + KillSqlIn.Form_ReplaceByString(ds.Tables[0].Rows[i]["propertyName"].ToString(), 20) + "</span>";
            }
            else
            {
                if (index == 5)
                {
                    returnStr += "<br/>";
                    index      = -1;
                }
                returnStr += "<span style='float:left;'><input tid='" + KillSqlIn.Form_ReplaceByString(ds.Tables[0].Rows[i]["propertyId"].ToString(), 10) + "'  type='checkbox' id='fck" + KillSqlIn.Form_ReplaceByString(ds.Tables[0].Rows[i]["propertyId"].ToString(), 10) + "'>" + KillSqlIn.Form_ReplaceByString(ds.Tables[0].Rows[i]["propertyName"].ToString(), 20) + "</span>";
            }
            index++;
        }
        return(returnStr);
    }
Beispiel #9
0
    /// <summary>
    /// 初始化数据
    /// </summary>
    protected void InitData()
    {
        if (this.id != "")
        {
            user = userbll.GetModel(this.id);
            if (user.isOwnSeller == 1 && user.AccoutsState == "Normal" && user.isOpen == 1)
            {
                trOwn.Visible = true;
            }
            else
            {
                trOwn.Visible = false;
            }

            string  sql2 = "select * from T_Shop_ApplyImage where shopid='" + id + "' order by addtime desc";
            DataSet ds2  = adoHelper.ExecuteSqlDataset(sql2);
            if (ds2.Tables[0].Rows.Count > 0)
            {
                //营业执照是否为空
                if (ds2.Tables[0].Rows[0]["Charter"].ToString() != "")
                {
                    SmallPic.Visible  = true;
                    SmallPic.ImageUrl = ds2.Tables[0].Rows[0]["Charter"].ToString();
                    //BigPic.HRef = ds2.Tables[0].Rows[0]["Charter"].ToString();
                }
            }



            //开通帐号下显示的数据
            if (user != null)
            {
                //未开通帐号下显示的数据
                this.CompanyName.Text         = user.CompanyName;
                this.ShopName.Text            = user.ShopName;
                this.Contact.Text             = user.LinkMan;
                this.Phone.Text               = user.Phone;
                this.Mark.Text                = user.Mark;
                this.address.Text             = user.Address;
                rbAccountsState.SelectedValue = "Normal";
                this.area.Text                = GetMarketInfo(user.MarketId);
                this.email.Text               = user.Email;
                this.qq.Text       = user.QQ;
                this.txtBZJ.Value  = user.ShopMoney.ToString();
                this.txtOrder.Text = user.orderby != null?user.orderby.ToString() : "0";

                DataSet ds = adoHelper.ExecuteSqlDataset("select * from T_Info_Category where categoryid='" + user.CategoryId + "' ");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    categroytype.Text = ds.Tables[0].Rows[0]["CategoryName"].ToString();
                }
                this.rbAccountsState.SelectedValue = (user.AccoutsState == null || user.AccoutsState.ToString() == "") ? "Unchecked" : user.AccoutsState;
                this.rbOpen.SelectedValue          = user.isOpen.ToString();
                if (user.Passwrod == null && user.UserName == null)
                {
                    this.txtUserName.Text = null;
                }
                else
                {
                    this.txtUserName.Text = user.UserName;
                }
                this.categroytype.Text   = GetCategoryName(id);
                ViewState["OldUserName"] = user.UserName == null ? "" : user.UserName;
            }
        }
    }
Beispiel #10
0
    protected void btnExcel_Click(object sender, EventArgs e)
    {
        AdoHelper adoHelper = AdoHelper.CreateHelper("DB_Instance");
        string    filter    = " 1=1 ";

        if (this.showtype == "1")
        {
            filter += " and IfDeal='1'and isnull(IsPayByUnline,'0')='0'";
        }
        else if (this.showtype == "-1")
        {
            filter += " and IfDeal='-1'";
        }
        else if (this.showtype == "0")
        {
            filter += " and IfDeal='0'";
        }
        else if (this.showtype == "99")
        {
            filter += " and IsPayByUnline='1'";
        }

        if (this.txtDateBegin.Value != "")
        {
            filter += " and ApplayTime >= '" + this.txtDateBegin.Value + "'";
        }
        if (this.txtDateEnd.Value != "")
        {
            filter += " and ApplayTime < '" + DateTime.Parse(this.txtDateEnd.Value).AddDays(1) + "'";
        }
        if (this.txtName.Value.Trim() != "")
        {
            filter += " and TrueName like '%" + this.txtName.Value.Trim() + "%'";
        }
        if (this.txtMemberId.Value.Trim() != "")
        {
            filter += " and MemberId in (select memberid from t_member_info where membername like '%" + this.txtMemberId.Value.Trim() + "%' )";
        }
        string sql = "select * from T_Member_ApplayCashBank where " + filter;

        DataSet ds = adoHelper.ExecuteSqlDataset(sql);

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            object obj = adoHelper.ExecuteSqlScalar("select membername from t_member_info where memberid='" + dr["MemberId"] + "'");
            dr["MemberId"] = obj == null ? "无效会员" : obj.ToString();
        }

        /*
         * StringWriter sw = new StringWriter();
         * //MemberId,TrueName,CardNumber,Moeny,ApplayTime,IfDeal,DealRemarks
         * sw.WriteLine("会员名\t姓名\t卡号\t金额\t申请时间\t备注");
         * foreach (DataRow dr in ds.Tables[0].Rows)
         * {
         *  sw.WriteLine(dr["MemberId"] + "\t" + dr["TrueName"] + "\t" + dr["CardNumber"] + "\t" + dr["Moeny"] + "\t" + dr["ApplayTime"] + "\t" + dr["DealRemarks"]);
         * }
         * sw.Close();
         * Response.AddHeader("Content-Disposition", "attachment; filename=已支付的申请.xls");
         * Response.ContentType = "application/ms-excel";
         * Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
         * Response.Write(sw);
         * Response.End();
         */

        ExcelReportIframe1_ReportEvent(ds.Tables[0], "已支付的申请");
    }
Beispiel #11
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModelTestQueston GetModel(string sysnumber)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 * from T_Test_Queston ");
            strSql.Append(" where sysnumber=@sysnumber ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@sysnumber", SqlDbType.VarChar, 255)
            };
            parameters[0].Value = sysnumber;

            ModelTestQueston model = new ModelTestQueston();
            DataSet          ds    = adohelper.ExecuteSqlDataset(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["sysnumber"] != null && ds.Tables[0].Rows[0]["sysnumber"].ToString() != "")
                {
                    model.sysnumber = ds.Tables[0].Rows[0]["sysnumber"].ToString();
                }
                if (ds.Tables[0].Rows[0]["questionType"] != null && ds.Tables[0].Rows[0]["questionType"].ToString() != "")
                {
                    model.questionType = ds.Tables[0].Rows[0]["questionType"].ToString();
                }
                if (ds.Tables[0].Rows[0]["questionTitle"] != null && ds.Tables[0].Rows[0]["questionTitle"].ToString() != "")
                {
                    model.questionTitle = ds.Tables[0].Rows[0]["questionTitle"].ToString();
                }
                if (ds.Tables[0].Rows[0]["questionAnswer"] != null && ds.Tables[0].Rows[0]["questionAnswer"].ToString() != "")
                {
                    model.questionAnswer = ds.Tables[0].Rows[0]["questionAnswer"].ToString();
                }
                if (ds.Tables[0].Rows[0]["orwner"] != null && ds.Tables[0].Rows[0]["orwner"].ToString() != "")
                {
                    model.Orner = ds.Tables[0].Rows[0]["orwner"].ToString();
                }
                if (ds.Tables[0].Rows[0]["description"] != null && ds.Tables[0].Rows[0]["description"].ToString() != "")
                {
                    model.Description = ds.Tables[0].Rows[0]["description"].ToString();
                }

                if (ds.Tables[0].Rows[0]["personFlag"] != null && ds.Tables[0].Rows[0]["personFlag"].ToString() != "")
                {
                    model.personFlag = ds.Tables[0].Rows[0]["personFlag"].ToString();
                }
                if (ds.Tables[0].Rows[0]["levelFlag"] != null && ds.Tables[0].Rows[0]["levelFlag"].ToString() != "")
                {
                    model.levelFlag = ds.Tables[0].Rows[0]["levelFlag"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryFlag"] != null && ds.Tables[0].Rows[0]["categoryFlag"].ToString() != "")
                {
                    model.categoryFlag = ds.Tables[0].Rows[0]["categoryFlag"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categorypath"] != null && ds.Tables[0].Rows[0]["categorypath"].ToString() != "")
                {
                    model.categorypath = ds.Tables[0].Rows[0]["categorypath"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ifCourseQuestion"] != null && ds.Tables[0].Rows[0]["ifCourseQuestion"].ToString() != "")
                {
                    model.ifCourseQuestion = int.Parse(ds.Tables[0].Rows[0]["ifCourseQuestion"].ToString());
                }
                if (ds.Tables[0].Rows[0]["createTime"] != null && ds.Tables[0].Rows[0]["createTime"].ToString() != "")
                {
                    model.createTime = DateTime.Parse(ds.Tables[0].Rows[0]["createTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["createPerson"] != null && ds.Tables[0].Rows[0]["createPerson"].ToString() != "")
                {
                    model.createPerson = ds.Tables[0].Rows[0]["createPerson"].ToString();
                }
                if (ds.Tables[0].Rows[0]["shFlag"] != null && ds.Tables[0].Rows[0]["shFlag"].ToString() != "")
                {
                    model.shFlag = int.Parse(ds.Tables[0].Rows[0]["shFlag"].ToString());
                }
                if (ds.Tables[0].Rows[0]["orderBy"] != null && ds.Tables[0].Rows[0]["orderBy"].ToString() != "")
                {
                    model.orderBy = int.Parse(ds.Tables[0].Rows[0]["orderBy"].ToString());
                }
                if (ds.Tables[0].Rows[0]["courseId"] != null && ds.Tables[0].Rows[0]["courseId"].ToString() != "")
                {
                    model.courseId = ds.Tables[0].Rows[0]["courseId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["isSubQuestion"] != null && ds.Tables[0].Rows[0]["isSubQuestion"].ToString() != "")
                {
                    model.isSubQuestion = int.Parse(ds.Tables[0].Rows[0]["isSubQuestion"].ToString());
                }
                if (ds.Tables[0].Rows[0]["mainQuestionSysnumber"] != null && ds.Tables[0].Rows[0]["mainQuestionSysnumber"].ToString() != "")
                {
                    model.mainQuestionSysnumber = ds.Tables[0].Rows[0]["mainQuestionSysnumber"].ToString();
                }
                if (ds.Tables[0].Rows[0]["LevelPoint"] != null && ds.Tables[0].Rows[0]["LevelPoint"].ToString() != "")
                {
                    model.LevelPoint = decimal.Parse(ds.Tables[0].Rows[0]["LevelPoint"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #12
0
    protected void GetLoadKeyword()
    {
        string strSQL = "Update T_News set ShareToMarket=''  where ShareToMarket is null;";

        strSQL += "Update T_News set ShareToSubject=''  where ShareToSubject is null;";
        strSQL += "Update T_News set ShareToPlatform=''  where ShareToPlatform is null;";
        strSQL += "select * from T_ShareNews;";
        AdoHelper helper = AdoHelper.CreateHelper("DB_Instance");
        DataSet   ds     = helper.ExecuteSqlDataset(strSQL);

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                int    index = Convert.ToInt32(ds.Tables[0].Rows[i]["ShareIndex"]);
                int    type  = Convert.ToInt32(ds.Tables[0].Rows[i]["ShareType"]);
                string ky    = ds.Tables[0].Rows[i]["KeywordList"].ToString();
                if (index == 1)
                {
                    if (type == 1)
                    {
                        TextBox1.Text = ky;
                    }
                    if (type == 2)
                    {
                        TextBox2.Text = ky;
                    }
                    if (type == 3)
                    {
                        TextBox3.Text = ky;
                    }
                    if (type == 1)
                    {
                        TextBox4.Text = ky;
                    }
                }
                if (index == 2)
                {
                    if (type == 1)
                    {
                        TextBox5.Text = ky;
                    }
                    if (type == 2)
                    {
                        TextBox6.Text = ky;
                    }
                    if (type == 3)
                    {
                        TextBox7.Text = ky;
                    }
                    if (type == 4)
                    {
                        TextBox8.Text = ky;
                    }
                    if (type == 5)
                    {
                        TextBox9.Text = ky;
                    }
                    if (type == 6)
                    {
                        TextBox10.Text = ky;
                    }
                    if (type == 7)
                    {
                        TextBox11.Text = ky;
                    }
                    if (type == 8)
                    {
                        TextBox12.Text = ky;
                    }
                    if (type == 9)
                    {
                        TextBox13.Text = ky;
                    }
                }
                if (index == 3)
                {
                    if (type == 1)
                    {
                        TextBox14.Text = ky;
                    }
                    if (type == 2)
                    {
                        TextBox15.Text = ky;
                    }
                    if (type == 3)
                    {
                        TextBox16.Text = ky;
                    }
                }
            }
        }
    }
Beispiel #13
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public GoodsTypeModel GetModel(string CategoryId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 CategoryId,CategoryName,CategoryLevel,PCategoryId,CategoryPath,RootId,CategoryToTypeId,CategoryFlag,Orderby,Remarks,Url,icon from T_Info_Category ");
            strSql.Append(" where CategoryId=@CategoryId ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CategoryId", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = CategoryId;

            GoodsTypeModel model = new GoodsTypeModel();
            DataSet        ds    = adoHelper.ExecuteSqlDataset(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["CategoryId"] != null && ds.Tables[0].Rows[0]["CategoryId"].ToString() != "")
                {
                    model.CategoryId = ds.Tables[0].Rows[0]["CategoryId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CategoryName"] != null && ds.Tables[0].Rows[0]["CategoryName"].ToString() != "")
                {
                    model.CategoryName = ds.Tables[0].Rows[0]["CategoryName"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CategoryLevel"] != null && ds.Tables[0].Rows[0]["CategoryLevel"].ToString() != "")
                {
                    model.CategoryLevel = int.Parse(ds.Tables[0].Rows[0]["CategoryLevel"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PCategoryId"] != null && ds.Tables[0].Rows[0]["PCategoryId"].ToString() != "")
                {
                    model.PCategoryId = ds.Tables[0].Rows[0]["PCategoryId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CategoryPath"] != null && ds.Tables[0].Rows[0]["CategoryPath"].ToString() != "")
                {
                    model.CategoryPath = ds.Tables[0].Rows[0]["CategoryPath"].ToString();
                }
                if (ds.Tables[0].Rows[0]["RootId"] != null && ds.Tables[0].Rows[0]["RootId"].ToString() != "")
                {
                    model.RootId = ds.Tables[0].Rows[0]["RootId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CategoryToTypeId"] != null && ds.Tables[0].Rows[0]["CategoryToTypeId"].ToString() != "")
                {
                    model.CategoryToTypeId = ds.Tables[0].Rows[0]["CategoryToTypeId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CategoryFlag"] != null && ds.Tables[0].Rows[0]["CategoryFlag"].ToString() != "")
                {
                    model.CategoryFlag = ds.Tables[0].Rows[0]["CategoryFlag"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Orderby"] != null && ds.Tables[0].Rows[0]["Orderby"].ToString() != "")
                {
                    model.Orderby = int.Parse(ds.Tables[0].Rows[0]["Orderby"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Remarks"] != null && ds.Tables[0].Rows[0]["Remarks"].ToString() != "")
                {
                    model.Remarks = ds.Tables[0].Rows[0]["Remarks"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Url"] != null && ds.Tables[0].Rows[0]["Url"].ToString() != "")
                {
                    model.Url = ds.Tables[0].Rows[0]["Url"].ToString();
                }
                if (ds.Tables[0].Rows[0]["icon"] != null && ds.Tables[0].Rows[0]["icon"].ToString() != "")
                {
                    model.icon = ds.Tables[0].Rows[0]["icon"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #14
0
    protected DataTable GetAll()
    {
        AdoHelper adohelper = AdoHelper.CreateHelper(StarTech.Util.AppConfig.DBInstance);

        return(adohelper.ExecuteSqlDataset("select sysnumber,courseId,categoryPath from T_Test_Queston ").Tables[0]);
    }
Beispiel #15
0
    /// <summary>
    /// 提交
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        AdoHelper adoHelper  = AdoHelper.CreateHelper("DB_Instance");
        string    id         = lbCouponId.Text.Trim();
        string    coupId     = id;
        string    couponType = ddlCouponType.SelectedValue;
        decimal   value      = 0;

        decimal.TryParse(txtValue.Text, out value);
        string   context   = txtContext.Text;
        DateTime startTime = DateTime.Now;

        DateTime.TryParse(hfStart.Value, out startTime);
        DateTime endTime = DateTime.Now;

        DateTime.TryParse(hfEnd.Value, out endTime);
        int     couponDay    = int.Parse(this.txtDay.Text.Trim());
        string  qrCode       = QRCodeUrl.ImageUrl;
        int     isPost       = cbQF.Checked ? 1 : 0;
        string  postObject   = ddlMember.SelectedValue;
        string  getPlaceInfo = this.ddlGetPlaceInfo.SelectedValue;
        decimal minPrice     = decimal.Parse(this.txtMinPrice.Text.Trim());

        DataTable dt    = new DataTable();
        int       index = 1;

        if (couponType == "DJ")
        {
            string strMem = "select memberId,tel from T_Member_Info ";
            if (postObject == "new")
            {
                strMem += " where memberId,tel not in (select memberId from T_Base_Coupon);";
            }
            DataSet ds = adoHelper.ExecuteSqlDataset(strMem);

            if (ds != null || ds.Tables.Count < 1 || ds.Tables[0].Rows.Count < 1)
            {
                dt = ds.Tables[0];
            }
            index = ds.Tables[0].Rows.Count;
        }

        string cid = (lbCouponId.Text).Trim();


        int           effect     = cbEffect.Checked ? 1 : 0;
        int           use        = lbUse.Text == "已使用"?1:0;
        string        remark     = txtRemark.Text;
        string        couponCode = id;
        StringBuilder strSql     = new StringBuilder();

        if (couponId == "")
        {
            int success = 0;
            int fail    = 0;
            for (int i = 0; i < index; i++)
            {
                string memberId = "";
                if (dt.Rows.Count > 0)
                {
                    memberId = dt.Rows[i][0].ToString();
                }
                coupId = id + i.ToString().PadLeft(6, '0');
                if (couponType == "CZ")
                {
                    cid = "http://" + System.Web.Configuration.WebConfigurationManager.AppSettings["coupon"].ToString() + "/Coupon.aspx?type=CZ&cid=" + coupId;
                    QRCode qrc = new QRCode(cid);
                    qrCode             = qrc.CreateQRCode();
                    QRCodeUrl.ImageUrl = qrCode;
                }
                strSql.Clear();
                strSql.Append("insert into T_Base_Coupon(");
                strSql.Append("CouponId,CouponType,CouponValue,Context,StartTime,EndTime,QRCodeUrl,isEffect,isUse,Remark,isPost,postObject,CouponCode,MemberId,CouponDay,GetPlaceInfo,minPrice)");
                strSql.Append(" values (");
                strSql.Append("@CouponId,@CouponType,@CouponValue,@Context,@StartTime,@EndTime,@QRCodeUrl,@isEffect,@isUse,@Remark,@isPost,@postObject,@CouponCode,@MemberId,@CouponDay,@GetPlaceInfo,@minPrice)");
                SqlParameter[] parameters =
                {
                    new SqlParameter("@CouponId",     SqlDbType.VarChar),
                    new SqlParameter("@CouponType",   SqlDbType.VarChar),
                    new SqlParameter("@CouponValue",  SqlDbType.Decimal),
                    new SqlParameter("@Context",      SqlDbType.VarChar),
                    new SqlParameter("@StartTime",    SqlDbType.DateTime),
                    new SqlParameter("@EndTime",      SqlDbType.DateTime),
                    new SqlParameter("@QRCodeUrl",    SqlDbType.VarChar),
                    new SqlParameter("@isEffect",     SqlDbType.Int),
                    new SqlParameter("@isUse",        SqlDbType.Int),
                    new SqlParameter("@Remark",       SqlDbType.VarChar),
                    new SqlParameter("@isPost",       SqlDbType.Int),
                    new SqlParameter("@postObject",   SqlDbType.VarChar),
                    new SqlParameter("@CouponCode",   SqlDbType.VarChar),
                    new SqlParameter("@MemberId",     SqlDbType.VarChar),
                    new SqlParameter("@CouponDay",    SqlDbType.Int),
                    new SqlParameter("@GetPlaceInfo", SqlDbType.VarChar),
                    new SqlParameter("@minPrice",     SqlDbType.Decimal)
                };
                parameters[0].Value  = coupId;;
                parameters[1].Value  = couponType;
                parameters[2].Value  = value;
                parameters[3].Value  = context;
                parameters[4].Value  = startTime;
                parameters[5].Value  = endTime;
                parameters[6].Value  = qrCode;
                parameters[7].Value  = effect;
                parameters[8].Value  = use;
                parameters[9].Value  = remark;
                parameters[10].Value = isPost;
                parameters[11].Value = postObject;
                parameters[12].Value = couponCode;
                parameters[13].Value = memberId;
                parameters[14].Value = couponDay;
                parameters[15].Value = getPlaceInfo;
                parameters[16].Value = minPrice;

                int rows = adoHelper.ExecuteSqlNonQuery(strSql.ToString(), parameters);
                if (rows > 0)
                {
                    if (isPost == 1)
                    {
                        new MobileInfo().GetMess(dt.Rows[i][1].ToString(), context);
                    }
                    success++;
                    //this.ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('添加成功');layer_close_refresh();</script>");
                    couponId = id;
                }
                else
                {
                    fail++;
                }
            }

            //LogAdd.CreateLog(Session["UserId"].ToString(), "添加优惠卷“" + context + "共" + success + "张”", "添加", "", "", Request.Url.ToString());
            this.ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('成功添加优惠卷设置');layer_close_refresh();</script>");
        }
        else
        {
            //if (couponType == "CZ")
            //    cid = "http://" + System.Web.Configuration.WebConfigurationManager.AppSettings["coupon"].ToString() + "/Coupon.aspx?type=DJ&cid=" + cid;
            //QRCode qrc = new QRCode(cid);
            //qrCode = qrc.CreateQRCode();
            //QRCodeUrl.ImageUrl = qrCode;

            //StringBuilder strSql = new StringBuilder();
            strSql.Append("update  T_Base_Coupon set ");
            strSql.Append("CouponType=@CouponType,CouponValue=@CouponValue,Context=@Context,StartTime=@StartTime,EndTime=@EndTime,QRCodeUrl=@QRCodeUrl,isEffect=@isEffect,isUse=@isUse,Remark=@Remark,isPost=@isPost,postObject=@postObject,CouponDay=@CouponDay,GetPlaceInfo=@GetPlaceInfo,minPrice=@minPrice ");
            strSql.Append(" where CouponId=@CouponId");
            strSql.Append("");
            SqlParameter[] parameters =
            {
                //new SqlParameter("@CouponId", SqlDbType.VarChar,50),
                new SqlParameter("@CouponType",   SqlDbType.VarChar,   50),
                new SqlParameter("@CouponValue",  SqlDbType.Int,        4),
                new SqlParameter("@Context",      SqlDbType.VarChar,   50),
                new SqlParameter("@StartTime",    SqlDbType.DateTime),
                new SqlParameter("@EndTime",      SqlDbType.DateTime),
                new SqlParameter("@QRCodeUrl",    SqlDbType.VarChar),
                new SqlParameter("@isEffect",     SqlDbType.Int),
                new SqlParameter("@isUse",        SqlDbType.Int),
                new SqlParameter("@Remark",       SqlDbType.VarChar),
                new SqlParameter("@isPost",       SqlDbType.Int),
                new SqlParameter("@postObject",   SqlDbType.VarChar),
                new SqlParameter("@CouponDay",    SqlDbType.Int),
                new SqlParameter("@CouponId",     SqlDbType.VarChar),
                new SqlParameter("@GetPlaceInfo", SqlDbType.VarChar),
                new SqlParameter("@minPrice",     SqlDbType.Decimal)
            };
            parameters[0].Value  = couponType;
            parameters[1].Value  = value;
            parameters[2].Value  = context;
            parameters[3].Value  = startTime;
            parameters[4].Value  = endTime;
            parameters[5].Value  = qrCode;
            parameters[6].Value  = effect;
            parameters[7].Value  = use;
            parameters[8].Value  = remark;
            parameters[9].Value  = isPost;
            parameters[10].Value = postObject;
            parameters[11].Value = couponDay;
            parameters[12].Value = id;
            parameters[12].Value = getPlaceInfo;
            parameters[13].Value = minPrice;
            int rows = adoHelper.ExecuteSqlNonQuery(strSql.ToString(), parameters);
            if (rows > 0)
            {
                //LogAdd.CreateLog(Session["UserId"].ToString(), "修改优惠卷“" + context + "”", "修改", "", "", Request.Url.ToString());
                this.ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('修改成功');layer_close_refresh();</script>");
                GetData();
            }
        }
    }
Beispiel #16
0
    /// <summary>
    /// 返回数据集DataSet
    /// </summary>
    /// <param name="strSql">sql语句</param>
    /// <returns></returns>
    public static DataSet ExecuteSqlDataset(string strSql)
    {
        AdoHelper helper = AdoHelper.CreateHelper("DB_Instance");

        return(helper.ExecuteSqlDataset(strSql));
    }
Beispiel #17
0
    public void CreateRndQuestions(string testSysnumber)
    {
        string    rndQuestions    = "";
        string    zyQuestions     = "";
        string    courseQuestions = "";
        AdoHelper ado             = AdoHelper.CreateHelper("DB_Instance");
        //本专业
        DataSet ds = ado.ExecuteSqlDataset("select * from T_Test_day_item where testSysnumber='" + testSysnumber + "' and categoryId='Current'");

        foreach (DataRow row in ds.Tables[0].Rows)
        {
            string sql = "select top " + row["num"] + " sysnumber from T_Test_Queston where " + GetPersonFlagFilter(row["categoryId"].ToString()) + " and personFlag like '%%'  and questionType='" + row["qType"] + "' and isnull(isSubQuestion,0)=0 and isnull(courseId,'')='' order by newid()";
            //Response.Write(sql+";<br>");
            DataSet dsQ   = ado.ExecuteSqlDataset(sql);
            int     flagI = 0;
            string  ids   = "";
            foreach (DataRow rowQ in dsQ.Tables[0].Rows)
            {
                if (flagI > 100)
                {
                    break;
                }
                ids += rowQ["sysnumber"].ToString() + ",";
                flagI++;
            }
            if (ids != "")
            {
                ids          = ids.TrimEnd(',');
                zyQuestions += "," + ids;
            }
        }
        this.hidZYQuestions.Value = zyQuestions.TrimStart(',').TrimEnd(',');

        //课后练习
        DataSet dscourse = ado.ExecuteSqlDataset("select * from T_Test_day_item where testSysnumber='" + testSysnumber + "' and categoryId='Course'");

        foreach (DataRow row in dscourse.Tables[0].Rows)
        {
            string sql = "select top " + row["num"] + " sysnumber from T_Test_Queston where " + GetPersonFlagFilter(row["categoryId"].ToString()) + " and personFlag like '%%' and questionType='" + row["qType"] + "' and isnull(isSubQuestion,0)=0 and sysnumber not in('" + zyQuestions.Replace(",", "','") + "') order by newid()";
            //Response.Write(sql + ";<br>");
            DataSet dsQ   = ado.ExecuteSqlDataset(sql);
            int     flagI = 0;
            string  ids   = "";
            foreach (DataRow rowQ in dsQ.Tables[0].Rows)
            {
                if (flagI > 100)
                {
                    break;
                }
                ids += rowQ["sysnumber"].ToString() + ",";
                flagI++;
            }
            if (ids != "")
            {
                ids              = ids.TrimEnd(',');
                courseQuestions += "," + ids;
            }
        }
        this.hidCourseQuestions.Value = courseQuestions.TrimStart(',').TrimEnd(',');


        //大专业、公共
        DataSet ds2 = ado.ExecuteSqlDataset("select * from T_Test_day_item where testSysnumber='" + testSysnumber + "' and categoryId in('Parent','Common')");

        foreach (DataRow row in ds2.Tables[0].Rows)
        {
            string hasExsitsQuestions = zyQuestions + courseQuestions.Replace(",,", ",");
            string sql = "select top " + row["num"] + " sysnumber from T_Test_Queston where " + GetPersonFlagFilter(row["categoryId"].ToString()) + " and personFlag like '%%' and questionType='" + row["qType"] + "' and isnull(isSubQuestion,0)=0 and isnull(courseId,'')='' and sysnumber not in('" + hasExsitsQuestions.Replace(",", "','") + "') order by newid()";
            //Response.Write(sql + ";<br>");
            DataSet dsQ   = ado.ExecuteSqlDataset(sql);
            int     flagI = 0;
            string  ids   = "";
            foreach (DataRow rowQ in dsQ.Tables[0].Rows)
            {
                if (flagI > 100)
                {
                    break;
                }
                ids += rowQ["sysnumber"].ToString() + ",";
                flagI++;
            }
            if (ids != "")
            {
                ids           = ids.TrimEnd(',');
                rndQuestions += "," + ids;
            }
        }
        this.hidOtherQuestions.Value = rndQuestions.TrimStart(',').TrimEnd(',');

        this.hidRndQuestions.Value = zyQuestions + "," + courseQuestions.TrimStart(',').TrimEnd(',') + "," + rndQuestions.TrimStart(',').TrimEnd(',');
    }
Beispiel #18
0
    /// <summary>
    /// 绑定信息
    /// </summary>
    protected void BindInfo()
    {
        string strSQL = "select * from T_Order_Info where orderId='" + OrderId + "';";

        strSQL += "select * from T_Order_InfoDetail  where orderId='" + OrderId + "';";


        DataSet ds = adoHelper.ExecuteSqlDataset(strSQL);

        if (ds == null)
        {
            return;
        }

        string strSQL2 = "";

        for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
        {
            strSQL2 += "select shopName from T_Shop_User where shopId='" + ds.Tables[1].Rows[i]["ProviderInfo"] + "'";
        }
        DataSet       dsShop       = adoHelper.ExecuteSqlDataset(strSQL2);
        List <string> shopNameList = new List <string>();

        for (int i = 0; i < dsShop.Tables.Count; i++)
        {
            if (dsShop.Tables[i].Rows.Count > 0)
            {
                shopNameList.Add(dsShop.Tables[i].Rows[0][0].ToString());
            }
            else
            {
                shopNameList.Add("");
            }
        }
        lbRemarks.Text          = ds.Tables[0].Rows[0]["MemberOrderRemarks"].ToString();
        lbOrderId.Text          = ds.Tables[0].Rows[0]["orderId"].ToString();
        lbMember.Text           = ds.Tables[0].Rows[0]["memberName"].ToString();
        lbOrderTime.Text        = ds.Tables[0].Rows[0]["OrderTime"].ToString();
        lbMoney.Text            = ds.Tables[0].Rows[0]["OrderAllMoney"].ToString();
        lbReceiveAddress.Text   = ds.Tables[0].Rows[0]["ReceivePerson"].ToString() + " " + ds.Tables[0].Rows[0]["ReceiveAddressCode"].ToString().Replace("|", "") + " " + ds.Tables[0].Rows[0]["ReceiveAddressDetail"].ToString() + " " + ds.Tables[0].Rows[0]["PostCode"].ToString();
        llFreight.Text          = ds.Tables[0].Rows[0]["Freight"].ToString();
        llRemark.Text           = GetMemberPrice(ds.Tables[0].Rows[0]["orderId"].ToString());
        this.txtPayLogInfo.Text = PayLog(ds.Tables[0].Rows[0]["orderId"].ToString());
        string statu = "";

        string  strPost = "select * from T_Postman_Task where orderId='" + ds.Tables[0].Rows[0]["orderId"].ToString() + "';";
        DataSet dsPost  = adoHelper.ExecuteSqlDataset(strPost);
        string  postMan = "";

        if (dsPost != null && dsPost.Tables.Count > 0 && dsPost.Tables[0].Rows.Count > 0)
        {
            postMan = dsPost.Tables[0].Rows[0]["postman_name"].ToString();
        }

        if (ds.Tables[0].Rows[0]["ispay"].ToString() != "1" && ds.Tables[0].Rows[0]["isComplete"].ToString() != "1")
        {
            statu = "未付款";
        }
        else if (ds.Tables[0].Rows[0]["ispay"].ToString() == "1" && ds.Tables[0].Rows[0]["isComplete"].ToString() != "1")
        {
            statu = "已付款" + " \r\n付款时间:" + ds.Tables[0].Rows[0]["paytime"].ToString();
        }
        else if (ds.Tables[0].Rows[0]["isComplete"].ToString() == "1")
        {
            statu = "已完成" + " \r\n付款时间:" + ds.Tables[0].Rows[0]["paytime"].ToString() + "\r\n完成时间:" + ds.Tables[0].Rows[0]["CompleteTime"].ToString() + "";
        }



        lbStatu.Text = statu;


        //if ((ds.Tables[0].Rows[0]["SellerId"] != DBNull.Value && ds.Tables[0].Rows[0]["SellerId"].ToString() != ""))
        //{
        //    strSQL = "select shopName from T_Shop_User where shopid='" + ds.Tables[0].Rows[0]["SellerId"].ToString() + "';";
        //    DataSet ds2 = adoHelper.ExecuteSqlDataset(strSQL);
        //    if (ds2 != null && ds2.Tables.Count > 0 && ds2.Tables[0].Rows.Count > 0)
        //    {
        //        lbSeller.Text = ds2.Tables[0].Rows[0][0].ToString();
        //    }
        //    //lbSeller.Text = ds.Tables[0].Rows[0]["orderId"].ToString();
        //}
        if (ds.Tables.Count > 1 && ds.Tables[1].Rows.Count > 0)
        {
            string goodsList = "<table>";
            for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
            {
                goodsList += "<tr>";
                goodsList += "<td><img src='" + ds.Tables[1].Rows[i]["goodsPic"] + "' width='50' height='50' /></td>";
                goodsList += "<td>" + ds.Tables[1].Rows[i]["goodsName"] + " " + ds.Tables[1].Rows[i]["goodsformate"] + "</td>";
                goodsList += "<td>" + ds.Tables[1].Rows[i]["quantity"] + "</td>";
                goodsList += "<td>" + ds.Tables[1].Rows[i]["allMoney"] + "</td>";
                goodsList += "<td>" + shopNameList[i] + "</td>";
                //goodsList += "<td></td>";
                //goodsList += "<td></td>";
                goodsList += "</tr>";
            }
            goodsList   += "</table>";
            llGoods.Text = goodsList;
        }
    }
Beispiel #19
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModelTestday GetModel(string Sysnumber)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select * from T_Test_day ");
            strSql.Append(" where Sysnumber=@Sysnumber");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Sysnumber", SqlDbType.VarChar, 255)
            };
            parameters[0].Value = Sysnumber;

            ModelTestday model = new ModelTestday();
            DataSet      ds    = adoHelper.ExecuteSqlDataset(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["Sysnumber"] != null && ds.Tables[0].Rows[0]["Sysnumber"].ToString() != "")
                {
                    model.Sysnumber = ds.Tables[0].Rows[0]["Sysnumber"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Title"] != null && ds.Tables[0].Rows[0]["Title"].ToString() != "")
                {
                    model.Title = ds.Tables[0].Rows[0]["Title"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Remarks"] != null && ds.Tables[0].Rows[0]["Remarks"].ToString() != "")
                {
                    model.Remarks = ds.Tables[0].Rows[0]["Remarks"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Questions"] != null && ds.Tables[0].Rows[0]["Questions"].ToString() != "")
                {
                    model.Questions = ds.Tables[0].Rows[0]["Questions"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Addtime"] != null && ds.Tables[0].Rows[0]["Addtime"].ToString() != "")
                {
                    model.Addtime = DateTime.Parse(ds.Tables[0].Rows[0]["Addtime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["type"] != null && ds.Tables[0].Rows[0]["type"].ToString() != "")
                {
                    model.Type = Convert.ToInt32(ds.Tables[0].Rows[0]["type"]);
                }
                if (ds.Tables[0].Rows[0]["chapterId"] != null && ds.Tables[0].Rows[0]["chapterId"].ToString() != "")
                {
                    model.chapterId = Convert.ToInt32(ds.Tables[0].Rows[0]["chapterId"]);
                }
                model.courseType  = ds.Tables[0].Rows[0]["courseType"].ToString();
                model.personFlag  = ds.Tables[0].Rows[0]["personFlag"].ToString();
                model.levelFlag   = ds.Tables[0].Rows[0]["levelFlag"].ToString();
                model.addMemberId = ds.Tables[0].Rows[0]["addMemberId"].ToString();
                model.shFlag      = ds.Tables[0].Rows[0]["shFlag"].ToString();
                if (ds.Tables[0].Rows[0]["startime"] != null && ds.Tables[0].Rows[0]["startime"].ToString() != "")
                {
                    model.startime = DateTime.Parse(ds.Tables[0].Rows[0]["startime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["endtime"] != null && ds.Tables[0].Rows[0]["endtime"].ToString() != "")
                {
                    model.endtime = DateTime.Parse(ds.Tables[0].Rows[0]["endtime"].ToString());
                }
                model.ZjMethod = ds.Tables[0].Rows[0]["ZjMethod"].ToString();

                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #20
0
    protected DataTable GetUserInfo(string WXOpenId)
    {
        DataTable dt = adoHelper.ExecuteSqlDataset("select * from T_Member_Info where WXOpenId='" + WXOpenId + "'").Tables[0];

        return(dt);
    }
Beispiel #21
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MenuModel GetModel(string menuId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 isTop,signId,menuId,menuName,Technology,Flavor,CookingTime,Calorie,CookingSkill,UserId,AddTime,isShow,imgSrc,smallImgSrc,categoryId from T_Menu_Info ");
            strSql.Append(" where menuId=@menuId");
            SqlParameter[] parameters =
            {
                new SqlParameter("@menuId", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = menuId;

            MenuModel model = new MenuModel();
            DataSet   ds    = adoHelper.ExecuteSqlDataset(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["menuId"] != null && ds.Tables[0].Rows[0]["menuId"].ToString() != "")
                {
                    model.menuId = ds.Tables[0].Rows[0]["menuId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["menuName"] != null && ds.Tables[0].Rows[0]["menuName"].ToString() != "")
                {
                    model.menuName = ds.Tables[0].Rows[0]["menuName"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Technology"] != null && ds.Tables[0].Rows[0]["Technology"].ToString() != "")
                {
                    model.Technology = ds.Tables[0].Rows[0]["Technology"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Flavor"] != null && ds.Tables[0].Rows[0]["Flavor"].ToString() != "")
                {
                    model.Flavor = ds.Tables[0].Rows[0]["Flavor"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CookingTime"] != null && ds.Tables[0].Rows[0]["CookingTime"].ToString() != "")
                {
                    model.CookingTime = ds.Tables[0].Rows[0]["CookingTime"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Calorie"] != null && ds.Tables[0].Rows[0]["Calorie"].ToString() != "")
                {
                    model.Calorie = decimal.Parse(ds.Tables[0].Rows[0]["Calorie"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CookingSkill"] != null && ds.Tables[0].Rows[0]["CookingSkill"].ToString() != "")
                {
                    model.CookingSkill = ds.Tables[0].Rows[0]["CookingSkill"].ToString();
                }
                if (ds.Tables[0].Rows[0]["UserId"] != null && ds.Tables[0].Rows[0]["UserId"].ToString() != "")
                {
                    model.UserId = ds.Tables[0].Rows[0]["UserId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AddTime"] != null && ds.Tables[0].Rows[0]["AddTime"].ToString() != "")
                {
                    model.AddTime = DateTime.Parse(ds.Tables[0].Rows[0]["AddTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["isShow"] != null && ds.Tables[0].Rows[0]["isShow"].ToString() != "")
                {
                    model.isShow = int.Parse(ds.Tables[0].Rows[0]["isShow"].ToString());
                }
                if (ds.Tables[0].Rows[0]["imgSrc"] != null && ds.Tables[0].Rows[0]["imgSrc"].ToString() != "")
                {
                    model.imgSrc = ds.Tables[0].Rows[0]["imgSrc"].ToString();
                }
                if (ds.Tables[0].Rows[0]["smallImgSrc"] != null && ds.Tables[0].Rows[0]["smallImgSrc"].ToString() != "")
                {
                    model.smallImgSrc = ds.Tables[0].Rows[0]["smallImgSrc"].ToString();
                }
                if (ds.Tables[0].Rows[0]["categoryId"] != null && ds.Tables[0].Rows[0]["categoryId"].ToString() != "")
                {
                    model.categoryId = ds.Tables[0].Rows[0]["categoryId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["signId"] != null && ds.Tables[0].Rows[0]["signId"].ToString() != "")
                {
                    model.signId = ds.Tables[0].Rows[0]["signId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["isTop"] != null && ds.Tables[0].Rows[0]["isTop"].ToString() != "")
                {
                    int isTop = 0;
                    int.TryParse(ds.Tables[0].Rows[0]["isTop"].ToString(), out isTop);
                    model.isTop = isTop;
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #22
0
    /// <summary>
    /// 获取短信验证码
    /// </summary>
    /// <param name="mobile"></param>
    /// <returns></returns>
    public string GetMess(string mobile, string info)
    {
        //return "{\"result\":\"canUse\"}";
        mobile = StarTech.KillSqlIn.Form_ReplaceByString(mobile, 20);
        string  strSQL = "select outSendTime from T_ShortMessage_Log where tel='" + mobile + "' order by sendtime desc;";
        DataSet ds     = adoHelper.ExecuteSqlDataset(strSQL);

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            DateTime outTime = Convert.ToDateTime(ds.Tables[0].Rows[0][0]);
            if (outTime >= DateTime.Now)
            {
                return("{\"result\":\"wait\"}");
            }
        }
        if (ds == null)
        {
            return("{\"result\":\"dataError\"}");
        }
        string json = "";
        //string yzm = new Random().Next(0, 9999).ToString().PadLeft(4,'0');
        //string message = "才通天下微信公号验证码为"+yzm+",请不要将此短信泄露给其他人";
        //string message = yzm+"(才通天下微信公号验证码),感谢您使用才通天下微信公号平台,咨询电话0571-88930567【才通天下微信公号】";
        string message = info + "【才通天下微信公号】";
        //string userName = "******";
        //string pwd = "Hzyk20150428hzsd";
        string userName = "******";
        string pwd      = "key-c984e096bc3d8480df72e20a5216a7e4";
        string url      = "https://sms-api.luosimao.com/v1/send.json";

        byte[]         byteArray  = Encoding.UTF8.GetBytes("mobile=" + mobile + "&message=" + message);
        HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(new Uri(url));

        string auth = "Basic " + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes(userName + ":" + pwd));

        webRequest.Headers.Add("Authorization", auth);
        webRequest.Method        = "POST";
        webRequest.ContentType   = "application/x-www-form-urlencoded";
        webRequest.ContentLength = byteArray.Length;

        Stream newStream = webRequest.GetRequestStream();

        newStream.Write(byteArray, 0, byteArray.Length);
        newStream.Close();

        HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
        StreamReader    php      = new StreamReader(response.GetResponseStream(), Encoding.Default);
        string          Message  = php.ReadToEnd();
        string          statu    = "fail";

        if (Message.Contains("error\":0"))
        {
            statu = "success";
        }

        return(statu);
        //string gid = Guid.NewGuid().ToString();
        //strSQL = "insert T_ShortMessage_Log values('"+gid+"','"+mobile+"','"+yzm+"','"+statu+"','"+DateTime.Now+"','"+DateTime.Now.AddSeconds(30)+"','');";
        //int rows = adoHelper.ExecuteSqlNonQuery(strSQL);
        //json = "{\"result\":\""+statu+"\",\"yzm\":\""+yzm+"\",\"message\":["+Message+"],\"sendTime\":\""+DateTime.Now+"\"}";

        //return json;
    }
Beispiel #23
0
    /// <summary>
    /// 返回数据集DataTable
    /// </summary>
    /// <param name="strSql">sql语句</param>
    /// <returns></returns>
    public static DataTable ExecuteSqlDataTable(string strSql)
    {
        AdoHelper helper = AdoHelper.CreateHelper("DB_Instance");

        return(helper.ExecuteSqlDataset(strSql).Tables[0]);
    }
Beispiel #24
0
    /// <summary>
    /// 订单主表T_Order_Info
    /// </summary>
    public string AddOrderByFree(string MemberId, string GoodsId, string CouponId)
    {
        //判断重复下单
        if (ado.ExecuteSqlScalar("select orderId from T_Order_Info where  MemberId='" + MemberId + "' and IsPay=1 and orderId in (select orderId from T_Order_InfoDetail where [GoodsId]='" + GoodsId + "')") != null)
        {
            return("error|重复下单");
        }

        //读取报价表和其他信息
        DataTable dtPrice = ado.ExecuteSqlDataset("select * from T_Goods_Info where GoodsId='" + GoodsId + "'").Tables[0];

        if (dtPrice.Rows.Count == 0)
        {
            return("error|数据异常");
        }
        decimal OrderAllMoney = decimal.Parse(dtPrice.Rows[0]["SalePrice"].ToString());     //(重要)订单价格
        string  JobType       = dtPrice.Rows[0]["JobType"].ToString();

        //会员表
        DataTable dtMember = ado.ExecuteSqlDataset("select * from T_Member_Info where MemberId='" + MemberId + "'").Tables[0];

        if (dtMember.Rows.Count == 0)
        {
            return("error|数据异常");
        }
        string MemberName    = dtMember.Rows[0]["MemberName"].ToString();
        string TrueName      = dtMember.Rows[0]["TrueName"].ToString();
        string AddressCode   = dtMember.Rows[0]["AddressCode"].ToString();
        string AddressDetail = dtMember.Rows[0]["AddressDetail"].ToString();
        string PostCode      = dtMember.Rows[0]["PostCode"].ToString();

        //优惠券信息
        decimal TicketMoney = 0;

        if (CouponId != "")
        {
            object objCouponValue = ado.ExecuteSqlScalar("select CouponValue from T_Member_Coupon where MemberId='" + MemberId + "' and CouponId='" + CouponId + "' and isnull(IsUsed,0)=0 and EndTime>getdate()");
            TicketMoney = objCouponValue == null ? 0 : decimal.Parse(objCouponValue.ToString());
        }

        //订单主表(订单主信息,包括人员信息和价格信息等)
        ModOrder mod = new ModOrder();

        //订单基本信息
        mod.OrderId    = DateTime.Now.ToString("yyyyMMddHHmmss") + MemberId + new Random().Next(1000, 9999).ToString();
        mod.OrderType  = JobType;                                        //(重要)订单类型,和工作类型关联:全包(QB)、钟点工(DG)
        mod.OrderTime  = DateTime.Now;
        mod.SendMethod = "off";
        mod.PayMethod  = "线下支付";


        //雇员信息
        mod.MemberId             = MemberId;                            //(重要)雇员编号
        mod.MemberName           = MemberName;
        mod.MemberOrderRemarks   = "后台下单";                              //订单备注(备用)
        mod.ReceivePerson        = TrueName;
        mod.ReceiveAddressCode   = AddressCode;
        mod.ReceiveAddressDetail = AddressDetail;
        mod.PostCode             = PostCode;



        //优惠券信息
        mod.couponId    = CouponId;                                     //(重要)优惠券编号
        mod.oldMoney    = OrderAllMoney;                                //(重要)订单原始价格(优惠券抵用前)
        mod.TicketMoney = TicketMoney;                                  //(重要)优惠券金额

        //价格信息
        mod.OrderAllMoney  = OrderAllMoney - TicketMoney;                             //(重要)订单价格
        mod.GoodsAllMoney  = OrderAllMoney - TicketMoney;
        mod.OrderAllWeight = 0;


        //支付信息
        mod.IsPay            = 1;                               //(重要)是否支付
        mod.PayInterfaceCode = "";                              //第三方支付接口提交的编号,查账用
        mod.PayMethod        = "后台下单";                          //支付方式(支付宝ZFB,微信WX等)
        mod.PayTime          = DateTime.Now;                    //支付时间


        //创建订单
        if (new BllOrder().Add(mod) > 0)
        {
            //明细信息
            AddOrderDetail(mod.OrderId, mod.OrderType, GoodsId);
        }

        return(mod.OrderId);
    }
Beispiel #25
0
    protected void InitForm()
    {
        //string signList = "";
        string sign = "";

        if (this.id != "")
        {
            GoodsModel mod = bll.GetModel(this.id);
            if (mod != null)
            {
                this.txtName.Value      = mod.GoodsName;
                this.txtOrder.Value     = mod.Orderby.ToString();
                this.txtRemarks.Text    = mod.Remarks;
                this.div_img.Visible    = true;
                this.Image1.ImageUrl    = mod.GoodsSmallPic;
                this.txtSampleDesc.Text = mod.GoodsSampleDesc;
                this.hzst_ckeditor.Text = mod.GoodsDesc;
                this.cselect.categoryID = mod.CategoryId;

                this.goodsCode = this.txtGoodsCode.Value = mod.GoodsCode;
                if (mod.IsHot == 1)
                {
                    this.cbIsHot.Checked = true;
                }
                if (mod.IsNew == 1)
                {
                    this.cbIsNew.Checked = true;
                }
                if (mod.IsRec == 1)
                {
                    this.cbIsRec.Checked = true;
                }
                //if (mod.IsSpe == 1) { this.cbIsSpe.Checked = true; }
                this.txtSalePrice.Value   = mod.SalePrice.ToString();
                this.txtMarketPrice.Value = mod.MarketPrice.ToString();
                if (mod.MorePropertys != "")
                {
                    this.ddlMorePropertys.SelectedValue = mod.MorePropertys;
                }
                this.rdIsSale.SelectedValue = mod.IsSale.ToString();
                this.hidOldGoodsCode.Value  = mod.GoodsCode;

                sign         = mod.signId;
                hfSign.Value = sign;

                //20160605

                //this.txtJobStartTime.Value = mod.JobStartTime.ToString("yyyy-MM-dd HH:mm");
                //this.txtJobEndTime.Value = mod.JobEndTime.ToString("yyyy-MM-dd HH:mm");
                this.ddlJobType.Value        = mod.JobType;
                this.txtTotalSaleCount.Value = mod.TotalSaleCount.ToString();

                //this.llRemark.Text = GetMemberPrice(this.id);
            }
        }
        else
        {
            this.txtGoodsCode.Value = IdCreator.CreateId("T_Goods_Info", "GoodsCode");
            if (this.cateId != "")   //this.ddlPCategory.SelectedValue = this.cateId;
            {
                this.cselect.categoryID = this.cateId;
            }
            //this.txtJobStartTime.Value = this.txtJobEndTime.Value = DateTime.Now.ToString("yyyy-MM-dd");
        }

        string strSQL = "";

        strSQL += "select * from T_Goods_Sign;";
        strSQL += "select * from T_Goods_Service order by orderby asc;";
        //strSQL += "select * from T_Goods_SignBind where goodsid='" + id + "';";
        AdoHelper     adohelper   = AdoHelper.CreateHelper(StarTech.Util.AppConfig.DBInstance);
        DataSet       ds          = adohelper.ExecuteSqlDataset(strSQL);
        List <string> signList    = new List <string>();
        List <string> serviceList = new List <string>();

        if (sign != "" && sign != null)
        {
            signList = sign.Split(',').ToList();
        }

        string llText = "";

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            if (signList.Contains(ds.Tables[0].Rows[i]["signid"].ToString().Trim()))
            {
                llText += "<input checked='checked' type='checkbox' signname='" + ds.Tables[0].Rows[i]["signname"].ToString() + "' signid='" + ds.Tables[0].Rows[i]["signid"].ToString() + "' class='ckSign' />";
            }
            else
            {
                llText += "<input type='checkbox' signname='" + ds.Tables[0].Rows[i]["signname"].ToString() + "' signid='" + ds.Tables[0].Rows[i]["signid"].ToString() + "' class='ckSign' />";
            }
            llText += ds.Tables[0].Rows[i]["signname"].ToString();
            if ((i + 1) % 6 == 0)
            {
                llText += "<br/>";
            }
            ltSign.Text = llText;
        }
    }
Beispiel #26
0
    protected void btnExcel_Click(object sender, EventArgs e)
    {
        AdoHelper adoHelper = AdoHelper.CreateHelper("DB_Instance");
        string    filter    = " 1=1 ";

        if (this.txtDateBegin.Value != "")
        {
            filter += " and OrderTime >= '" + this.txtDateBegin.Value + "'";
        }
        if (this.txtDateEnd.Value != "")
        {
            filter += " and OrderTime < '" + DateTime.Parse(this.txtDateEnd.Value).AddDays(1) + "'";
        }
        //if (this.txtName.Value.Trim() != "")
        //{
        //    filter += " and TrueName like '%" + this.txtName.Value.Trim() + "%'";
        //}
        //if (this.txtMemberId.Value.Trim() != "")
        //{
        //    filter += " and MemberId in (select memberid from t_member_info where membername like '%" + this.txtMemberId.Value.Trim() + "%' )";
        //}
        string statu    = Request.QueryString["statu"];
        string filename = "全部";

        if (statu == "complete")
        {
            //完成
            filter  += " and isComplete=1 ";
            filename = "已完成";
        }
        if (statu == "pay")
        {
            //已支付
            filter  += " and ispay=1 and issend=0 ";
            filename = "已支付";
        }
        if (statu == "nopay")
        {
            //未支付
            filter  += " and ispay=0 ";
            filename = "未支付";
        }
        if (statu == "send")
        {
            //已发货
            filter  += " and issend=1 and isComplete=0 ";
            filename = "已发货";
        }



        string sql = "select orderId,OrderType,memberName,orderTime,orderAllMoney,'任务列表' as goodsList from T_Order_Info where " + filter;

        DataSet ds = adoHelper.ExecuteSqlDataset(sql);

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            dr["goodsList"] = GetGoodsInfoByOrderId(dr["orderid"].ToString());
            dr["OrderType"] = dr["OrderType"].ToString() == "QB" ? "全包" : "点工";
        }


        ExcelReportIframe1_ReportEvent(ds.Tables[0], filename + "订单信息");


        /*
         * StringWriter sw = new StringWriter();
         * //MemberId,TrueName,CardNumber,Moeny,ApplayTime,IfDeal,DealRemarks
         * sw.WriteLine("订单号\t订单类型\t接单用户名\t下单时间\t交易额\t任务内容");
         * foreach (DataRow dr in ds.Tables[0].Rows)
         * {
         *  sw.WriteLine(dr["orderId"] + "\t" + dr["OrderType"] + "\t" + dr["memberName"] + "\t" + dr["orderTime"] + "\t" + dr["orderAllMoney"] + "\t" + dr["goodsList"]);
         * }
         * sw.Close();
         * Response.AddHeader("Content-Disposition", "attachment; filename=" + filename + "订单信息.xls");
         * Response.ContentType = "application/ms-excel";
         * Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
         * Response.Write(sw);
         * Response.End();
         * */
    }
Beispiel #27
0
    protected DataTable GetAllGoods()
    {
        AdoHelper adohelper = AdoHelper.CreateHelper(StarTech.Util.AppConfig.DBInstance);

        return(adohelper.ExecuteSqlDataset("select GoodsId,CategoryId,GoodsToTypeId,GoodsName,Orderby from [T_Goods_Info] ").Tables[0]);
    }
Beispiel #28
0
    /// <summary>
    /// 获取现在的图片
    /// </summary>
    protected void GetNowImg()
    {
        string menuId = "";

        if (Request.QueryString["menuId"] != null)
        {
            menuId = KillSqlIn.Form_ReplaceByString(Request.QueryString["menuId"], 10);
        }
        else
        {
            return;
        }

        string    strSQL    = "select stepText from T_Menu_Step where menuId='" + menuId + "' and stepNo=" + num + ";";
        AdoHelper adoHelper = AdoHelper.CreateHelper("DB_Instance");
        DataSet   ds        = adoHelper.ExecuteSqlDataset(strSQL);

        if (ds == null || ds.Tables.Count < 1 || ds.Tables[0].Rows.Count < 1)
        {
            return;
        }
        string imgList = ds.Tables[0].Rows[0][0].ToString();

        if (imgList.Contains("_"))
        {
            imgList = imgList.Split('_')[1];
        }
        else
        {
            return;
        }
        for (int i = 0; i < imgList.Split('^').Length; i++)
        {
            string src = imgList.Split('^')[i];
            if (src == "")
            {
                continue;
            }
            if (i == 0)
            {
                Image1.ImageUrl = src;
            }
            if (i == 1)
            {
                Image2.ImageUrl = src;
            }
            if (i == 2)
            {
                Image3.ImageUrl = src;
            }
            if (i == 3)
            {
                Image4.ImageUrl = src;
            }
            if (i == 4)
            {
                Image5.ImageUrl = src;
            }
            if (i == 5)
            {
                Image6.ImageUrl = src;
            }
        }
    }
Beispiel #29
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public GoodsModel GetModel(string GoodsId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 * from T_Goods_Info ");
            strSql.Append(" where GoodsId=@GoodsId ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@GoodsId", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = GoodsId;

            GoodsModel model = new GoodsModel();
            DataSet    ds    = adoHelper.ExecuteSqlDataset(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["GoodsId"] != null && ds.Tables[0].Rows[0]["GoodsId"].ToString() != "")
                {
                    model.GoodsId = ds.Tables[0].Rows[0]["GoodsId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["CategoryId"] != null && ds.Tables[0].Rows[0]["CategoryId"].ToString() != "")
                {
                    model.CategoryId = ds.Tables[0].Rows[0]["CategoryId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsToTypeId"] != null && ds.Tables[0].Rows[0]["GoodsToTypeId"].ToString() != "")
                {
                    model.GoodsToTypeId = ds.Tables[0].Rows[0]["GoodsToTypeId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["BrandId"] != null && ds.Tables[0].Rows[0]["BrandId"].ToString() != "")
                {
                    model.BrandId = ds.Tables[0].Rows[0]["BrandId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsName"] != null && ds.Tables[0].Rows[0]["GoodsName"].ToString() != "")
                {
                    model.GoodsName = ds.Tables[0].Rows[0]["GoodsName"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsCode"] != null && ds.Tables[0].Rows[0]["GoodsCode"].ToString() != "")
                {
                    model.GoodsCode = ds.Tables[0].Rows[0]["GoodsCode"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Uint"] != null && ds.Tables[0].Rows[0]["Uint"].ToString() != "")
                {
                    model.Uint = ds.Tables[0].Rows[0]["Uint"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Weight"] != null && ds.Tables[0].Rows[0]["Weight"].ToString() != "")
                {
                    model.Weight = int.Parse(ds.Tables[0].Rows[0]["Weight"].ToString());
                }
                if (ds.Tables[0].Rows[0]["GoodsSmallPic"] != null && ds.Tables[0].Rows[0]["GoodsSmallPic"].ToString() != "")
                {
                    model.GoodsSmallPic = ds.Tables[0].Rows[0]["GoodsSmallPic"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsSampleDesc"] != null && ds.Tables[0].Rows[0]["GoodsSampleDesc"].ToString() != "")
                {
                    model.GoodsSampleDesc = ds.Tables[0].Rows[0]["GoodsSampleDesc"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsDesc"] != null && ds.Tables[0].Rows[0]["GoodsDesc"].ToString() != "")
                {
                    model.GoodsDesc = ds.Tables[0].Rows[0]["GoodsDesc"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsDesc2"] != null && ds.Tables[0].Rows[0]["GoodsDesc2"].ToString() != "")
                {
                    model.GoodsDesc2 = ds.Tables[0].Rows[0]["GoodsDesc2"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsDesc3"] != null && ds.Tables[0].Rows[0]["GoodsDesc3"].ToString() != "")
                {
                    model.GoodsDesc3 = ds.Tables[0].Rows[0]["GoodsDesc3"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsDesc4"] != null && ds.Tables[0].Rows[0]["GoodsDesc4"].ToString() != "")
                {
                    model.GoodsDesc4 = ds.Tables[0].Rows[0]["GoodsDesc4"].ToString();
                }
                if (ds.Tables[0].Rows[0]["GoodsDesc5"] != null && ds.Tables[0].Rows[0]["GoodsDesc5"].ToString() != "")
                {
                    model.GoodsDesc5 = ds.Tables[0].Rows[0]["GoodsDesc5"].ToString();
                }
                if (ds.Tables[0].Rows[0]["IsRec"] != null && ds.Tables[0].Rows[0]["IsRec"].ToString() != "")
                {
                    model.IsRec = int.Parse(ds.Tables[0].Rows[0]["IsRec"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsHot"] != null && ds.Tables[0].Rows[0]["IsHot"].ToString() != "")
                {
                    model.IsHot = int.Parse(ds.Tables[0].Rows[0]["IsHot"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsNew"] != null && ds.Tables[0].Rows[0]["IsNew"].ToString() != "")
                {
                    model.IsNew = int.Parse(ds.Tables[0].Rows[0]["IsNew"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsSpe"] != null && ds.Tables[0].Rows[0]["IsSpe"].ToString() != "")
                {
                    model.IsSpe = int.Parse(ds.Tables[0].Rows[0]["IsSpe"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SalePrice"] != null && ds.Tables[0].Rows[0]["SalePrice"].ToString() != "")
                {
                    model.SalePrice = decimal.Parse(ds.Tables[0].Rows[0]["SalePrice"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MarketPrice"] != null && ds.Tables[0].Rows[0]["MarketPrice"].ToString() != "")
                {
                    model.MarketPrice = decimal.Parse(ds.Tables[0].Rows[0]["MarketPrice"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CBPrice"] != null && ds.Tables[0].Rows[0]["CBPrice"].ToString() != "")
                {
                    model.CBPrice = decimal.Parse(ds.Tables[0].Rows[0]["CBPrice"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsSale"] != null && ds.Tables[0].Rows[0]["IsSale"].ToString() != "")
                {
                    model.IsSale = int.Parse(ds.Tables[0].Rows[0]["IsSale"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Sotck"] != null && ds.Tables[0].Rows[0]["Sotck"].ToString() != "")
                {
                    model.Sotck = int.Parse(ds.Tables[0].Rows[0]["Sotck"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MinSaleNumber"] != null && ds.Tables[0].Rows[0]["MinSaleNumber"].ToString() != "")
                {
                    model.MinSaleNumber = int.Parse(ds.Tables[0].Rows[0]["MinSaleNumber"].ToString());
                }
                if (ds.Tables[0].Rows[0]["MaxSaleNumber"] != null && ds.Tables[0].Rows[0]["MaxSaleNumber"].ToString() != "")
                {
                    model.MaxSaleNumber = int.Parse(ds.Tables[0].Rows[0]["MaxSaleNumber"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Orderby"] != null && ds.Tables[0].Rows[0]["Orderby"].ToString() != "")
                {
                    model.Orderby = int.Parse(ds.Tables[0].Rows[0]["Orderby"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ViewCount"] != null && ds.Tables[0].Rows[0]["ViewCount"].ToString() != "")
                {
                    model.ViewCount = int.Parse(ds.Tables[0].Rows[0]["ViewCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TotalSaleCount"] != null && ds.Tables[0].Rows[0]["TotalSaleCount"].ToString() != "")
                {
                    model.TotalSaleCount = int.Parse(ds.Tables[0].Rows[0]["TotalSaleCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Remarks"] != null && ds.Tables[0].Rows[0]["Remarks"].ToString() != "")
                {
                    model.Remarks = ds.Tables[0].Rows[0]["Remarks"].ToString();
                }
                if (ds.Tables[0].Rows[0]["AddTime"] != null && ds.Tables[0].Rows[0]["AddTime"].ToString() != "")
                {
                    model.AddTime = DateTime.Parse(ds.Tables[0].Rows[0]["AddTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["AreaInfo"] != null && ds.Tables[0].Rows[0]["AreaInfo"].ToString() != "")
                {
                    model.AreaInfo = ds.Tables[0].Rows[0]["AreaInfo"].ToString();
                }
                if (ds.Tables[0].Rows[0]["BookInfo"] != null && ds.Tables[0].Rows[0]["BookInfo"].ToString() != "")
                {
                    model.BookInfo = ds.Tables[0].Rows[0]["BookInfo"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ProviderInfo"] != null && ds.Tables[0].Rows[0]["ProviderInfo"].ToString() != "")
                {
                    model.ProviderInfo = ds.Tables[0].Rows[0]["ProviderInfo"].ToString();
                }
                if (ds.Tables[0].Rows[0]["DataFrom"] != null && ds.Tables[0].Rows[0]["DataFrom"].ToString() != "")
                {
                    model.DataFrom = ds.Tables[0].Rows[0]["DataFrom"].ToString();
                }
                if (ds.Tables[0].Rows[0]["MorePropertys"] != null && ds.Tables[0].Rows[0]["MorePropertys"].ToString() != "")
                {
                    model.MorePropertys = ds.Tables[0].Rows[0]["MorePropertys"].ToString();
                }
                if (ds.Tables[0].Rows[0]["IfSh"] != null && ds.Tables[0].Rows[0]["IfSh"].ToString() != "")
                {
                    model.IfSh = int.Parse(ds.Tables[0].Rows[0]["IfSh"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ShPerson"] != null && ds.Tables[0].Rows[0]["ShPerson"].ToString() != "")
                {
                    model.ShPerson = ds.Tables[0].Rows[0]["ShPerson"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ShTime"] != null && ds.Tables[0].Rows[0]["ShTime"].ToString() != "")
                {
                    model.ShTime = DateTime.Parse(ds.Tables[0].Rows[0]["ShTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ShMark"] != null && ds.Tables[0].Rows[0]["ShMark"].ToString() != "")
                {
                    model.ShMark = ds.Tables[0].Rows[0]["ShMark"].ToString();
                }
                if (ds.Tables[0].Rows[0]["IsOldGoods"] != null && ds.Tables[0].Rows[0]["IsOldGoods"].ToString() != "")
                {
                    model.IsOldGoods = int.Parse(ds.Tables[0].Rows[0]["IsOldGoods"].ToString());
                }
                if (ds.Tables[0].Rows[0]["OldGoodsLevel"] != null && ds.Tables[0].Rows[0]["OldGoodsLevel"].ToString() != "")
                {
                    model.OldGoodsLevel = ds.Tables[0].Rows[0]["OldGoodsLevel"].ToString();
                }
                if (ds.Tables[0].Rows[0]["saleCount"] != null && ds.Tables[0].Rows[0]["saleCount"].ToString() != "")
                {
                    model.saleCount = int.Parse(ds.Tables[0].Rows[0]["saleCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Postage"] != null && ds.Tables[0].Rows[0]["Postage"].ToString() != "")
                {
                    model.Postage = decimal.Parse(ds.Tables[0].Rows[0]["Postage"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PingLunCount"] != null && ds.Tables[0].Rows[0]["PingLunCount"].ToString() != "")
                {
                    model.PingLunCount = int.Parse(ds.Tables[0].Rows[0]["PingLunCount"].ToString());
                }
                if (ds.Tables[0].Rows[0]["vipPrice1"] != null && ds.Tables[0].Rows[0]["vipPrice1"].ToString() != "")
                {
                    model.vipPrice1 = decimal.Parse(ds.Tables[0].Rows[0]["vipPrice1"].ToString());
                }
                if (ds.Tables[0].Rows[0]["vipPrice2"] != null && ds.Tables[0].Rows[0]["vipPrice2"].ToString() != "")
                {
                    model.vipPrice2 = decimal.Parse(ds.Tables[0].Rows[0]["vipPrice2"].ToString());
                }
                if (ds.Tables[0].Rows[0]["signId"] != null && ds.Tables[0].Rows[0]["signId"].ToString() != "")
                {
                    model.signId = ds.Tables[0].Rows[0]["signId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["serviceId"] != null && ds.Tables[0].Rows[0]["serviceId"].ToString() != "")
                {
                    model.ServiceId = ds.Tables[0].Rows[0]["serviceId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["JobType"] != null)
                {
                    model.JobType = ds.Tables[0].Rows[0]["JobType"].ToString();
                }
                if (ds.Tables[0].Rows[0]["JobStartTime"] != null && ds.Tables[0].Rows[0]["JobStartTime"].ToString() != "")
                {
                    model.JobStartTime = DateTime.Parse(ds.Tables[0].Rows[0]["JobStartTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JobEndTime"] != null && ds.Tables[0].Rows[0]["JobEndTime"].ToString() != "")
                {
                    model.JobEndTime = DateTime.Parse(ds.Tables[0].Rows[0]["JobEndTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["JobAddress"] != null)
                {
                    model.JobAddress = ds.Tables[0].Rows[0]["JobAddress"].ToString();
                }
                if (ds.Tables[0].Rows[0]["JobSquare"] != null)
                {
                    model.JobSquare = ds.Tables[0].Rows[0]["JobSquare"].ToString();
                }
                if (ds.Tables[0].Rows[0]["JobByPersonType"] != null)
                {
                    model.JobByPersonType = ds.Tables[0].Rows[0]["JobByPersonType"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #30
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public ModOrder GetModel(string OrderId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 * from T_Order_Info ");
            strSql.Append(" where OrderId=@OrderId ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@OrderId", SqlDbType.VarChar, 50)
            };
            parameters[0].Value = OrderId;

            ModOrder model = new ModOrder();
            DataSet  ds    = adoHelper.ExecuteSqlDataset(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.OrderId    = ds.Tables[0].Rows[0]["OrderId"].ToString();
                model.OrderType  = ds.Tables[0].Rows[0]["OrderType"].ToString();
                model.MemberId   = ds.Tables[0].Rows[0]["MemberId"].ToString();
                model.MemberName = ds.Tables[0].Rows[0]["MemberName"].ToString();
                if (ds.Tables[0].Rows[0]["OrderTime"].ToString() != "")
                {
                    model.OrderTime = DateTime.Parse(ds.Tables[0].Rows[0]["OrderTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["OrderAllMoney"].ToString() != "")
                {
                    model.OrderAllMoney = decimal.Parse(ds.Tables[0].Rows[0]["OrderAllMoney"].ToString());
                }
                if (ds.Tables[0].Rows[0]["GoodsAllMoney"].ToString() != "")
                {
                    model.GoodsAllMoney = decimal.Parse(ds.Tables[0].Rows[0]["GoodsAllMoney"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Freight"].ToString() != "")
                {
                    model.Freight = decimal.Parse(ds.Tables[0].Rows[0]["Freight"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TicketMoney"].ToString() != "")
                {
                    model.TicketMoney = decimal.Parse(ds.Tables[0].Rows[0]["TicketMoney"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DiscountMoeny"].ToString() != "")
                {
                    model.DiscountMoeny = decimal.Parse(ds.Tables[0].Rows[0]["DiscountMoeny"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TempChangeMoney"].ToString() != "")
                {
                    model.TempChangeMoney = decimal.Parse(ds.Tables[0].Rows[0]["TempChangeMoney"].ToString());
                }
                model.ReceivePerson        = ds.Tables[0].Rows[0]["ReceivePerson"].ToString();
                model.ReceiveAddressCode   = ds.Tables[0].Rows[0]["ReceiveAddressCode"].ToString();
                model.ReceiveAddressDetail = ds.Tables[0].Rows[0]["ReceiveAddressDetail"].ToString();
                model.PostCode             = ds.Tables[0].Rows[0]["PostCode"].ToString();
                model.Email              = ds.Tables[0].Rows[0]["Email"].ToString();
                model.Tel                = ds.Tables[0].Rows[0]["Tel"].ToString();
                model.Mobile             = ds.Tables[0].Rows[0]["Mobile"].ToString();
                model.MemberOrderRemarks = ds.Tables[0].Rows[0]["MemberOrderRemarks"].ToString();
                model.AdminOrderRemarks  = ds.Tables[0].Rows[0]["AdminOrderRemarks"].ToString();
                if (ds.Tables[0].Rows[0]["OrderAllWeight"].ToString() != "")
                {
                    model.OrderAllWeight = int.Parse(ds.Tables[0].Rows[0]["OrderAllWeight"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsPay"].ToString() != "")
                {
                    model.IsPay = int.Parse(ds.Tables[0].Rows[0]["IsPay"].ToString());
                }
                if (ds.Tables[0].Rows[0]["PayTime"].ToString() != "")
                {
                    model.PayTime = DateTime.Parse(ds.Tables[0].Rows[0]["PayTime"].ToString());
                }
                model.PayInterfaceCode = ds.Tables[0].Rows[0]["PayInterfaceCode"].ToString();
                model.PayMethod        = ds.Tables[0].Rows[0]["PayMethod"].ToString();
                if (ds.Tables[0].Rows[0]["IsSend"].ToString() != "")
                {
                    model.IsSend = int.Parse(ds.Tables[0].Rows[0]["IsSend"].ToString());
                }
                if (ds.Tables[0].Rows[0]["SendTime"].ToString() != "")
                {
                    model.SendTime = DateTime.Parse(ds.Tables[0].Rows[0]["SendTime"].ToString());
                }
                model.SendNumber       = ds.Tables[0].Rows[0]["SendNumber"].ToString();
                model.SendCompany      = ds.Tables[0].Rows[0]["SendCompany"].ToString();
                model.SendMethod       = ds.Tables[0].Rows[0]["SendMethod"].ToString();
                model.SendMethodByReal = ds.Tables[0].Rows[0]["SendMethodByReal"].ToString();
                if (ds.Tables[0].Rows[0]["IsGet"].ToString() != "")
                {
                    model.IsGet = int.Parse(ds.Tables[0].Rows[0]["IsGet"].ToString());
                }
                if (ds.Tables[0].Rows[0]["GetTime"].ToString() != "")
                {
                    model.GetTime = DateTime.Parse(ds.Tables[0].Rows[0]["GetTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsMemberCancel"].ToString() != "")
                {
                    model.IsMemberCancel = int.Parse(ds.Tables[0].Rows[0]["IsMemberCancel"].ToString());
                }
                model.MemberCancelRemarks = ds.Tables[0].Rows[0]["MemberCancelRemarks"].ToString();
                if (ds.Tables[0].Rows[0]["IsComplete"].ToString() != "")
                {
                    model.IsComplete = int.Parse(ds.Tables[0].Rows[0]["IsComplete"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CompleteTime"].ToString() != "")
                {
                    model.CompleteTime = DateTime.Parse(ds.Tables[0].Rows[0]["CompleteTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsInvoice"].ToString() != "")
                {
                    model.IsInvoice = int.Parse(ds.Tables[0].Rows[0]["IsInvoice"].ToString());
                }
                model.InvoiceCode    = ds.Tables[0].Rows[0]["InvoiceCode"].ToString();
                model.InvoiceType1   = ds.Tables[0].Rows[0]["InvoiceType1"].ToString();
                model.InvoiceType2   = ds.Tables[0].Rows[0]["InvoiceType2"].ToString();
                model.InvoiceTitle   = ds.Tables[0].Rows[0]["InvoiceTitle"].ToString();
                model.InvoiceRemarks = ds.Tables[0].Rows[0]["InvoiceRemarks"].ToString();
                if (ds.Tables[0].Rows[0]["IsCheckIfRealOrder"].ToString() != "")
                {
                    model.IsCheckIfRealOrder = int.Parse(ds.Tables[0].Rows[0]["IsCheckIfRealOrder"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CheckIfRealOrderTime"].ToString() != "")
                {
                    model.CheckIfRealOrderTime = DateTime.Parse(ds.Tables[0].Rows[0]["CheckIfRealOrderTime"].ToString());
                }
                model.CheckIfRealOrderPerson  = ds.Tables[0].Rows[0]["CheckIfRealOrderPerson"].ToString();
                model.CheckIfRealOrderRemarks = ds.Tables[0].Rows[0]["CheckIfRealOrderRemarks"].ToString();
                if (ds.Tables[0].Rows[0]["SellerId"].ToString() != "")
                {
                    model.SellerId = ds.Tables[0].Rows[0]["SellerId"].ToString();
                }
                if (ds.Tables[0].Rows[0]["SellerType"].ToString() != "")
                {
                    model.SellerType = ds.Tables[0].Rows[0]["SellerType"].ToString();
                }
                if (ds.Tables[0].Rows[0]["ztTime"].ToString() != "")
                {
                    model.ztTime = DateTime.Parse(ds.Tables[0].Rows[0]["ztTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ztTimeEnd"].ToString() != "")
                {
                    model.ztTimeEnd = DateTime.Parse(ds.Tables[0].Rows[0]["ztTimeEnd"].ToString());
                }
                if (ds.Tables[0].Rows[0]["isComment"].ToString() != "")
                {
                    model.isComment = int.Parse(ds.Tables[0].Rows[0]["isComment"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CommentTime"].ToString() != "")
                {
                    model.CommentTime = DateTime.Parse(ds.Tables[0].Rows[0]["CommentTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["marketId"].ToString() != "")
                {
                    model.marketId = (ds.Tables[0].Rows[0]["marketId"].ToString()).ToString();
                }
                if (ds.Tables[0].Rows[0]["isDis"].ToString() != "")
                {
                    model.isDis = Convert.ToInt32(ds.Tables[0].Rows[0]["isDis"].ToString());
                }
                if (ds.Tables[0].Rows[0]["DisTime"].ToString() != "")
                {
                    model.DisTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["disTime"].ToString());
                }
                if (ds.Tables[0].Rows[0]["building_id"].ToString() != "")
                {
                    model.building_id = ds.Tables[0].Rows[0]["building_id"].ToString();
                }
                if (ds.Tables[0].Rows[0]["oldMoney"].ToString() != "")
                {
                    model.oldMoney = Convert.ToDecimal(ds.Tables[0].Rows[0]["oldMoney"].ToString());
                }
                if (ds.Tables[0].Rows[0]["couponId"].ToString() != "")
                {
                    model.couponId = ds.Tables[0].Rows[0]["couponId"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }