public MaintenancePlanAppSetting(MaintainPlanView plan, Common.DefineConstantValue.EditStateEnum editState)
        {
            InitializeComponent();

            init();
            if (editState == Common.DefineConstantValue.EditStateEnum.OE_Update)
            {
                showModify();
            }
            else if (editState == Common.DefineConstantValue.EditStateEnum.OE_ReaOnly)
            {
                showView();
            }

            this._planView = plan;

            SetValue();
        }
Example #2
0
        ///// <summary>
        ///// 刷新數據
        ///// </summary>
        //private void BindingView()
        //{
        //    Model.HBPMS.Management.RunningManagement.MaintainOperationMaster_mom_Info maintainItem = new Model.HBPMS.Management.RunningManagement.MaintainOperationMaster_mom_Info();
        //    maintainItem.mom_cMachineModel = cbxPrinterType.SelectedValue.ToString();
        //    var MaintainOperations = _maintainOperationMasterBL.FindRecord(maintainItem);
        //    this.lvInfo.Items.Clear();
        //    this.lvInfo.BeginUpdate();
        //    lvInfo.SetDataSource<Model.HBPMS.Management.RunningManagement.MaintainOperationMaster_mom_Info>(MaintainOperations);
        //    this.lvInfo.EndUpdate();
        //}
        private void lvInfo_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListDataView view = sender as ListDataView;

            if (view != null && view.SelectedItems.Count > 0)
            {
                this.SysToolBar.BtnDelete_IsEnabled = true;
                this.SysToolBar.BtnDetail_IsEnabled = true;
                this.SysToolBar.BtnModify_IsEnabled = true;

                int infoID = view.SelectedItems[0].Index;// as NoticeManage_Info;

                _planInfo = _showDataList[infoID];
            }
            else
            {
                this.SysToolBar.BtnDelete_IsEnabled = false;
                this.SysToolBar.BtnDetail_IsEnabled = false;
                this.SysToolBar.BtnModify_IsEnabled = false;
                _planInfo = null;
            }
        }
Example #3
0
        public List<MaintainPlanView> SearchRecord(MaintainPlanView searchInfo)
        {
            List<MaintainPlanView> listReturn = new List<MaintainPlanView>();
            try
            {
                MaintainPlanView srmSearchInfo = searchInfo as MaintainPlanView;

                StringBuilder sbSQL = new StringBuilder();
                //sbSQL.AppendLine("select * from dbo.MaintainPlan_mtp where 1=1 ");

                sbSQL.AppendLine("select cmt_cRemark  as mtp_cMachineModelName, *  from dbo.MaintainPlan_mtp "
                                + " join dbo.MaintainOperationMaster_mom "
                                + " on mtp_iMOMID=mom_iRecordID "
                                + "left join CodeMaster_cmt on cmt_cKey1='" + Common.DefineConstantValue.CodeMasterDefine.KEY1_TYPEVALUE + "' and cmt_cKey2='" + Common.DefineConstantValue.CodeMasterDefine.KEY2_MACHINEMODEL + "' and cmt_cValue=mtp_cMachineModel where 1=1");

                StringBuilder sbWhere = new StringBuilder();

                if (!String.IsNullOrEmpty(searchInfo.mom_cOperationName))
                {
                    sbWhere.AppendLine(" and mom_cMachineModel ='" + searchInfo.mom_cOperationName + "' ");
                }

                sbSQL.Append(sbWhere);

                IEnumerable<MaintainPlanView> infos = null;

                using (MainDBDataContext db = new MainDBDataContext())
                {
                    infos = db.ExecuteQuery<MaintainPlanView>(sbSQL.ToString(), new object[] { });
                    if (infos != null)
                    {
                        listReturn = infos.ToList();
                    }
                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
            return listReturn;
        }
Example #4
0
        private void BingGv()
        {
            if (this.cbxPrinterType.SelectedValue != null)
            {
                MaintainPlanView planView = new MaintainPlanView();

                int typeNo = this.cbxPrinterType.SelectedIndex;
                if (typeNo >= 0)
                {
                    planView.mom_cOperationName = this.cbxPrinterType.SelectedValue.ToString();
                }

                var list = _maintainPlanBL.SearchRecord(planView);

                _showDataList = list as List<MaintainPlanView>;

                this.lvInfo.SetDataSource(list);
            }
        }
Example #5
0
 public List<MaintainPlanView> SearchRecord(MaintainPlanView searchInfo)
 {
     try
     {
         return this._IMaintainPlanDA.SearchRecord(searchInfo);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }