コード例 #1
0
ファイル: AreaMasterDA.cs プロジェクト: Klutzdon/PBIMSN
        public bool AddInArea(AreaMaster_amr_Info objArea, List<MachineMaster_mmt_Info> machines)
        {
            bool isSuccess = false;

            if (objArea != null && machines != null)
            {
                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        foreach (MachineMaster_mmt_Info item in machines)
                        {
                            MachineMaster_mmt updateData = db.MachineMaster_mmt.FirstOrDefault(t => t.mmt_cMachineID == item.mmt_cMachineID);

                            if (updateData != null)
                            {
                                updateData.mmt_cAreaID = objArea.amr_cRecordID;
                            }
                        }

                        db.SubmitChanges();

                        isSuccess = true;
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return isSuccess;
        }
コード例 #2
0
ファイル: FrmAreaInfo.cs プロジェクト: Klutzdon/PBIMSN
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (VaildCheck())
            {
                AreaMaster_amr_Info insertInfo = new AreaMaster_amr_Info();

                insertInfo.amr_cAreaName  = txtName.Text.Trim();

                insertInfo.amr_cDescription  = txtRemark.Text.Trim();

                ReturnValueInfo returnInfo = this._areaMasterBL.Save(insertInfo, Common.DefineConstantValue.EditStateEnum.OE_Insert);

                if (returnInfo.boolValue)
                {
                    ShowInformationMessage("新增成功!");
                    if (MyCallBack != null)
                    {
                        MyCallBack();
                        this.Close();
                    }
                }

                else
                {
                    ShowErrorMessage(returnInfo.messageText);
                }
            }
        }
コード例 #3
0
ファイル: AreaMasterBL.cs プロジェクト: Klutzdon/PBIMSN
        /// <summary>
        /// 添加機臺到目標區域
        /// </summary>
        /// <param name="objArea"></param>
        /// <param name="machines"></param>
        /// <returns></returns>
        public bool AddInArea(AreaMaster_amr_Info objArea, List<MachineMaster_mmt_Info> machines)
        {
            try
            {
                return this._areaMasterDA.AddInArea(objArea, machines);
            }
            catch (Exception Ex)
            {

                throw Ex;
            }
        }
コード例 #4
0
ファイル: MachineAreaMaster.cs プロジェクト: Klutzdon/PBIMSN
        private void BingGv()
        {
            #region

            AreaMaster_amr_Info entity = new AreaMaster_amr_Info();
            entity.amr_cAreaName   = txtAreaName.Text.Trim().Replace("'", "''");
            entity.amr_cAreaCode  = txtAreaCode.Text.Trim().Replace("'", "''");
            var info = _AreaMasterBL.SearchRecords(entity);

            this.lvInfo.SetDataSource(info);

            #endregion
        }
コード例 #5
0
        public AreaMasterAddMainces()
        {
            InitializeComponent();

            objAreMaster = null;

            this._currentAreMaster = null;

            try
            {
                this._areaMasterBL = MasterBLLFactory.GetBLL<IAreaMasterBL>(MasterBLLFactory.AreaMaster);
            }
            catch (Exception Ex)
            {

                throw Ex;
            }
        }
コード例 #6
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            //StaffInfoMaster_sim_Info areaEntity;
            AreaMaster_amr_Info areaEntity;
            this.ppgList.Font = ControlSetting.ListFont;
            if (this.BaseParam != null)
            {

                areaEntity = this.BaseParam as  AreaMaster_amr_Info ;

            }
            else
            {
                areaEntity = new AreaMaster_amr_Info();
            }
            MachineAreaProperty wmp = new MachineAreaProperty();

            wmp.amr_cRecordID  = areaEntity.amr_cRecordID ;
            wmp.amr_cAreaCode  = areaEntity.amr_cAreaCode ;
            wmp.amr_cAreaName  = areaEntity.amr_cAreaName ;
            wmp.amr_cAreaLocation  = areaEntity.amr_cAreaLocation ;
            wmp.amr_cPublicInstitution  = areaEntity.amr_cPublicInstitution ;
            wmp.amr_cDescription = areaEntity.amr_cDescription;
            //wmp.amr_lIsDeleted = (MachineAreaProperty.YesNo)Enum.Parse(typeof(MachineAreaProperty.YesNo),areaEntity.amr_lIsDeleted);

            if (this.EditState == Common.DefineConstantValue.EditStateEnum.OE_Update)
            {
                base.SetPropertyReadOnly(wmp, true, "amr_cAreaCode");
            }
            else
            {
                base.SetPropertyReadOnly(wmp,false , "amr_cAreaCode");
            }

            this.ppgList.SelectedObject = wmp;
            InitSysBar();
        }
コード例 #7
0
ファイル: AreaMaster.cs プロジェクト: Klutzdon/PBIMSN
        private void btnAreaAdd_Click(object sender, EventArgs e)
        {
            if (lvwArea.SelectedItems.Count > 0)
            {
                AreaMasterAddMainces frm = new AreaMasterAddMainces();

                AreaMaster_amr_Info objAreaInfo = new AreaMaster_amr_Info();

                objAreaInfo.amr_cRecordID = new Guid(lvwArea.SelectedItems[0].SubItems[0].Text);

                objAreaInfo.amr_cAreaName  = lvwArea.SelectedItems[0].SubItems[1].Text;

                frm.objAreMaster = objAreaInfo;

                frm.ShowDialog();

                GetMachinesList();

            }
            else
            {
                ShowInformationMessage("請先選擇一個區域!");
            }
        }
コード例 #8
0
ファイル: MachineAreaMaster.cs プロジェクト: Klutzdon/PBIMSN
        private void SysToolBar_OnItemModify_Click(object sender, EventArgs e)
        {
            if (lvInfo.SelectedItems.Count > 0)
            {
                //StaffInfoMaster_sim_Info entity = new StaffInfoMaster_sim_Info();
                AreaMaster_amr_Info entity = new AreaMaster_amr_Info();
                MenuItem itemMenu = new MenuItem();
                entity.amr_cRecordID = new Guid(lvInfo.SelectedItems[0].SubItems[0].Text);
                entity.amr_cAreaCode = lvInfo.SelectedItems[0].SubItems[1].Text;
                entity.amr_cAreaName = lvInfo.SelectedItems[0].SubItems[2].Text;
                entity.amr_cAreaLocation = lvInfo.SelectedItems[0].SubItems[3].Text;
                entity.amr_cPublicInstitution = lvInfo.SelectedItems[0].SubItems[4].Text.Trim();
                entity.amr_cDescription = lvInfo.SelectedItems[0].SubItems[5].Text.Trim();
                entity.amr_lIsDeleted = lvInfo.SelectedItems[0].SubItems[6].Text == "是" ? true : false;

                itemMenu.Tag = "WindowUI.HBManagerTerminal.Management.RunningManagement.MachineAreaAppSetting";

                BaseForm form = this.ShowSubForm(itemMenu, this.BaseDockPanel, "修改機台區域主檔", DockState.Document, entity, DefineConstantValue.EditStateEnum.OE_Update);
                form.FromCloseCallBack += BingGv;

            }
        }
コード例 #9
0
ファイル: MachineAreaMaster.cs プロジェクト: Klutzdon/PBIMSN
        private void SysToolBar_OnItemDelete_Click(object sender, EventArgs e)
        {
            if (this.lvInfo.SelectedItems.Count > 0)
            {
                if (this.ShowQuestionMessage("是否確定刪除區域" + this.lvInfo.SelectedItems[0].SubItems[1].Text + "?編號:" + this.lvInfo.SelectedItems[0].SubItems[1].Text))
                {
                    AreaMaster_amr_Info delinfo = new AreaMaster_amr_Info();
                    delinfo.amr_cRecordID = new Guid(this.lvInfo.SelectedItems[0].SubItems[0].Text.Trim());
                    ReturnValueInfo rvInfo = this._AreaMasterBL.Save(delinfo, Common.DefineConstantValue.EditStateEnum.OE_Delete);
                    if (!rvInfo.isError && rvInfo.boolValue)
                    {
                        this.ShowInformationMessage("刪除成功。");
                    }
                    else
                    {
                        this.ShowWarningMessage("刪除失敗,失敗信息:" + rvInfo.messageText);
                    }

                    RefreshAllState();
                }
            }
            else
            {
                this.ShowWarningMessage("請先選擇區域!");
            }
        }
