Ejemplo n.º 1
0
        public dlgGetInvOther(UIHelper.AppFormState inEditMode, DocumentType inDocType, string inSaleOrBuy)
        {
            InitializeComponent();

            this.mFormEditMode = inEditMode;
            this.mDocType      = inDocType;
            this.mstrSaleOrBuy = inSaleOrBuy;
            this.pmInitForm();
        }
Ejemplo n.º 2
0
        private void barMainEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (e.Item.Tag != null)
            {
                string    strMenuName = e.Item.Tag.ToString();
                WsToolBar oToolButton = AppEnum.GetToolBarEnum(strMenuName);
                switch (oToolButton)
                {
                case WsToolBar.Enter:
                    this.pmEnterForm();
                    break;

                case WsToolBar.Insert:
                    if (App.PermissionManager.CheckPermission(TASKNAME, AuthenType.CanInsert, App.AppUserName, App.AppUserID))
                    {
                        this.mFormEditMode = UIHelper.AppFormState.Insert;
                        this.pmLoadEditPage();
                    }
                    else
                    {
                        MessageBox.Show("äÁèÁÕÊÔ·¸Ôì㹡ÒÃà¾ÔèÁ¢éÍÁÙÅ !", "Application Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    break;

                case WsToolBar.Update:
                    if (App.PermissionManager.CheckPermission(TASKNAME, AuthenType.CanEdit, App.AppUserName, App.AppUserID))
                    {
                        this.mFormEditMode = UIHelper.AppFormState.Edit;
                        this.pmLoadEditPage();
                    }
                    else
                    {
                        MessageBox.Show("äÁèÁÕÊÔ·¸Ôì㹡ÒÃá¡é䢢éÍÁÙÅ !", "Application Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    break;

                case WsToolBar.Delete:
                    if (App.PermissionManager.CheckPermission(TASKNAME, AuthenType.CanDelete, App.AppUserName, App.AppUserID))
                    {
                        this.pmDeleteData();
                    }
                    else
                    {
                        MessageBox.Show("äÁèÁÕÊÔ·¸Ôì㹡ÒÃź¢éÍÁÙÅ !", "Application Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    break;

                case WsToolBar.Search:
                    this.pmSearchData();
                    break;

                case WsToolBar.Undo:
                    if (MessageBox.Show("¡àÅÔ¡¡ÒÃá¡éä¢ ?", "Application confirm message", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        this.pmGotoBrowPage();
                    }
                    break;

                case WsToolBar.Save:
                    this.pmSaveData();
                    break;

                case WsToolBar.Refresh:
                    this.pmRefreshBrowView();
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        private void pmInitForm()
        {
            WS.Data.Agents.cDBMSAgent objSQLHelper  = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);
            WS.Data.Agents.cDBMSAgent objSQLHelper2 = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            this.txtQcHoliday.Properties.MaxLength = MapTable.GetMaxLength(objSQLHelper2, QMfgBookInfo.TableName, QMfgBookInfo.Field.Code);

            this.txtQcBranch.Tag  = "";
            this.txtQcPlant.Tag   = "";
            this.txtQcHoliday.Tag = "";

            this.txtQcHoliday.Text = "";

            int intYear = DateTime.Now.Year;

            string strErrorMsg = "";

            objSQLHelper.SetPara(new object[] { App.ActiveCorp.RowID });
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QBranch", "BRANCH", "select fcSkid, fcCode, fcName from BRANCH where fcCorp = ? order by FCCODE", ref strErrorMsg))
            {
                DataRow dtrBranch = this.dtsDataEnv.Tables["QBranch"].Rows[0];
                this.txtQcBranch.Tag  = dtrBranch["fcSkid"].ToString();
                this.txtQcBranch.Text = dtrBranch["fcCode"].ToString().TrimEnd();
                this.txtQnBranch.Text = dtrBranch["fcName"].ToString().TrimEnd();
            }

            objSQLHelper2.SetPara(new object[] { App.ActiveCorp.RowID });
            if (objSQLHelper2.SQLExec(ref this.dtsDataEnv, "QPlant", "PLANT", "select cRowID, cCode, cName from " + QEMPlantInfo.TableName + " where cCorp = ? order by CCODE", ref strErrorMsg))
            {
                DataRow dtrPlant = this.dtsDataEnv.Tables["QPlant"].Rows[0];
                this.txtQcPlant.Tag  = dtrPlant["cRowID"].ToString();
                this.txtQcPlant.Text = dtrPlant["cCode"].ToString().TrimEnd();
                this.txtQnPlant.Text = dtrPlant["cName"].ToString().TrimEnd();
            }

            this.txtDate.DateTime = DateTime.Now;

            objSQLHelper2.SetPara(new object[] { App.ActiveCorp.RowID, DateTime.Now.Year });
            if (objSQLHelper2.SQLExec(ref this.dtsDataEnv, "QHoliday", QEMHolidayInfo.TableName, "select cRowID, cCode, cName from " + QEMHolidayInfo.TableName + " where cCorp = ? and nYear = ? order by CCODE", ref strErrorMsg))
            {
                DataRow dtrHoliday = this.dtsDataEnv.Tables["QHoliday"].Rows[0];
                this.txtQcHoliday.Tag  = dtrHoliday["cRowID"].ToString();
                this.txtQcHoliday.Text = dtrHoliday["cCode"].ToString().TrimEnd();
            }

            //this.cmbWHCost.Properties.Items.Clear();
            //this.cmbWHCost.Properties.Items.AddRange(new object[] {
            //    UIBase.GetAppUIText(new string[] { "ราคาทุนมาตรฐาน", "Standard Cost" })
            //    , UIBase.GetAppUIText(new string[] { "ราคาทุนจริง" , "Actual Cost" })
            //    , UIBase.GetAppUIText(new string[] { "ราคาซื้อล่าสุด" , "Last purchasing price" })
            //    , UIBase.GetAppUIText(new string[] { "ราคาซื้อต่ำสุด" , "Minimum purchasing price" })
            //    , UIBase.GetAppUIText(new string[] { "ราคาซื้อสูงสุด" , "Maximum purchasing price" }) });

            //this.cmbWHCost.SelectedIndex = 0;

            this.pmMapEvent();
            this.pmSetFormUI();
            UIBase.SetDefaultChildAppreance(this);

            this.mFormEditMode = AppFormState.Insert;
            this.pmCreateTem();
        }