示例#1
0
        private void FrmProject_SumDialog_Load(object sender, EventArgs e)
        {
            PW_tb3c type = new PW_tb3c();
            type.col4 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3c> list0 = Services.BaseService.GetList<PW_tb3c>("SelectPW_tb3cList", type);
            object[] obj = new object[list0.Count];
            for (int i = 0; i < list0.Count;i++ )
            {
                obj[i] = list0[i].col1;
            }
            this.repositoryItemComboBox1.Items.AddRange(obj);
            for(int i=1960;i<2040;i++){
                repositoryItemComboBox9.Items.Add(i.ToString());
            }

            IList<PW_tb3a> list = new List<PW_tb3a>();
            list.Add(Object);
            this.vGridControl.DataSource = list;
        }
示例#2
0
        private void FrmProject_Sum_Load(object sender, EventArgs e)
        {
            InitRight();
            this.gridBand7.Columns.Add(this.bandedGridColumn5);
            this.gridBand18.Columns.Add(this.bandedGridColumn6);
            DevExpress.XtraEditors.Controls.CheckedListBoxItem[] chkItems = null;
            this.checkedListBoxControl1.Items.Clear();
            PW_tb3c pc = new PW_tb3c();
            pc.col4 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3c> list3 = Services.BaseService.GetList<PW_tb3c>("SelectPW_tb3cList", pc);

            chkItems = new DevExpress.XtraEditors.Controls.CheckedListBoxItem[list3.Count];
            for (int i = 0; i < list3.Count; i++)
            {
                chkItems.SetValue(new DevExpress.XtraEditors.Controls.CheckedListBoxItem(list3[i].col1), i);
                //if (((Layer)tmplaylist[i]).Visible)
                //{
                //    chkItems[i].CheckState = CheckState.Checked;
                //}
            }
            this.checkedListBoxControl1.Items.AddRange(chkItems);
            this.checkedListBoxControl1.Location = new System.Drawing.Point(0, 0);
            this.checkedListBoxControl1.Name = "checkedListBoxControl1";
            this.popupContainerEdit1.Properties.PopupControl = this.popupContainerControl1;
        }
