protected void btnClear_Click(object sender, EventArgs e) { PubFunc.FormDataClear(fmForm); GridLeft.DataSource = null; GridLeft.DataBind(); docDEPTID.Enabled = true; }
private void dataSearch() { int total = 0; string msg = ""; NameValueCollection nvc = new NameValueCollection(); if (string.IsNullOrWhiteSpace(docDEPTID.SelectedValue)) { Alert.Show("请选择库房进行查询操作", "警告提醒", MessageBoxIcon.Warning); return; } if (tbxGDSEQ.Text.Length > 0) { nvc.Add("GDSEQ", tbxGDSEQ.Text); } if (tbxPRODUCER.Text.Length > 0) { nvc.Add("PRODUCER", tbxPRODUCER.Text); } if (docDEPTID.SelectedValue.Length > 0) { nvc.Add("DEPTID", docDEPTID.SelectedValue); } if (tbxHWID.Text.Length > 0) { nvc.Add("HWID", tbxHWID.Text); } DataTable dt = DbHelperOra.Query(GetSql(nvc)).Tables[0]; GridLeft.DataSource = dt; GridLeft.DataBind(); docDEPTID.Enabled = false; if (dt.Rows.Count > 0) { btnCreate.Enabled = true; } else { btnCreate.Enabled = false; } }
protected void btnSearch_Click(object sender, EventArgs e) { //绑定借货单 string Sql = @"SELECT B.*,f_getdeptname(A.DEPTOUT) DEPTOUTNAME,f_getdeptname(A.DEPTID) DEPTIDNAME,A.SHRQ,A.MEMO,f_getusername(A.SLR) SLRNAME, f_getunitname(B.UNIT) UNITNAME,f_getproducername(B.PRODUCER) PRODUCERNAME,C.BAR3, NVL((SELECT ROUND(SUM(KCSL - LOCKSL)/F_GETBZHL(K.GDSEQ),2) FROM Dat_Goodsstock k where k.kcsl> LOCKSL and k.gdseq = b.gdseq and k.deptid = a.deptout GROUP BY GDSEQ),0) KCSL FROM DAT_JH_DOC A,DAT_JH_COM B,DOC_GOODS C WHERE A.SEQNO = B.SEQNO AND B.GDSEQ = C.GDSEQ AND A.FLAG = 'Y' AND NVL(B.STR1,'#') = '#'"; string strch = ""; if (!PubFunc.StrIsEmpty(tgbBILL.Text.Trim())) { strch += string.Format(" AND A.SEQNO LIKE '%{0}%'", tgbBILL.Text.Trim()); } if (!PubFunc.StrIsEmpty(tbxGDSEQ.Text.Trim())) { strch += string.Format(" AND (C.GDSEQ LIKE '%{0}%' OR C.GDNAME LIKE '%{0}%')", tbxGDSEQ.Text.Trim()); } if (!PubFunc.StrIsEmpty(ddlDEPTID.SelectedValue)) { strch += string.Format(" AND A.DEPTID = '{0}'", ddlDEPTID.SelectedValue); } if (!PubFunc.StrIsEmpty(ddlDEPTOUT.SelectedValue)) { strch += string.Format(" AND A.DEPTOUT = '{0}'", ddlDEPTOUT.SelectedValue); } strch += string.Format(" AND A.SHRQ BETWEEN TO_DATE('{0}','YYYY-MM-DD') AND TO_DATE('{1}','YYYY-MM-DD')+1", dpkTime1.Text, dpkTime2.Text); strch += " ORDER BY A.DEPTOUT,A.DEPTID,A.SEQNO DESC,B.ROWNO"; DataTable Dt = DbHelperOra.Query(Sql + strch).Tables[0]; GridLeft.DataSource = Dt; GridLeft.DataBind(); if (Dt.Rows.Count > 0) { btnCreate.Enabled = true; } else { btnCreate.Enabled = false; } }
private void Update() { if (!IsChartInitialized) { return; } Func <double, string> defFormatter = x => x.ToString(CultureInfo.InvariantCulture); var completed = (Value - From) / (To - From); var t = 0d; if (double.IsNaN(completed) || double.IsInfinity(completed)) { completed = 0; } completed = completed > 1 ? 1 : (completed < 0 ? 0 : completed); var angle = Uses360Mode ? 360 : 180; if (!_isCallBack && Uses360Mode) { Grid.SetRow(Min, 0); Grid.SetRow(Max, 0); Grid.SetRow(LeftLabel, 1); Grid.SetRow(RightLabel, 1); //LeftLabel.UpdateLayout(); //RightLabel.UpdateLayout(); GridLeft.Children.Remove(GridLeftBoarder); GridLeftBoarder = new Border { BorderThickness = new Thickness(1, 0, 0, 0), BorderBrush = _titleColor }; GridLeft.Children.Add(GridLeftBoarder); Grid.SetRow(GridLeftBoarder, 1); GridRight.Children.Remove(GridRightBoarder); Panel.SetZIndex(GridLeftBoarder, 1); Canvas.SetLeft(GridLeftBoarder, ActualWidth / 2); _isCallBack = true; } if (!Uses360Mode) { LeftLabel.Text = (LabelFormatter ?? defFormatter)(From); RightLabel.Text = (LabelFormatter ?? defFormatter)(To); LeftLabel.UpdateLayout(); RightLabel.UpdateLayout(); //LeftLabel.Visibility = LabelsVisibility; GridLeft.Visibility = LabelsVisibility; //RightLabel.Visibility = LabelsVisibility; GridRight.Visibility = LabelsVisibility; t = LeftLabel.ActualHeight; if (Icon != null) { Icon.Visibility = Visibility.Hidden; } } else { LeftLabel.Text = (LabelFormatter ?? defFormatter)(From); RightLabel.Text = (LabelFormatter ?? defFormatter)(To); LeftLabel.UpdateLayout(); RightLabel.UpdateLayout(); GridLeft.Visibility = LabelsVisibility; GridRight.Visibility = LabelsVisibility; //LeftLabel.Visibility = Visibility.Hidden; //RightLabel.Visibility = Visibility.Hidden; // t = GridLeft.ActualHeight; if (Icon != null) { Icon.Visibility = Visibility.Visible; } } double r, top; if (Uses360Mode) { //r = ActualWidth > ActualHeight ? ActualHeight : ActualWidth; //r = r / 2 - t; //r / 2 - 2 * t; r = ActualWidth > ActualHeight ? ActualHeight / 2 - t : ActualWidth / 2; top = ActualHeight / 2; } else { r = ActualWidth; if (ActualWidth > ActualHeight * 2) { r = ActualHeight * 2; } else { t = 0; } //r = r / 2 - 2 * t; r = r / 2; top = ActualHeight / 2 + r / 2; } if (r < 0) { r = 1; } PieBack.Radius = r; PieBack.InnerRadius = InnerRadius ?? r * .8; PieBack.RotationAngle = 270; PieBack.WedgeAngle = angle; Pie.Radius = PieBack.Radius * 0.96; Pie.InnerRadius = PieBack.InnerRadius * 1.06; Pie.RotationAngle = PieBack.RotationAngle; Canvas.SetLeft(PieBack, ActualWidth / 2); Canvas.SetTop(PieBack, top); Canvas.SetLeft(Pie, ActualWidth / 2); Canvas.SetTop(Pie, top); //Canvas.SetTop(LeftLabel, top); //Canvas.SetTop(RightLabel, top); //Canvas.SetRight(LeftLabel, ActualWidth / 2 + ( r + PieBack.InnerRadius ) / 2 - LeftLabel.ActualWidth / 2); //Canvas.SetRight(RightLabel, ActualWidth / 2 - ( r + PieBack.InnerRadius ) / 2 - RightLabel.ActualWidth / 2); MeasureTextBlock.FontSize = HighFontSize ?? Pie.InnerRadius * .4; if (Uses360Mode) { MeasureTextBlock.FontSize = Pie.InnerRadius * .6; } MeasureTextBlock.Text = (LabelFormatter ?? defFormatter)(Value); if (FontColor != null) { MeasureTextBlock.Foreground = FontColor; } MeasureTextBlock.UpdateLayout(); double ratio = Uses360Mode ? .3 : .4; MeasureTextBlockUnit.Text = (Uses360Mode ? "" : " ") + GaugeUnit; MeasureTextBlockUnit.FontSize = MeasureTextBlock.FontSize * ratio; MeasureTextBlockUnit.UpdateLayout(); Title.Text = GaugeTitle; Title.FontSize = MeasureTextBlock.FontSize * ratio; Title.UpdateLayout(); //LeftLabel.FontSize = MeasureTextBlock.FontSize * ratio; //RightLabel.FontSize = MeasureTextBlock.FontSize * ratio; //LeftLabel.UpdateLayout(); //RightLabel.UpdateLayout(); if (Uses360Mode) { double top360 = top - r - GridLeft.ActualHeight; //top - Gridleft.ActualHeight + ( r + PieBack.InnerRadius ) / 2; Canvas.SetTop(GridLeft, top360); Canvas.SetTop(GridRight, top360); Canvas.SetLeft(GridRight, (ActualWidth / 2) - GridRight.ActualWidth); Canvas.SetLeft(GridLeft, ActualWidth / 2); if (IconSource != null) { if (Icon == null) { Icon = new Image { Source = IconSource }; Icon.UpdateLayout(); Canvas.Children.Add(Icon); } Icon.Width = Icon.Height = Pie.InnerRadius * .5; Canvas.SetTop(Icon, top - PieBack.InnerRadius * 0.9); Canvas.SetLeft(Icon, (ActualWidth - Icon.Width) / 2); Icon.UpdateLayout(); } } else { LeftLabel.FontSize = Min.FontSize = MeasureTextBlock.FontSize * ratio * 0.6; Min.UpdateLayout(); LeftLabel.UpdateLayout(); Canvas.SetTop(GridLeft, top - GridLeft.ActualHeight); Canvas.SetLeft(GridLeft, ActualWidth / 2 - PieBack.InnerRadius); RightLabel.FontSize = Max.FontSize = MeasureTextBlock.FontSize * ratio * 0.6; Max.UpdateLayout(); RightLabel.UpdateLayout(); Canvas.SetTop(GridRight, top - GridRight.ActualHeight); Canvas.SetLeft(GridRight, ActualWidth / 2 + PieBack.InnerRadius - GridRight.ActualWidth); } GridLeft.UpdateLayout(); GridRight.UpdateLayout(); //August Lee if (Uses360Mode) { Canvas.SetTop(MeasureTextBlock, top - MeasureTextBlock.ActualHeight * .5); Canvas.SetLeft(MeasureTextBlock, ActualWidth / 2 - MeasureTextBlock.ActualWidth / 2); Canvas.SetTop(MeasureTextBlockUnit, top + (MeasureTextBlock.ActualHeight) * .5); Canvas.SetLeft(MeasureTextBlockUnit, ActualWidth / 2 - MeasureTextBlockUnit.ActualWidth / 2); Canvas.SetTop(Title, top + Title.ActualHeight + MeasureTextBlock.ActualHeight / 2); Canvas.SetLeft(Title, ActualWidth / 2 - Title.ActualWidth / 2); } else { Canvas.SetTop(MeasureTextBlock, top - (MeasureTextBlock.ActualHeight * 1.5)); Canvas.SetLeft(MeasureTextBlock, ActualWidth / 2 - MeasureTextBlock.ActualWidth / 2 - MeasureTextBlockUnit.ActualWidth / 2); Canvas.SetTop(MeasureTextBlockUnit, top - (MeasureTextBlock.ActualHeight * 0.5 + MeasureTextBlockUnit.ActualHeight * 1.2)); Canvas.SetLeft(MeasureTextBlockUnit, ActualWidth / 2 + MeasureTextBlock.ActualWidth / 2 - MeasureTextBlockUnit.ActualWidth / 2); Canvas.SetTop(Title, top - Title.ActualHeight); Canvas.SetLeft(Title, ActualWidth / 2 - Title.ActualWidth / 2); } var interpolatedColor = new Color { R = LinearInterpolation(FromColor.R, ToColor.R), G = LinearInterpolation(FromColor.G, ToColor.G), B = LinearInterpolation(FromColor.B, ToColor.B), A = LinearInterpolation(FromColor.A, ToColor.A) }; if (IsNew) { Pie.Fill = new SolidColorBrush(FromColor); Pie.WedgeAngle = 0; } if (DisableAnimations) { Pie.WedgeAngle = completed * angle; } else { Pie.BeginAnimation(PieSlice.WedgeAngleProperty, new DoubleAnimation(completed * angle, AnimationsSpeed)); } if (GaugeActiveFill == null) { ((SolidColorBrush)Pie.Fill).BeginAnimation(SolidColorBrush.ColorProperty, new ColorAnimation(interpolatedColor, AnimationsSpeed)); } else { Pie.Fill = GaugeActiveFill; } IsNew = false; }