示例#1
0
    private string GetTrafficLimitInfo(string citycode)
    {
        string result = string.Empty;

        FT.DAL.IDataAccess dataAccess = FT.DAL.DataAccessFactory.GetDataAccess();
        string             sql        = "select limitcontent from  common_traffic_limitinfo_extend where citycode='" + citycode + "' and getdate() between startdate and enddate";

        object obj = dataAccess.SelectScalar(sql);

        if (obj != null)
        {
            result = obj.ToString();
        }
        else
        {
            sql = "select limitcontent from  common_traffic_limitinfo where citycode='" + citycode + "' and weekday=" + FT.Commons.Tools.DateTimeHelper.GetNumberWeekDay(System.DateTime.Now);

            object obj2 = dataAccess.SelectScalar(sql);
            if (obj2 != null)
            {
                result = obj2.ToString();
            }
        }
        result = result.Replace("-", "      ");
        return(result);
    }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string ip     = this.txtIp.Text.Trim();
            string dbname = this.txtDbName.Text.Trim();
            string userid = this.txtUID.Text.Trim();
            string pwd    = this.txtPwd.Text.Trim();

            if (dbname.Length > 0 && userid.Length > 0)
            {
                FT.DAL.IDataAccess access = null;
                if (this.cbDbType.Text.Trim().ToLower() == "sqlserver")
                {
                    access = new FT.DAL.SqlServer.SqlServerDataHelper(ip, dbname, userid, pwd);
                }
                else if (this.cbDbType.Text.Trim().ToLower() == "oracle")
                {
                    access = new FT.DAL.Oracle.OracleDataHelper(dbname, userid, pwd);
                }
                else if (this.cbDbType.Text.Trim().ToLower() == "access")
                {
                    if (pwd.Length > 0)
                    {
                        access = new FT.DAL.Access.AccessDataHelper("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=true;Data Source=" + dbname + ";Jet OLEDB:Database Password="******"测试成功!", "提示");
                        access.Close();
                    }
                    else
                    {
                        MessageBox.Show("测试失败!", "提示");
                    }
                }
                catch (Exception ex)
                {
                    MessageBoxHelper.Show(ex.ToString());
                }
            }
            else
            {
                MessageBoxHelper.Show("必须填写数据库名和登陆名");
            }
        }
