Example #1
0
        protected override string[] FormatExportRecord(object obj)
        {
            bool[]    opList    = new OperationListFactory().CreateOperationListBooleanArray((obj as Operation).OPControl);
            ArrayList arrayList = new ArrayList(opList.Length);

            for (int i = 0; i < opList.Length; i++)
            {
                arrayList.Add(opList[i]);
            }
            //导出的时候不需要哪列,就RemoveAt去掉对应的,具体的对照数据参考OperationListFactory中
            arrayList.RemoveAt(7);
            string[] values = new string[4 + arrayList.Count];
            values[0] = ((Operation)obj).OPCode.ToString();
            values[1] = ((Operation)obj).OPDescription.ToString();

            for (int i = 0; i < arrayList.Count; i++)
            {
                values[2 + i] = FormatHelper.DisplayBoolean(Convert.ToBoolean(arrayList[i].ToString().ToLower()), this.languageComponent1);
            }

            values[2 + arrayList.Count]     = ((Operation)obj).GetDisplayText("MaintainUser");
            values[2 + arrayList.Count + 1] = FormatHelper.ToDateString(((Operation)obj).MaintainDate);

            return(values);
        }
Example #2
0
        protected override DataRow GetGridRow(object obj)
        {
            bool[]  opList = new OperationListFactory().CreateOperationListBooleanArray((obj as Operation).OPControl);
            DataRow row    = this.DtSource.NewRow();

            object[] values = new object[8 + opList.Length];
            //values[0] = "false";
            row["OPCode"]        = ((Operation)obj).OPCode.ToString();
            row["OPDescription"] = ((Operation)obj).OPDescription.ToString();
            row["OPControl"]     = ((Operation)obj).OPControl;
            string[] strings = new OperationListFactory().CreateOperationListColumnsHead();
            for (int i = 0; i < opList.Length; i++)
            {
                row[strings[i]] = opList[i];
            }

            row["MaintainUser"] = ((Operation)obj).GetDisplayText("MaintainUser");
            row["MaintainDate"] = FormatHelper.ToDateString(((Operation)obj).MaintainDate);
            row["MaintainTime"] = FormatHelper.ToTimeString(((Operation)obj).MaintainTime);

            return(row);



            //return new Infragistics.WebUI.UltraWebGrid.UltraGridRow( values );

//			return new Infragistics.WebUI.UltraWebGrid.UltraGridRow(
//				new object[]{"false",
//								((Operation)obj).OPCode.ToString(),
//								((Operation)obj).OPCollectionType,
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[0]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[1]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[2]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[3]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[4]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[5]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[6]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[7]),
//								FormatHelper.BooleanToGirdCheckBoxString(((Operation)obj).OPControl[8]),
//								((Operation)obj).OPDescription.ToString(),
//								((Operation)obj).MaintainUser.ToString(),
//								FormatHelper.ToDateString(((Operation)obj).MaintainDate),
//								FormatHelper.ToTimeString(((Operation)obj).MaintainTime)
//							});
        }
Example #3
0
        //protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj)
        //{
        //    bool[] opList = new OperationListFactory().CreateOperationListBooleanArray( (obj as OperationOfRoute).OPControl );
        //    object[] values = new object[ 8 + opList.Length ];
        //    values[0] = "false";
        //    values[1] = ((OperationOfRoute)obj).OPSequence;
        //    values[2] = ((OperationOfRoute)obj).OPCode.ToString();
        //    values[3] = ((OperationOfRoute)obj).OPDescription.ToString();

        //    for(int i=0;i<opList.Length;i++)
        //    {
        //        values[ 4 + i ] = opList[i];
        //    }

        //    values[4 + opList.Length] = ((Operation)obj).GetDisplayText("MaintainUser");
        //    values[ 4 + opList.Length + 1 ] = FormatHelper.ToDateString(((Operation)obj).MaintainDate);
        //    values[ 4 + opList.Length + 2 ] = FormatHelper.ToTimeString(((Operation)obj).MaintainTime);
        //    values[ 4 + opList.Length + 3 ] = "";

        //    return new Infragistics.WebUI.UltraWebGrid.UltraGridRow( values );
        //}

        protected override DataRow GetGridRow(object obj)
        {
            DataRow row = this.DtSource.NewRow();

            row["OPSequence"]    = ((OperationOfRoute)obj).OPSequence;
            row["OPCode"]        = ((OperationOfRoute)obj).OPCode.ToString();
            row["OPDescription"] = ((OperationOfRoute)obj).OPDescription.ToString();

            bool[]   opList  = new OperationListFactory().CreateOperationListBooleanArray((obj as Operation).OPControl);
            string[] strings = new OperationListFactory().CreateOperationListColumnsHead();
            for (int i = 0; i < opList.Length; i++)
            {
                row[strings[i]] = opList[i];
            }

            row["MaintainUser"] = ((Operation)obj).GetDisplayText("MaintainUser");
            row["MaintainDate"] = FormatHelper.ToDateString((obj as Operation).MaintainDate);
            row["MaintainTime"] = FormatHelper.ToTimeString((obj as Operation).MaintainTime);
            return(row);
        }