/// <summary>
        /// 删除备份记录
        /// </summary>
        /// <param name="_backrecord"></param>
        public bool DelBackRecord(UIModels.DataBaseBackInfo _backrecord)
        {
            bool bolSucced = false;
            if (recordlist == null)
            {
                GetDataBackRecords();
            }
            if (recordlist != null && recordlist.Count > 0)
            {
                foreach (UIModels.DataBaseBackInfo item in recordlist)
                {
                    if (item.SortNo == _backrecord.SortNo)
                    {
                        recordlist.Remove(item);
                        if (File.Exists(item.DataFilePath))
                        {
                            File.Delete(item.DataFilePath);
                        }
                        break;
                    }
                }

                int SortNo = 1;
                foreach (UIModels.DataBaseBackInfo item in recordlist)
                {
                    item.SortNo = SortNo;
                    SortNo++;
                }

               bolSucced= SaveRecords();//保存记录

            }

            return bolSucced;
        }
 /// <summary>
 /// 导出销售汇总记录至Excel 构造函数
 /// </summary>
 /// <param name="_list">列表</param>
 /// <param name="_type">类型</param>
 /// <param name="_SavePath">保存路径</param>
 public ExPortDataToExcel(System.Collections.ICollection _list, UIModels.SellTotalType _type, string _SavePath)
 {
     dataList = _list;
      SellTotalType = _type;
     SaveExcelPath = _SavePath;
     IsExportSellTotalData = true;
 }
        /// <summary>
        /// 添加新备份
        /// </summary>
        /// <param name="_backrecord"></param>
        /// <returns></returns>
        public bool AddBackRecord(UIModels.DataBaseBackInfo _backrecord)
        {
            bool bolsucced = false;
            if (recordlist == null)
            {
                GetDataBackRecords();
            }
            if (recordlist== null)
            {
                recordlist=new List<UIModels.DataBaseBackInfo> ();
            }
            recordlist.Add(_backrecord);

            //重新排序号
            int SortNo = 1;
            foreach (UIModels.DataBaseBackInfo item in recordlist)
            {
                item.SortNo = SortNo;
                SortNo++;
            }

            if (SaveRecords())
            {
                bolsucced = true;
            }

            return bolsucced;
        }
示例#4
0
        /// <summary>
        /// 新增表单
        /// </summary>
        /// <param name="_entrytype"></param>
        public EntryForm(UIModels.EntryType _entrytype,DeviceInfo _deviceinfo)
        {
            ThisEntryType = _entrytype;
            //thisdeviceinfo = _deviceinfo;
            InitializeComponent();

            LoadDeviceItems();
        }
示例#5
0
        /// <summary>
        /// 编辑表单信息
        /// </summary>
        /// <param name="_entrytype"></param>
        /// <param name="_Model"></param>
        public EntryForm(UIModels.EntryType _entrytype, object _Model, DeviceInfo _deviceinfo)
        {
            ThisEntryType = _entrytype;
            ModelData = _Model;
            thisdeviceinfo = _deviceinfo;
            InitializeComponent();

            LoadDeviceItems();
        }
        public void GetListData(UIModels.EntryType _type,KPS.Model.DeviceInfo _device)
        {
            ThisType = _type;
            DeviceInfo = _device;

            _thread = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadStart));
            _thread.IsBackground = true;
            _thread.Start();
        }
示例#7
0
        static void Main(string[] args)
        {
            string   userInput = null;
            UIModels uiModel   = new UIModels();
            string   msg       = "";

            do
            {
                userInput = Choise();
                switch (userInput.ToUpper())
                {
                case "C":
                    uiModel.Create();
                    msg = "---------------------------------";
                    break;

                case "R":
                    uiModel.ReadById(4);
                    msg = "---------------------------------";
                    break;

                case "U":
                    uiModel.Update();
                    msg = "---------------------------------";
                    break;

                case "D":
                    uiModel.Delete(13);
                    msg = "---------------------------------";
                    break;

                case "X":
                    msg = "Lopetetaan...";
                    break;

                default:
                    msg = "Yritä uudestaan oikealla näppäimellä";
                    break;
                }
                Console.WriteLine(msg);
            } while (userInput.ToUpper() != "X");
        }
 /// <summary>
 /// 初始化类型
 /// </summary>
 /// <param name="_EntryType"></param>
 public override void InitType(UIModels.EntryType _EntryType)
 {
     _ThisTypevalue = _EntryType;
 }
 public virtual void SetEntryType(UIModels.EntryType _type)
 {
     _EntryType = _type;
 }
示例#10
0
        /// <summary>
        /// 1.1 初始化列表显示
        /// </summary>
        /// <param name="_Type"></param>
        private void InitRecordList(UIModels.EntryType _Type)
        {
            List<ListColumnInfo> ColumnArray = new List<ListColumnInfo>();
            //右键菜单是否可用
            bool ContextMenuStripState = true;
            switch (_Type)
            {
                case UIModels.EntryType.ZDSJGJ://1诊断试剂购进
                    ColumnArray = GetZDSJGJColumns();
                    ContextMenuStripState = false;
                    break;
                case UIModels.EntryType.YS://2验收
                    ColumnArray = GetYSColumns();
                    break;
                case UIModels.EntryType.CC://3存储,仓库
                    ColumnArray = GetCCColumns();
                    break;
                case UIModels.EntryType.XS://4.销售
                    ColumnArray = GetXSColumns();
                    ContextMenuStripState = false;
                    break;
                case EntryType.CK://5.出库
                    ColumnArray = GetCKColumns();
                    break;
                case EntryType.SH://6.售后
                    ColumnArray = GetSHColumns();
                    break;
                case EntryType.BHGPJL://7.不合格品记录
                    ColumnArray = GetBHGPJLColumns();
                    break;
                case EntryType.BLSJ://8.不合格品记录
                    ColumnArray = GetBLSJColumns();
                    break;
                case EntryType.ZLGZ://9.质量跟踪
                    ColumnArray = GetZLGZColumns();
                    break;
                case EntryType.Inventory://库存查询
                    ColumnArray = GetInventoryColumns();
                    ContextMenuStripState = false;
                    break;
                default:
                    ColumnArray = GetZDSJGJColumns();
                    break;
            }
            if (this.RecordListView != null)
            {
                panel2.Controls.Remove(this.RecordListView);
            }
            this.RecordListView = null;
            this.RecordListView = new FastObjectListView();
            this.RecordListView.VirtualMode = true;
            this.RecordListView.Cursor = System.Windows.Forms.Cursors.Default;
            this.RecordListView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.RecordListView.GridLines = true;
            this.RecordListView.FullRowSelect = true;
            this.RecordListView.HeaderUsesThemes = false;
            this.RecordListView.HeaderWordWrap = true;
            this.RecordListView.HideSelection = false;
            this.RecordListView.Location = new System.Drawing.Point(0, 110);
            this.RecordListView.Name = "PInfoListView";
            this.RecordListView.ShowGroups = false;
            this.RecordListView.UseCompatibleStateImageBehavior = false;
            this.RecordListView.UseHotItem = true;
            this.RecordListView.View = System.Windows.Forms.View.Details;
            this.RecordListView.OwnerDraw = true;
            //this.RecordListView.ShowGroups =true;

            this.InitializedListColumn(ColumnArray, _Type);//初始化栏位信息
            panel2.Controls.Add(this.RecordListView);
            this.RecordListView.SelectionChanged += new EventHandler(RecordListView_SelectionChanged);

            if (!ContextMenuStripState)
            {
                this.RecordListView.ContextMenuStrip = null;
            }
            else
            {
                this.RecordListView.ContextMenuStrip = this.contextMenuStrip1;
            }

            //列表打印初始化
            listViewPrinter1.ListView = this.RecordListView;
        }
示例#11
0
 /// <summary>
 ///  1.3 初始化栏位
 /// </summary>
 /// <param name="ColumnArray">列数组</param>
 /// <param name="_Type">类型</param>
 private void InitializedListColumn(List<ListColumnInfo> ColumnArray, UIModels.EntryType _Type)
 {
     if (this.RecordListView.Columns != null && this.RecordListView.Columns.Count > 0)
     {
         this.RecordListView.Columns.Clear();
     }
     IListViewColumnFormater iformater = null;
     switch (_Type)
     {
         case EntryType.ZDSJGJ:
             iformater = new UIBLL.GouJinInfoListFormater();
             break;
         case EntryType.YS:
             iformater = new UIBLL.YanShouInfoListFormaterManager();
             break;
         case EntryType.CC:
             iformater = new UIBLL.CunChuInfoListFormatManager();
             break;
         case EntryType.XS:
             iformater = new UIBLL.XiaoShouInfoListFormaterManager();
             break;
         case EntryType.CK:
             iformater = new UIBLL.ChuKuInfoListFormatManager();
             break;
         case EntryType.SH:
             iformater = new UIBLL.ShouHouInfoListFormaterManager();
             break;
         case EntryType.BHGPJL:
             iformater = new UIBLL.BuHeGePinJiLuInfoListFormatManager();
             break;
         case EntryType.BLSJ:
             iformater = new UIBLL.BuLiangShiJianInfoListFormatManager();
             break;
         case EntryType.ZLGZ:
             iformater = new UIBLL.ProcessLoggingInfoListFormaterManager();
             break;
         case EntryType.Inventory:
             iformater = new UIBLL.InventoryInfoListFormaterManager();
             break;
         default:
             break;
     }
     InitListViewColumnManager manager = new InitListViewColumnManager();
     manager.Init(this.RecordListView, ColumnArray, iformater);
 }