示例#3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        SaleRecordInfo saleRecord = new SaleRecordInfo();

        saleRecord.SalePrice     = TransMoney(this.txtSalePrice.Text);
        saleRecord.Discount      = TransMoney(this.txtDiscount.Text);
        saleRecord.CouponsNo     = this.txtCouponsNo.Text;
        saleRecord.CouponsPrice  = TransMoney(this.txtCouponsMoney.Text);
        saleRecord.CashMoney     = TransMoney(this.txtCashMoney.Text);
        saleRecord.VisaMoney     = TransMoney(this.txtVisaCardMoney.Text);
        saleRecord.UserCardMoney = TransMoney(this.txtUserCardMoney.Text);
        saleRecord.TrueMoney     = TransMoney(this.txtTrueMoney.Text);
        saleRecord.CustomerName  = this.txtCustomerName.Text;
        saleRecord.CustomerPhone = this.txtCustomerPhone.Text;
        saleRecord.InVoiceNo     = this.txtInvoiceNo.Text;
        saleRecord.Bz            = this.txtBz.Text;
        saleRecord.SaleLsh       = System.DateTime.Now.ToString("yyyyMMddHHmmss");
        string loginuser = "******";

        saleRecord.Sales  = loginuser;
        saleRecord.ShopId = 2;
        FT.DAL.Orm.SimpleOrmOperator.Create(saleRecord);

        string sql = "";

        FT.DAL.IDataAccess access = FT.DAL.DataAccessFactory.GetDataAccess();

        object    id    = access.SelectScalar("select id from SaleRecord where SaleLsh='" + saleRecord.SaleLsh + "'");
        ArrayList lists = ViewState[Sale_List] as ArrayList;


        for (int i = 0; i < lists.Count; i++)
        {
            Console.Write(id.ToString());
            Console.Write(lists[i].ToString());
            sql = "insert into Sale_Product(SaleId,ProductId,State) values(" + id.ToString() + "," + lists[i].ToString() + ",'" + ProductStateEnum.BeginSaleString + "')";
            access.ExecuteSql(sql);

            sql = "update Product set ProductStatus=" + ProductStateEnum.BeginSaleInt + ",State='" + ProductStateEnum.BeginSaleString + "' where Product_Id=" + lists[i].ToString();
            access.ExecuteSql(sql);
        }

        //FT.Commons.Tools.WebFormHelper.WriteScript(this, "<script language='javascript'>printSaleDetail();</script>");
        // MagicAjax.AjaxCallHelper.WriteSetHtmlOfPageScript("<script language='javascript'>alert('请选择目标门店!');</script>");
        ClientScript.RegisterStartupScript(this.GetType(), "tip", "<script>alert('保存成功!');</script>");
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string sql = "";

        FT.DAL.IDataAccess access = FT.DAL.DataAccessFactory.GetDataAccess();
        if (this.ddlShop.SelectedIndex != 0)
        {
            sql = "insert into AssignmentPlan(Name,Creator,CreateTime,State,ToShopId) values('" + this.txtPlanName.Text.Trim() + "','" + this.lbCreator.Text.Trim() + "',CAST('" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' AS datetime),'新增'," + this.ddlShop.SelectedValue.ToString() + ")";
            access.ExecuteSql(sql);
            object    id    = access.SelectScalar("select id from AssignmentPlan where Name='" + this.txtPlanName.Text.Trim() + "'");
            ArrayList lists = ViewState[Plan_List] as ArrayList;
            for (int i = 0; i < lists.Count; i++)
            {
                sql = "insert into Plan_Product(PlanId,ProductId,State) values(" + id.ToString() + "," + lists[i].ToString() + ",'新增')";
                access.ExecuteSql(sql);
            }
        }
        else
        {
            // MagicAjax.AjaxCallHelper.WriteSetHtmlOfPageScript("<script language='javascript'>alert('请选择目标门店!');</script>");
            ClientScript.RegisterStartupScript(this.GetType(), "tip", "<script>alert('请选择目标门店!');</script>");
        }
    }