示例#3
0
        /// <summary>
        /// �޸Ľ������
        /// </summary>
        public void UpdateObject()
        {
            //��ȡ�������
            PW_tb3c obj = FocusedObject;
            if (obj == null)
            {
                return;
            }

            //���������һ������
            PW_tb3c objCopy = new PW_tb3c();
            DataConverter.CopyTo<PW_tb3c>(obj, objCopy);

            //ִ���޸IJ���
            using (FrmPW3cDialog dlg = new FrmPW3cDialog())
            {
                dlg.Object = objCopy;   //�󶨸���
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //�ø������½������
            DataConverter.CopyTo<PW_tb3c>(objCopy, obj);
            //ˢ�±��
            gridControl.RefreshDataSource();
        }
示例#4
0
        /// <summary>
        /// ˢ�±���е�����
        /// </summary>
        /// <returns>ture:�ɹ�  false:ʧ��</returns>
        public bool RefreshData()
        {
            try
            {

                this.gridView.GroupPanelText = "��������������ñ�";
                PW_tb3c p = new PW_tb3c();
                p.col4 = Itop.Client.MIS.ProgUID;
                IList<PW_tb3c> list = Services.BaseService.GetList<PW_tb3c>("SelectPW_tb3cList",p);
                this.gridControl.DataSource = list;
            }
            catch (Exception exc)
            {
                Debug.Fail(exc.Message);
                HandleException.TryCatch(exc);
                return false;
            }

            return true;
        }
示例#5
0
        /// <summary>
        /// ��Ӷ���
        /// </summary>
        public void AddObject()
        {
            //�����������Ƿ��Ѿ�����
            if (ObjectList == null)
            {
                return;
            }
            //�½�����
            PW_tb3c obj = new PW_tb3c();
            obj.UID = Guid.NewGuid().ToString();

            //ִ����Ӳ���
            using (FrmPW3cDialog dlg = new FrmPW3cDialog())
            {
                dlg.IsCreate = true;    //�����½���־
                dlg.Object = obj;
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            //���¶�����뵽������
            ObjectList.Add(obj);

            //ˢ�±�񣬲��������ж�λ���¶����ϡ�
            gridControl.RefreshDataSource();
            GridHelper.FocuseRow(this.gridView, obj);
        }
示例#6
0
        //�˴�Ϊ��̬������ݷ���
        private void Sheet_AddData(FarPoint.Win.Spread.SheetView obj_sheet)
        {
            int startrow = 3;
            int addnum = 0;
            int itemcount = 0;
            int firstrow = 0;
            ArrayList rowsum = new ArrayList();
            Itop.Domain.PWTable.PW_tb3a p = new Itop.Domain.PWTable.PW_tb3a();
            p.col2 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3a> list = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aBy2251", p);

            PW_tb3c p3 = new PW_tb3c();
            p3.col4 = Itop.Client.MIS.ProgUID;
            IList<PW_tb3c> plist = Services.BaseService.GetList<PW_tb3c>("SelectPW_tb3cList", p3);
            IList<PW_tb3a> alist = Services.BaseService.GetList<PW_tb3a>("SelectPW_tb3aListDIS",p);

            for (int n = 0; n < plist.Count; n++)
            {
                rowsum.Add("");
            }
            bool sheetEnd = false;
            for (int i = 0; i < list.Count;i++ )
            {

                PW_tb3a obj = list[i];
                PW_tb3a obj2 = new PW_tb3a();
                if (i < list.Count - 1)
                {
                    obj2 = list[i + 1];
                }
                else
                {
                    sheetEnd = true;
                }
                itemcount = itemcount + 1;
                obj_sheet.RowCount = obj_sheet.RowCount + 1;
                obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                obj_sheet.SetValue(i + addnum + startrow, 1, obj.PQtype);
                obj_sheet.SetValue(i + addnum + startrow, 2, obj.Num10);
                obj_sheet.SetValue(i + addnum + startrow, 3, obj.Num3);
                obj_sheet.SetValue(i + addnum + startrow, 4, obj.Num2);
                obj_sheet.SetValue(i + addnum + startrow, 5, obj.Num4);
                obj_sheet.SetValue(i + addnum + startrow, 6, obj.KggNum);
                obj_sheet.SetValue(i + addnum + startrow, 7, obj.KG);
                obj_sheet.SetValue(i + addnum + startrow, 8, obj.KgzHwNum);
                obj_sheet.SetValue(i + addnum + startrow, 9, obj.Num11);
               // obj_sheet.SetValue(i + 3, 10, 1);
                if (obj.PQName != obj2.PQName)
                {
                    addnum = addnum + 1;
                        for (int x = 0; x < rowsum.Count; x++)
                        {
                            string str = (string)rowsum[x];
                            str = str + Convert.ToString(i + addnum + startrow - x - 1) + ",";
                            rowsum[x] = str;
                        }

                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, obj.PQName);
                    obj_sheet.SetValue(i + addnum + startrow, 1, "��");
                    int num1 = startrow + addnum + firstrow;
                    if (firstrow == 0) { num1 = num1 - 1; }
                    TC.Sheet_WriteFormula_RowSum(obj_sheet, num1, 2, itemcount, 1, i + addnum + startrow, 2, 8);
                    obj_sheet.AddSpanCell(num1, 0, itemcount+1, 1);
                    firstrow = i;
                    startrow = 3;
                    itemcount = 0;
                }
                if (sheetEnd)
                {
                    int[] sum = new int[plist.Count];
                    rowsum.Reverse();
                    for (int m = 0; m < plist.Count; m++)
                    {
                        PW_tb3c _p = plist[m];
                        addnum = addnum + 1;
                        obj_sheet.RowCount = obj_sheet.RowCount + 1;
                        obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                        obj_sheet.SetValue(i + addnum + startrow, 1, _p.col1);
                        sum[m] = i + addnum + startrow;
                        int num1 = startrow + addnum + firstrow;
                        //if (firstrow == 0) { num1 = num1 - 1; }
                        TC.Sheet_WriteFormula_RowSum3(obj_sheet, TC.getRowList(rowsum[m].ToString()), 2, i + addnum + startrow, 2, 8);
                    }
                    addnum = addnum + 1;
                    obj_sheet.RowCount = obj_sheet.RowCount + 1;
                    obj_sheet.SetValue(i + addnum + startrow, 0, "ȫ�кϼ�");
                    obj_sheet.SetValue(i + addnum + startrow, 1, "�ܼ�");
                    TC.Sheet_WriteFormula_RowSum3(obj_sheet, sum, 2, i + addnum + startrow, 2, 8);
                    obj_sheet.AddSpanCell(sum[0], 0, sum.Length+1, 1);
                }
            }
        }