示例#12
0
 public DataQueryFrm(UIModels.EntryType _Type,KPS.Model.DeviceInfo _device)
 {
     ThisType = _Type;
     //ThisDevice = _device;
     InitializeComponent();
 }
示例#13
0
 /// <summary>
 /// 2.3.调用显示表单录入界面方法
 /// </summary>
 /// <param name="_etype"></param>
 private void ShowEntryFrom(UIModels.EntryType _etype)
 {
     EntryForm efrm = new EntryForm(_etype, SelectedDevice);
     efrm.ShowDialog();
 }
示例#14
0
 /// <summary>
 /// 还原数据库至本地的一个版本
 /// </summary>
 /// <param name="_backrecord">本地备份版本信息</param>
 public void RestoreByLocalVesion(UIModels.DataBaseBackInfo backrecordinfo)
 {
     _backrecord = backrecordinfo;
     System.Threading.Thread restoreToVesionthread = new System.Threading.Thread(new System.Threading.ThreadStart(RestoreThread));
     restoreToVesionthread.IsBackground = true;
     restoreToVesionthread.Start();
 }
示例#15
0
        static void Main(string[] args)
        {
            string   userInput = null;
            UIModels uiModels  = new UIModels();
            string   msg       = "";

            do
            {
                userInput = Choise();
                switch (userInput.ToUpper())
                {
                case "1":
                    uiModels.CreateBank();
                    msg = "Uusi pankki luotu";
                    break;

                case "2":
                    uiModels.UpdateBank();
                    msg = "Pankin tiedot päivitetty";
                    break;

                case "3":
                    uiModels.DeleteBank(9);
                    msg = "Pankki poistettu";
                    break;

                case "4":
                    uiModels.CreateCustomerAccount();
                    msg = "Asiakas ja tili luotu";
                    break;

                case "5":
                    uiModels.ReadAccountsByBankId(7);     //doesn´t print accounts
                    break;

                case "6":
                    uiModels.ReadCustomerByBankId(6);
                    msg = "Pankin asiakkaat tulostettu";
                    break;

                case "7":
                    uiModels.UpdateCustomer();
                    msg = "Asiakkaan tiedot päivitetty";
                    break;

                case "8":
                    uiModels.DeleteCustomer(30);
                    msg = "Asiakas poistettu";
                    break;

                case "9":
                    uiModels.ReadCustomerInfo(15);     // doesn´t print balance or accounts name
                    break;

                case "10":
                    uiModels.AddTransaction();     //doesn´t work
                    break;

                case "11":
                    uiModels.ReadTransactionById(15);
                    msg = "Tilitapahtumat tulostettu";
                    break;

                case "X":
                    msg = "Sovellus suljetaan...";
                    break;

                default:
                    msg = "Yritä uudestaan oikealla näppäimellä";
                    break;
                }
                Console.WriteLine(msg);
            } while (userInput.ToUpper() != "X");
        }
 /// <summary>
 /// 导出数据至Excel 构造函数
 /// </summary>
 /// <param name="_list"></param>
 /// <param name="_type"></param>
 /// <param name="_SavePath">导出文件存储路径</param>
 public ExPortDataToExcel(System.Collections.ICollection _list, UIModels.EntryType _type,string _SavePath)
 {
     dataList = _list;
     dataType = _type;
     SaveExcelPath = _SavePath;
 }
示例#17
0
 /// <summary>
 /// 录入类型
 /// </summary>
 /// <param name="_type"></param>
 public override void SetEntryType(UIModels.EntryType _type)
 {
     _EntryType = _type;
 }
 /// <summary>
 /// 初始化类型
 /// </summary>
 /// <param name="_EntryType"></param>
 public virtual void InitType(UIModels.EntryType _EntryType)
 {
 }