コード例 #10
0
 /// <summary>
 /// 獲取區域信息,用於key和 值的轉換
 /// </summary>
 private void Set_AreaInfo()
 {
     IAreaMasterBL areaMasterBL = MasterBLLFactory.GetBLL<IAreaMasterBL>(MasterBLLFactory.AreaMaster);
     _AreaInfo = new Dictionary<Guid, string>();
     AreaMaster_amr_Info temp = new AreaMaster_amr_Info();
     List<IModelObject> allArea = areaMasterBL.SearchRecords(temp);
     if (allArea != null)
     {
         foreach (AreaMaster_amr_Info item in allArea)
         {
             _AreaInfo.Add(item.amr_cRecordID, item.amr_cAreaName );
         }
     }
 }
コード例 #11
0
ファイル: AreaMasterDA.cs プロジェクト: Klutzdon/PBIMSN
        public List<AreaMaster_amr_Info> GetALLArea()
        {
            List<AreaMaster_amr_Info> result = new List<AreaMaster_amr_Info>();

            try
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    IEnumerable<AreaMaster_amr> data = from t in db.AreaMaster_amr
                                                       where t.amr_lIsDeleted == false
                                                       select t;

                    if (data != null)
                    {
                        foreach (AreaMaster_amr item in data)
                        {
                            AreaMaster_amr_Info info = new AreaMaster_amr_Info();

                            info = Common.General.CopyObjectValue<AreaMaster_amr, AreaMaster_amr_Info>(item);

                            result.Add(info);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {

                throw Ex;
            }

            return result;
        }
コード例 #12
0
ファイル: AreaMasterDA.cs プロジェクト: Klutzdon/PBIMSN
        public List<MachineMaster_mmt_Info> GetAreaMachine(AreaMaster_amr_Info areaInfo)
        {
            List<MachineMaster_mmt_Info> machines = null;

            if (areaInfo != null)
            {
                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        IQueryable<MachineMaster_mmt> searchData = from t in db.MachineMaster_mmt
                                                                   where t.mmt_cAreaID == areaInfo.amr_cRecordID
                                                                   orderby t.mmt_cPressCode descending
                                                                   select t;

                        if (searchData != null && searchData.Count() > 0)
                        {
                            machines = new List<MachineMaster_mmt_Info>();

                            foreach (MachineMaster_mmt item in searchData)
                            {
                                MachineMaster_mmt_Info mmtInfo = Common.General.CopyObjectValue<MachineMaster_mmt, MachineMaster_mmt_Info>(item);

                                machines.Add(mmtInfo);

                            }
                        }
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return machines;
        }
コード例 #13
0
ファイル: AdvanceOffWork.cs プロジェクト: Klutzdon/PBIMSN
 private void BinglbItem(Guid AreaID, string AreaText)
 {
     if (AreaID != Guid.Empty)
     {
         labArea.Text = AreaText;
         AreaMaster_amr_Info areaInfo = new AreaMaster_amr_Info();
         List<MachineMaster_mmt_Info> machineInfo = new List<MachineMaster_mmt_Info>();
         areaInfo.amr_cRecordID = AreaID;
         machineInfo = _areaMasterBL.GetAreaMachine(areaInfo);
         lbItem.DataSource = machineInfo;
         lbItem.DisplayMember = "mmt_cBrandName";
     }
     else
     {
         labArea.Text = "";
         lbItem.DataSource = null;
         lbItem.Items.Clear();
     }
 }
コード例 #14
0
ファイル: ProfileDataDAL.cs プロジェクト: Klutzdon/PBIMSN
        /// <summary>
        /// 區域主檔
        /// </summary>
        /// <returns></returns>
        public List<AreaMaster_amr_Info> GetAreaMaster()
        {
            try
            {
                List<AreaMaster_amr_Info> list = new List<AreaMaster_amr_Info>();
                StringBuilder strSql = new StringBuilder();
                strSql.AppendLine("select ");
                strSql.AppendLine("amr_cRecordID,amr_cAreaCode,amr_cAreaName,amr_cAreaLocation,amr_cPublicInstitution,amr_cDescription,amr_lIsDeleted,amr_dUpdateTime ");
                strSql.AppendLine("from AreaMaster_amr ");
                strSql.AppendLine("where amr_lIsDeleted=0 ");

                using (SqlDataReader sdr = DbHelperSQL.ExecuteReader(strSql.ToString()))
                {
                    while (sdr.Read())
                    {
                        AreaMaster_amr_Info model = new AreaMaster_amr_Info();
                        if (sdr["amr_cRecordID"] != null && sdr["amr_cRecordID"].ToString() != "")
                        {
                            model.amr_cRecordID = new Guid(sdr["amr_cRecordID"].ToString());
                        }
                        if (sdr["amr_cAreaCode"] != null && sdr["amr_cAreaCode"].ToString() != "")
                        {
                            model.amr_cAreaCode = sdr["amr_cAreaCode"].ToString();
                        }
                        if (sdr["amr_cAreaName"] != null && sdr["amr_cAreaName"].ToString() != "")
                        {
                            model.amr_cAreaName = sdr["amr_cAreaName"].ToString();
                        }
                        if (sdr["amr_cAreaLocation"] != null && sdr["amr_cAreaLocation"].ToString() != "")
                        {
                            model.amr_cAreaLocation = sdr["amr_cAreaLocation"].ToString();
                        }
                        if (sdr["amr_cPublicInstitution"] != null && sdr["amr_cPublicInstitution"].ToString() != "")
                        {
                            model.amr_cPublicInstitution = sdr["amr_cPublicInstitution"].ToString();
                        }
                        if (sdr["amr_cDescription"] != null && sdr["amr_cDescription"].ToString() != "")
                        {
                            model.amr_cDescription = sdr["amr_cDescription"].ToString();
                        }
                        if (sdr["amr_lIsDeleted"] != null && sdr["amr_lIsDeleted"].ToString() != "")
                        {
                            if ((sdr["amr_lIsDeleted"].ToString() == "1") || (sdr["amr_lIsDeleted"].ToString().ToLower() == "true"))
                            {
                                model.amr_lIsDeleted = true;
                            }
                            else
                            {
                                model.amr_lIsDeleted = false;
                            }
                        }
                        if (sdr["amr_dUpdateTime"] != null && sdr["amr_dUpdateTime"].ToString() != "")
                        {
                            model.amr_dUpdateTime = DateTime.Parse(sdr["amr_dUpdateTime"].ToString());
                        }
                        list.Add(model);
                    }
                }
                return list;
            }
            catch
            {

                throw;
            }
        }
コード例 #15
0
 /// <summary>
 /// 是否重複的區域主檔數據
 /// </summary>
 /// <param name="listAll">區域主檔數據列表</param>
 /// <param name="recCheck">檢查數據</param>
 /// <returns></returns>
 private bool IsRepetitiveAreaMasterRecord(List<AreaMaster_amr_Info> listAll, AreaMaster_amr_Info recCheck)
 {
     if (listAll != null && recCheck != null)
     {
         bool res = listAll.Exists(x => x.amr_cAreaName == recCheck.amr_cAreaName);
         return res;
     }
     return true;
 }
コード例 #16
0
ファイル: AreaMaster.cs プロジェクト: Klutzdon/PBIMSN
        private void GetMachinesList()
        {
            List<MachineMaster_mmt_Info> machines;

            if (lvwArea.SelectedItems.Count > 0)
            {
                AreaMaster_amr_Info areaInfo = new AreaMaster_amr_Info();

                try
                {
                    areaInfo.amr_cRecordID = new Guid(lvwArea.SelectedItems[0].SubItems[0].Text);

                    machines = this._areaMasterBL.GetAreaMachine(areaInfo);

                    lvwMachine.SetDataSource(machines);
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }
            else
            {
                machines = null;

                lvwMachine.SetDataSource(machines);

            }
        }
コード例 #17
0
ファイル: AreaMaster.cs プロジェクト: Klutzdon/PBIMSN
        void GetAllArea()
        {
            try
            {
                AreaMaster_amr_Info temp = new AreaMaster_amr_Info();

                List<IModelObject> allArea = this._areaMasterBL.SearchRecords(temp);

                this.lvwArea.SetDataSource(allArea);
            }
            catch (Exception Ex)
            {

                throw Ex;
            }
        }
コード例 #18
0
ファイル: AreaMasterDA.cs プロジェクト: Klutzdon/PBIMSN
        public bool UpdateRecord(AreaMaster_amr_Info infoObject)
        {
            bool isSuccess = false;

            if (infoObject != null)
            {
                using (MainDBDataContext db = new MainDBDataContext())
                {
                    AreaMaster_amr updateData = db.AreaMaster_amr.FirstOrDefault(t => t.amr_cRecordID == infoObject.amr_cRecordID);

                    if (updateData != null)
                    {
                        updateData.amr_cAreaCode = infoObject.amr_cAreaCode;
                        updateData.amr_cAreaName = infoObject.amr_cAreaName;
                        updateData.amr_cAreaLocation = infoObject.amr_cAreaLocation;
                        updateData.amr_cPublicInstitution = infoObject.amr_cPublicInstitution;
                        updateData.amr_cDescription = infoObject.amr_cDescription;
                        updateData.amr_dUpdateTime = infoObject.amr_dUpdateTime;

                        db.SubmitChanges();

                        isSuccess = true;
                    }
                }
            }

            return isSuccess;
        }
コード例 #19
0
ファイル: AreaMasterDA.cs プロジェクト: Klutzdon/PBIMSN
 public bool IsExistRecord(object KeyObject)
 {
     //throw new NotImplementedException();
     bool isExist = false;
     Model.HBPMS.Master.AreaMaster_amr_Info info = new Model.HBPMS.Master.AreaMaster_amr_Info();
     info = KeyObject as Model.HBPMS.Master.AreaMaster_amr_Info;
     try
     {
         using (MainDBDataContext db = new MainDBDataContext())
         {
             //LinqToSQLModel.StaffInfoMaster_sim query = db.StaffInfoMaster_sim.SingleOrDefault(t => t.sim_cStaffNo == info.sim_cStaffNo && t.sim_lIsDeleted == false);
             LinqToSQLModel.AreaMaster_amr query = db.AreaMaster_amr.SingleOrDefault(t => t.amr_cAreaCode.ToUpper() == info.amr_cAreaCode.ToUpper() && t.amr_lIsDeleted == false);
             if (query != null)
             {
                 isExist = true;
             }
         }
     }
     catch (Exception Ex)
     {
         throw Ex;
     }
     return isExist;
 }
コード例 #20
0
ファイル: AreaMasterDA.cs プロジェクト: Klutzdon/PBIMSN
        public bool InsertRecord(AreaMaster_amr_Info infoObject)
        {
            bool isSuccess = false;

            if (infoObject != null)
            {
                try
                {
                    using (MainDBDataContext db = new MainDBDataContext())
                    {
                        AreaMaster_amr insertData = Common.General.CopyObjectValue<AreaMaster_amr_Info, AreaMaster_amr>(infoObject);

                        insertData.amr_cRecordID = Guid.NewGuid();
                        db.AreaMaster_amr.InsertOnSubmit(insertData);

                        db.SubmitChanges();

                        isSuccess = true;
                    }
                }
                catch (Exception Ex)
                {

                    throw Ex;
                }
            }

            return isSuccess;
        }
コード例 #21
0
ファイル: DinnerSchedule.cs プロジェクト: Klutzdon/PBIMSN
        private void BinglbArea()
        {
            AreaMaster_amr_Info temp = new AreaMaster_amr_Info();

            List<AreaMaster_amr_Info> allArea = this.mAreaMasterBL.SearchRecords(temp);

            this.lbArea.DisplayMember = "amr_cAreaName";
            this.lbArea.ValueMember = "amr_cRecordID";
            this.lbArea.DataSource = allArea;
        }
コード例 #22
0
ファイル: AreaMaster.cs プロジェクト: Klutzdon/PBIMSN
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (lvwArea.CheckedItems.Count > 0)
            {
                DialogResult dr = MessageBox.Show("確定刪除選定的區域?", "溫馨提示", MessageBoxButtons.YesNo);

                if (dr == DialogResult.Yes)
                {
                    foreach (ListViewItem item in lvwArea.CheckedItems)
                    {
                        AreaMaster_amr_Info deleteInfo = new AreaMaster_amr_Info();

                        deleteInfo.amr_cRecordID = new Guid(item.SubItems[0].Text);

                        ReturnValueInfo returnInfo = this._areaMasterBL.Save(deleteInfo, Common.DefineConstantValue.EditStateEnum.OE_Delete);

                        if (returnInfo.boolValue == false)
                        {
                            ShowErrorMessage("刪除失敗!");
                        }
                    }

                    GetAllArea();

                    GetMachinesList();
                }
            }
        }
コード例 #23
0
        /// <summary>
        /// 獲取區域主檔信息列表
        /// </summary>
        /// <param name="strSql">SQL查詢語句</param>
        /// <param name="strConn">數據庫連接字符串</param>
        /// <returns></returns>
        private List<AreaMaster_amr_Info> GetAreaMasterInfos(string strSql, string strConn)
        {
            List<AreaMaster_amr_Info> listAreaInfos = new List<AreaMaster_amr_Info>();
            string strDBType = GetDBType(strConn);

            try
            {
                using (SqlDataReader reader = DbHelperSQL.ExecuteReader(strConn, strSql))
                {
                    while (reader.Read())
                    {
                        AreaMaster_amr_Info areaInfo = new AreaMaster_amr_Info();
                        areaInfo.DBType = strDBType;

                        #region 逐個屬性賦值

                        if (reader["amr_cRecordID"] != null && reader["amr_cRecordID"].ToString() != string.Empty)
                        {
                            areaInfo.amr_cRecordID = new Guid(reader["amr_cRecordID"].ToString());
                        }
                        if (reader["amr_cAreaCode"] != null && reader["amr_cAreaCode"].ToString() != string.Empty)
                        {
                            areaInfo.amr_cAreaCode = reader["amr_cAreaCode"].ToString();
                        }
                        if (reader["amr_cAreaName"] != null && reader["amr_cAreaName"].ToString() != string.Empty)
                        {
                            areaInfo.amr_cAreaName = reader["amr_cAreaName"].ToString();
                        }
                        if (reader["amr_cAreaLocation"] != null && reader["amr_cAreaLocation"].ToString() != string.Empty)
                        {
                            areaInfo.amr_cAreaLocation = reader["amr_cAreaLocation"].ToString();
                        }
                        if (reader["amr_cPublicInstitution"] != null && reader["amr_cPublicInstitution"].ToString() != string.Empty)
                        {
                            areaInfo.amr_cPublicInstitution = reader["amr_cPublicInstitution"].ToString();
                        }
                        if (reader["amr_cDescription"] != null && reader["amr_cDescription"].ToString() != string.Empty)
                        {
                            areaInfo.amr_cDescription = reader["amr_cDescription"].ToString();
                        }
                        if (reader["amr_lIsDeleted"] != null && reader["amr_lIsDeleted"].ToString() != string.Empty)
                        {
                            areaInfo.amr_lIsDeleted = bool.Parse(reader["amr_lIsDeleted"].ToString());
                        }
                        if (reader["amr_dUpdateTime"] != null && reader["amr_dUpdateTime"].ToString() != string.Empty)
                        {
                            areaInfo.amr_dUpdateTime = DateTime.Parse(reader["amr_dUpdateTime"].ToString());
                        }

                        #endregion

                        listAreaInfos.Add(areaInfo);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return listAreaInfos;
        }
コード例 #24
0
ファイル: ProfileDataDAL.cs プロジェクト: Klutzdon/PBIMSN
        /// <summary>
        /// 
        /// </summary>
        private string GetAreaMasterSQL(AreaMaster_amr_Info model)
        {
            StringBuilder strSql = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();
            if (model.amr_cRecordID != null)
            {
                strSql1.Append("amr_cRecordID,");
                strSql2.Append("'" + model.amr_cRecordID + "',");
            }
            if (model.amr_cAreaCode != null)
            {
                strSql1.Append("amr_cAreaCode,");
                strSql2.Append("'" + model.amr_cAreaCode + "',");
            }
            if (model.amr_cAreaName != null)
            {
                strSql1.Append("amr_cAreaName,");
                strSql2.Append("'" + model.amr_cAreaName + "',");
            }
            if (model.amr_cAreaLocation != null)
            {
                strSql1.Append("amr_cAreaLocation,");
                strSql2.Append("'" + model.amr_cAreaLocation + "',");
            }
            if (model.amr_cPublicInstitution != null)
            {
                strSql1.Append("amr_cPublicInstitution,");
                strSql2.Append("'" + model.amr_cPublicInstitution + "',");
            }
            if (model.amr_cDescription != null)
            {
                strSql1.Append("amr_cDescription,");
                strSql2.Append("'" + model.amr_cDescription + "',");
            }
            if (model.amr_lIsDeleted != null)
            {
                strSql1.Append("amr_lIsDeleted,");
                strSql2.Append("" + (model.amr_lIsDeleted ? 1 : 0) + ",");
            }
            if (model.amr_dUpdateTime != null)
            {
                strSql1.Append("amr_dUpdateTime,");
                strSql2.Append("'" + model.amr_dUpdateTime.ToString(this._sqlLiteDatetimeFormat) + "',");
            }
            strSql.Append("insert into AreaMaster_amr(");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");

            return strSql.ToString();
        }
コード例 #25
0
ファイル: AdvanceOffWork.cs プロジェクト: Klutzdon/PBIMSN
        private void BinglbArea()
        {
            AreaMaster_amr_Info temp = new AreaMaster_amr_Info();
            Dictionary<Guid, string> allArea_Info = new Dictionary<Guid, string>();
            List<IModelObject> allArea = this._areaMasterBL.SearchRecords(temp);

            if (allArea != null)
            {
                foreach (AreaMaster_amr_Info item in allArea)
                {
                    allArea_Info.Add(item.amr_cRecordID, item.amr_cAreaName);
                }
            }
            this.lbArea.DataSource = allArea_Info.ToList();
            this.lbArea.ValueMember = "Key";
            this.lbArea.DisplayMember = "Value";
        }
コード例 #26
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            MachineAreaProperty wmp = this.ppgList.SelectedObject as MachineAreaProperty;
            if (CheckCanSave() == false)
            {
                this.ShowWarningMessage("區域名稱及區域編號不能為空,請檢查。");
                this.Cursor = Cursors.Default;
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            ReturnValueInfo rvInfo = null;
            AreaMaster_amr_Info areaEntity = new AreaMaster_amr_Info ();

            areaEntity.amr_cRecordID = new Guid(wmp.amr_cRecordID.ToString());
            areaEntity.amr_cAreaCode = wmp.amr_cAreaCode;
            areaEntity.amr_cAreaName = wmp.amr_cAreaName;
            areaEntity.amr_cAreaLocation = wmp.amr_cAreaLocation;
            areaEntity.amr_cPublicInstitution = wmp.amr_cPublicInstitution;
            areaEntity.amr_cDescription = wmp.amr_cDescription;

            //areaEntity. = new Guid(wmp.sim_iRecordID.ToString());
            //areaEntity.sim_cStaffName = wmp.sim_cStaffName;
            //areaEntity.sim_cStaffNo = wmp.sim_cStaffNo;
            //areaEntity.sim_cDescription = wmp.sim_cDescription;
            //areaEntity.sim_lIsCaptain = wmp.IsCaptainChiness == MachineAreaProperty.YesNo.是;
            //areaEntity.sim_cMachineID = wmp.sim_cMachineID;
            //areaEntity.sim_lIsAtive = wmp.IsActiveChiness == MachineAreaProperty.YesNo.是;

            if (this.EditState == Common.DefineConstantValue.EditStateEnum.OE_Insert)
            {

                if (_AreaMasterBL.IsExistRecord(areaEntity))
                {
                    this.ShowWarningMessage("該區域已存在,請檢查。");
                    this.Cursor = Cursors.Default;
                    return;
                }

                areaEntity.amr_cRecordID = new Guid();
                areaEntity.amr_dUpdateTime = DateTime.Now;

                //areaEntity.sim_cAdd = this.UserInformation.usm_cChaName;
                //areaEntity.sim_dAddDate = DateTime.Now;
                //areaEntity.sim_cLast = this.UserInformation.usm_cChaName;
                //areaEntity.sim_dLastDate = DateTime.Now;
                rvInfo = this._AreaMasterBL.Save(areaEntity, Common.DefineConstantValue.EditStateEnum.OE_Insert);
            }
            if (this.EditState == Common.DefineConstantValue.EditStateEnum.OE_Update)
            {
                //if (_StaffNo != wmp.sim_cStaffNo)
                //{
                //    if (_StaffInfoMasterBL.IsExistRecord(areaEntity))
                //    {
                //        this.ShowWarningMessage("該工號的人員已存在,請檢查。");
                //        this.Cursor = Cursors.Default;
                //        return;
                //    }
                //}
                //areaEntity.sim_cLast = this.UserInformation.usm_cChaName;
                //areaEntity.sim_dLastDate = DateTime.Now;

                areaEntity.amr_dUpdateTime = DateTime.Now;
                rvInfo = this._AreaMasterBL.Save(areaEntity, Common.DefineConstantValue.EditStateEnum.OE_Update);
            }
            if (rvInfo.boolValue && !rvInfo.isError)
            {
                this.ShowInformationMessage("保存成功。");
                this.systemToolBar1.BtnSave_IsEnabled = false;
            }
            else
            {
                this.ShowWarningMessage("保存失敗,異常信息:" + rvInfo.messageText);
            }

            this.Cursor = Cursors.Default;
        }
コード例 #27
0
        private void lvArea_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvArea.SelectedItems.Count > 0)
            {
                //this._displayInfo.sty_iTargetID = Convert.ToInt32(lvArea.SelectedItems[0].SubItems[0].Text);

                //this._displayInfo.sty_cTargetName = lvArea.SelectedItems[0].SubItems[1].Text;

                try
                {
                    this._displayInfo.sty_cAreaID = new Guid(lvArea.SelectedItems[0].SubItems[0].Text);

                    List<IModelObject> returnList = this._shiftTargetYieldScheduleBL.SearchRecords(this._displayInfo);

                    if (returnList != null)
                    {
                        lvTargetYieldScheduleInfo.SetDataSource(returnList);
                    }

                    AreaMaster_amr_Info info = new AreaMaster_amr_Info();

                    info.amr_cRecordID = new Guid(lvArea.SelectedItems[0].SubItems[0].Text);

                    List<MachineMaster_mmt_Info> AreaMachines = this._areaMasterBL.GetAreaMachine(info);

                    lvMachines.SetDataSource(AreaMachines);

                }
                catch (Exception Ex)
                {

                    ShowErrorMessage(Ex.Message);
                }
            }
        }
コード例 #28
0
ファイル: AreaMasterBL.cs プロジェクト: Klutzdon/PBIMSN
        /// <summary>
        /// 取得區域下所有機台
        /// </summary>
        /// <param name="areaInfo"></param>
        /// <returns></returns>
        public List<MachineMaster_mmt_Info> GetAreaMachine(AreaMaster_amr_Info areaInfo)
        {
            try
            {
                return this._areaMasterDA.GetAreaMachine(areaInfo);
            }
            catch (Exception Ex)
            {

                throw Ex;
            }
        }