示例#5
0
    protected void btnSure_Click(object sender, EventArgs e)
    {
        if (this.txtValidCode.Text.Trim().Length == 4)
        {
            bool result = GobalTools.IsRight(this.txtValidCode.Text.Trim());
            if (result)
            {
                string             ordersqlFormat = @"
INSERT INTO yuantuo_terminal_orders
           (orderid
           ,productid
           ,product
           ,num
           ,singleprice
           ,terminalid
           ,totalprice
           ,isadd
           ,mobile,orderdate)
     VALUES ('{0}',{1},'{2}',{3},{4},{5},{6},{7},'{8}','{9}')
";
                FT.DAL.IDataAccess access         = FT.DAL.DataAccessFactory.GetDataAccess();

                int fontsize   = 9;
                int lineheight = 15;
                // int left = 15;
                int    left   = 1;
                string script = string.Empty;
                string domain = Request.Url.ToString();
                // nowUrl.in
                // domain = domain.Substring(domain.IndexOf(":") + 3);//http://之后的
                domain = domain.Substring(0, domain.IndexOf("/YuanTuo"));
                //string urlPrefix = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.IndexOf('/', 0, 3));
                // string logo = Page.ResolveUrl("~/YuanTuo/images/yijielogo.bmp");
                string logo = domain + "/YuanTuo/images/yijielogo.bmp";
                // string logo="http://127.0.0.1:12345/BuyWebSiteDemo/YuanTuo/images/yijielogo.bmp";
                string         orderid  = Session["orderid"].ToString();
                TerminalStatus terminal = GobalTools.GetTerminal();

                string        mobile         = this.txtMobile.Value;
                StringBuilder productcontent = new StringBuilder();
                string        productid      = Session["seeproductid"].ToString();
                ProductInfo   entity         = SimpleOrmOperator.Query <ProductInfo>(Convert.ToInt32(productid));
                int           num            = Convert.ToInt32(Request.Params["ordernum"].ToString());



                double price = Convert.ToDouble(Request.Params["price"].ToString());

                string    sendSql          = "select top 1 productid,b.name as productname,b.no,sendproductid,num from yuantuo_product_send  a left join yuantuo_product_info b on b.id=a.sendproductid where getdate() between startdate and enddate and productid=" + entity.Id.ToString() + " order by enddate desc";
                DataTable dt               = access.SelectDataTable(sendSql, "tmp");
                string    sendPrintContent = string.Empty;
                string    orderdate        = DateTimeHelper.DtToLongString(System.DateTime.Now);
                if (dt != null && dt.Rows.Count == 1)
                {
                    int    sendproductid = Convert.ToInt32(dt.Rows[0]["sendproductid"].ToString());
                    int    sendnumpre    = Convert.ToInt32(dt.Rows[0]["num"].ToString());
                    string sendno        = dt.Rows[0]["no"].ToString();
                    string sendname      = dt.Rows[0]["productname"].ToString();
                    if (num > sendnumpre)
                    {
                        int sendnum = num / sendnumpre;
                        access.ExecuteSql(string.Format(ordersqlFormat
                                                        , orderid, sendproductid, sendname, sendnum, 0, terminal.Id, 0, 1, mobile, orderdate
                                                        ).Replace("\r\n", ""));
                        // " obj.AddContent('04012          78        77','宋体',font,left,height);";
                        sendPrintContent = "height+=lineHeight;obj.AddContent('" + sendname + "(赠品)','宋体'," + fontsize.ToString() + ",left,height);height+=lineHeight;obj.AddContent('" + sendno + "          " + sendnum + "        " + "0" + "','宋体'," + fontsize.ToString() + ",left,height);";
                    }
                }
                access.ExecuteSql(string.Format(ordersqlFormat
                                                , orderid, entity.Id, entity.Name, num, price, terminal.Id, price * num, 0, mobile, orderdate
                                                ).Replace("\r\n", ""));


                /*
                 *    height+=lineHeight;
                 *  obj.AddContent('汽车台座专用香氛50(ml)','宋体',10,left,height);
                 *   height+=lineHeight;
                 *  obj.AddContent('04011              856          78','宋体',10,left,height);
                 *   height+=lineHeight;
                 *  obj.AddContent('金额合计:66,768.00','宋体',10,left,height);
                 */

                productcontent.Append("height+=lineHeight;");
                productcontent.Append("obj.AddContent('" + entity.Name + "','宋体'," + fontsize.ToString() + ",left,height);");
                productcontent.Append("height+=lineHeight;");
                productcontent.Append("obj.AddContent('" + entity.No + "          " + num + "        " + price + "','宋体'," + fontsize.ToString() + ",left,height);");
                productcontent.Append(sendPrintContent);
                productcontent.Append("height+=lineHeight;");
                productcontent.Append("obj.AddContent('金额合计:" + string.Format("{0:N2}", price * num) + "','黑体'," + 10.ToString() + ",left,height);");
                //80mm

                /* script = string.Format(printScriptFormatter
                 *   ,logo,orderid,terminal.StoreNo,terminal.StoreName,terminal.StorePhone
                 *   , mobile, productcontent.ToString(), System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                 *  ,Page.ResolveUrl("~/YuanTuo/Index.aspx")
                 *  ,entity.GetProductDays.ToString()
                 *  , fontsize, left,lineheight,fontsize+2,entity.GetProductDays+4
                 *   );
                 * */
                script = string.Format(printScriptFormatter58
                                       , logo, orderid, terminal.StoreNo, terminal.StoreName, terminal.StorePhone
                                       , mobile, productcontent.ToString(), System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                                       , Page.ResolveUrl("~/YuanTuo/Index.aspx")
                                       , entity.GetProductDays.ToString()
                                       , fontsize, left, lineheight, fontsize + 2, entity.GetProductDays + 4
                                       );
                ClientScript.RegisterStartupScript(this.GetType(), "tmp", script);
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "tmp", "<script type='text/javascript'>setValidError();</script>");
            }
        }
    }
示例#6
0
 public SynStudentInfoPlugin(FT.DAL.IDataAccess dataAccess)
 {
     this.dataAccess = dataAccess;
 }
 public SynStudentInfoPlugin(FT.DAL.IDataAccess dataAccess)
 {
     this.dataAccess = dataAccess;
 }
示例#8
0
 public StudentPlugin(FT.DAL.IDataAccess dataAccess)
     : base(dataAccess)
 {
 }