Exemple #1
0
        private void frmWeightQueryBC_Load(object sender, EventArgs e)
        {
            CommonMethod.RefreshAndAutoSize(ultraGrid1);

            try
            {
                dateTimePicker1.Value = DateTime.Today;
                dateTimePicker2.Value = DateTime.Today.AddDays(1).AddSeconds(-1);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            try
            {
                this.ultraGrid1.DisplayLayout.Bands[1].Columns["FS_SHIFT"].ValueList = CommonMethod.GetValuelistBanci();
                this.ultraGrid1.DisplayLayout.Bands[1].Columns["FS_TERM"].ValueList  = CommonMethod.GetValuelistBanzu();
            }
            catch { }

            try
            {
                string strKey = this.CustomInfo.ToUpper();

                if (!string.IsNullOrEmpty(strKey) && strKey.Length == 1)
                {
                    if (strKey.Substring(0, 1).Equals("0"))                         //查询
                    {
                        this.ultraToolbarsManager1.Toolbars[1].Visible = false;
                        this.SetToolButtonVisible("判定不合格", false);
                        this.SetToolButtonVisible("撤销不合格", false);
                    }
                    else if (strKey.Substring(0, 1).Equals("1"))                    //补打
                    {
                        this.ultraToolbarsManager1.Toolbars[1].Visible = true;
                        this.SetToolButtonVisible("判定不合格", false);
                        this.SetToolButtonVisible("撤销不合格", false);
                    }
                    else if (strKey.Substring(0, 1).Equals("2"))                    //判废
                    {
                        this.ultraToolbarsManager1.Toolbars[1].Visible = false;
                        this.SetToolButtonVisible("判定不合格", true);
                        this.SetToolButtonVisible("撤销不合格", true);
                    }
                }
            }
            catch { }

            try
            {
                pictureBox3.Hide();
                pictureBox3.SendToBack();
            }
            catch { }
        }