コード例 #1
0
ファイル: FrmTaxi001.cs プロジェクト: allen660412/YRERP
        protected override bool WfPickClickOnEditMode(object sender, string pColName, DataRow pDr)
        {
            try
            {
                vw_taxi001  masterModel  = null;
                MessageInfo messageModel = new MessageInfo();
                #region 單頭-pick vw_stpt400
                if (pDr.Table.Prefix.ToLower() == "vw_taxi001")
                {
                    masterModel = DrMaster.ToItem <vw_taxi001>();
                    switch (pColName.ToLower())
                    {
                    case "tba01":    //申報部門編號
                        messageModel.ParamSearchList = new List <SqlParameter>();
                        messageModel.IsAutoQuery     = true;
                        WfShowPickUtility("p_beb1", messageModel);
                        if (messageModel.Result == System.Windows.Forms.DialogResult.OK)
                        {
                            if (messageModel.DataRowList.Count > 0)
                            {
                                pDr[pColName] = GlobalFn.isNullRet(messageModel.DataRowList[0]["beb01"], "");
                            }
                            else
                            {
                                pDr[pColName] = "";
                            }
                        }
                        break;
                    }
                }
                #endregion

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
ファイル: FrmTaxi001.cs プロジェクト: allen660412/YRERP
        protected override bool WfFormCheck()
        {
            vw_taxi001 masterModel = null;
            string     msg;
            string     chkColName;

            try
            {
                masterModel = DrMaster.ToItem <vw_taxi001>();
                chkColName  = "tba01";
                #region 申報部門編號
                if (GlobalFn.varIsNull(masterModel.tba01))
                {
                    this.uTab_Master.SelectedTab = uTab_Master.Tabs[0];
                    msg  = TabMaster.AzaTbList.Where(p => p.aza03 == chkColName).Select(p => p.aza04).FirstOrDefault();
                    msg += "不可為空白";
                    WfFindErrUltraGridCell(uGridMaster, DrMaster, chkColName);
                    WfShowErrorMsg(msg);
                    return(false);
                }
                //if (FormEditMode == YREditType.新增 && BoPur.OfChkPbaPKExists(GlobalFn.isNullRet(masterModel.pba01, "")) == true)
                //{
                //    msg = "廠商分類編號已存在,請檢核!";
                //    errorProvider.SetError(chkControl, msg);
                //    WfShowErrorMsg(msg);
                //    return false;
                //}
                #endregion

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }