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); }
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>"); } }