2010.04.19

   private void SetOrder()
        {
            this.btnGetValue.Enabled = false;
            this.btnSave.Enabled = false;
            ISGetData8 = AllowUpdate.No;
            ISGetData20 = AllowUpdate.No;

            bool dd1 = ModulePrivilegeUtility.CheckFunctionPrivilege("ScheduleNodeDefault", "003");
            if (dd1 == true)
            {
                this.btnGetValue.Enabled = true;
                this.btnSave.Enabled = true;
                ISGetData8 = AllowUpdate.Yes;
                ISGetData20 = AllowUpdate.Yes;
            }
            else
            {
                bool dd2 = ModulePrivilegeUtility.CheckFunctionPrivilege("ScheduleNodeDefault", "002");
                if (dd2 == true)
                {
                    this.btnGetValue.Enabled = false;
                    this.btnSave.Enabled = false;
                   
                    if (DropDownList1.SelectedValue == "all")
                    {
                        this.btnGetValue.Enabled = false;
                        this.btnSave.Enabled = false;
                    }
                    else if (DropDownList1.SelectedValue == startDayClass.ToString())
                    {
                        if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) >= DateTime.Parse(this.txtDateTime.Text + " " + startDayClass.ToString()) && DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) < DateTime.Parse(this.txtDateTime.Text + " " + endDayClass.ToString()))
                        {
                            ISGetData8 = AllowUpdate.Yes;
                            ISGetData20 = AllowUpdate.No;
                           
                            DropDownList1.SelectedValue = startDayClass.ToString();
                            this.btnGetValue.Enabled = true;
                            this.btnSave.Enabled = true;
                        }
                    }
                    else if (DropDownList1.SelectedValue == startNightClass.ToString())
                    {
                        if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) >= DateTime.Parse(this.txtDateTime.Text + " " + startNightClass.ToString()) || DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm")) < DateTime.Parse(this.txtDateTime.Text + " " + endNightClass.ToString()))
                        {
                            ISGetData8 = AllowUpdate.No;
                            ISGetData20 = AllowUpdate.Yes;
                           
                            DropDownList1.SelectedValue = startNightClass.ToString();
                            this.btnGetValue.Enabled = true;
                            this.btnSave.Enabled = true;
                           
                        }
                    }

                    if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) > DateTime.Parse(this.txtDateTime.Text))
                    {
                        ISGetData8 = AllowUpdate.No;
                        ISGetData20 = AllowUpdate.No;
                       
                        btnGetValue.Enabled = false;
                        this.btnSave.Enabled = false;
                    }
                  

                }
               


            }
            setUltraGridColumnUpdate(ISGetData8, ISGetData20);
            if (this.UltraWebGrid1.Columns.FromKey("EQUIP") != null)
            {
                this.UltraWebGrid1.Columns.FromKey("EQUIP").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("MAT").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("UNIT").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("EQUIP1").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("MAT").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("UNIT1").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("EQUIP2").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("MAT2").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("MAT").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("UNIT2").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("CAP2").CellStyle.Wrap = true;
                this.UltraWebGrid1.Columns.FromKey("TYPEEQUIP2").CellStyle.Wrap = true;
                bool dayClass = true;
                bool nightClass = true;
                if (DropDownList1.SelectedValue == startDayClass.ToString())
                {
                    dayClass = false;

                }
                else if (DropDownList1.SelectedValue == startNightClass.ToString())
                {
                    nightClass = false;
                }
                else
                {
                    dayClass = false;
                    nightClass = false;
                }
                this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION6").Hidden = dayClass;
                this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION18").Hidden = nightClass;
                this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION61").Hidden = dayClass;
                this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION181").Hidden = nightClass;
                this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION62").Hidden = dayClass;
                this.UltraWebGrid1.Columns.FromKey("TAGEXPRESSION182").Hidden = nightClass;
            }
    
        }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值