예제 #1
0
        private void pmLoadFormData()
        {
            //DataRow dtrBrow = this.gridView1.GetDataRow(this.gridView1.FocusedRowHandle);
            this.mstrEditRowID = this.txtQcAppLogin.Tag.ToString();

            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
            pobjSQLUtil.SetPara(new object[] { this.mstrEditRowID });
            if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, "QAppAuthDet", this.mstrRefTable, "select * from " + this.mstrRefTable + " where cAppLogin = ?", ref strErrorMsg))
            {
                int intRow = 0;
                foreach (DataRow dtrBudCI in this.dtsDataEnv.Tables["QAppAuthDet"].Rows)
                {
                    DataRow dtrNewRow = this.dtsDataEnv.Tables[this.mstrTemPd].NewRow();

                    intRow++;
                    dtrNewRow["nRecNo"] = intRow;
                    dtrNewRow["cRowID"] = dtrBudCI["cRowID"].ToString();
                    //dtrNewRow["cRemark"] = dtrBudCI["cRemark"].ToString().TrimEnd();
                    dtrNewRow["cSect"] = dtrBudCI["cSect"].ToString();

                    pobjSQLUtil.SetPara(new object[] { dtrNewRow["cSect"].ToString() });
                    if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, "QSect", "SECT", "select * from EMSECT where cRowID = ?", ref strErrorMsg))
                    {
                        dtrNewRow["cQcSect"] = this.dtsDataEnv.Tables["QSect"].Rows[0]["cCode"].ToString().TrimEnd();
                        dtrNewRow["cQnSect"] = this.dtsDataEnv.Tables["QSect"].Rows[0]["cName"].ToString().TrimEnd();
                    }

                    this.dtsDataEnv.Tables[this.mstrTemPd].Rows.Add(dtrNewRow);
                }
            }
            this.pmLoadOldVar();
        }
예제 #2
0
        private bool pmCheckHasUsed(string inRowID, string inCode, ref string ioErrorMsg)
        {
            string strErrorMsg = "";
            bool   bllHasUsed  = false;

            WS.Data.Agents.cDBMSAgent objSQLHelper  = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
            WS.Data.Agents.cDBMSAgent objSQLHelper2 = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            objSQLHelper.SetPara(new object[] { App.gcCorp, inRowID });
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QChkUsed", this.mstrRefTable, "select * from Tumbon where cCorp = ? and cAmphur = ? ", ref strErrorMsg))
            {
                DataRow dtrUsed = this.dtsDataEnv.Tables["QChkUsed"].Rows[0];
                ioErrorMsg = "µÓºÅ : (" + dtrUsed["cCode"].ToString().TrimEnd() + ")" + dtrUsed["cName"].ToString().TrimEnd();
                bllHasUsed = true;
            }

            objSQLHelper.SetPara(new object[] { App.gcCorp, inRowID });
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QChkUsed", this.mstrRefTable, "select * from " + MapTable.Table.MasterCoor + " where cCorp = ? and cAmphur = ? ", ref strErrorMsg))
            {
                DataRow dtrUsed = this.dtsDataEnv.Tables["QChkUsed"].Rows[0];
                ioErrorMsg = "ÅÙ¡¤éÒ : (" + dtrUsed["cCode"].ToString().TrimEnd() + ")" + dtrUsed["cName"].ToString().TrimEnd();
                bllHasUsed = true;
            }

            if (bllHasUsed)
            {
                ioErrorMsg = "äÁèÊÒÁÒöź¢éÍÁÙÅä´éà¹×èͧ¨Ò¡ÁÕ¡ÒÃÍéÒ§ÍÔ§¶Ö§ã¹ " + ioErrorMsg;
            }
            return(bllHasUsed);
        }
예제 #3
0
        private void pmLoadFormData()
        {
            DataRow dtrBrow = this.gridView1.GetDataRow(this.gridView1.FocusedRowHandle);

            if (dtrBrow != null)
            {
                this.mstrEditRowID = dtrBrow["cRowID"].ToString();

                string strErrorMsg = "";
                WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
                pobjSQLUtil.SetPara(new object[] { this.mstrEditRowID });
                if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrRefTable, this.mstrRefTable, "select * from " + this.mstrRefTable + " where cRowID = ?", ref strErrorMsg))
                {
                    DataRow dtrLoadForm = this.dtsDataEnv.Tables[this.mstrRefTable].Rows[0];
                    this.txtCode.Text  = dtrLoadForm["cCode"].ToString().TrimEnd();
                    this.txtName.Text  = dtrLoadForm["cName"].ToString().TrimEnd();
                    this.txtName2.Text = dtrLoadForm["cName2"].ToString().TrimEnd();

                    pobjSQLUtil.SetPara(new object[] { dtrLoadForm["cDept"].ToString() });
                    if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, "QDept", this.mstrRefTable, "select * from " + MapTable.Table.MasterDept + " where cRowID = ?", ref strErrorMsg))
                    {
                        DataRow dtrDept = this.dtsDataEnv.Tables["QDept"].Rows[0];
                        this.txtQcDept.Tag  = dtrLoadForm["cDept"].ToString();
                        this.txtQcDept.Text = dtrDept["cCode"].ToString().TrimEnd();
                        this.txtQnDept.Text = dtrDept["cName"].ToString().TrimEnd();
                    }
                }
                this.pmLoadOldVar();
            }
        }
예제 #4
0
        private void pmClrOldData()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            this.dtsDataEnv.Tables[this.mstrTemPd].Rows.Clear();

            string strSQLStr     = "";
            string strSQLStrDel1 = "";
            string strSQLStrDel2 = "";
            string strSQLStrDel3 = "";

            strSQLStr     = "select * from EMWORKCALENDAR where CCORP = ? and CPLANT = ? and CWORKHOUR = ? and CHOLIDAY = ? and NYEAR = ?";
            strSQLStrDel1 = "delete from EMWORKCALENDAR where CROWID = ?  ";
            strSQLStrDel2 = "delete from EMWORKCALENDARIT where CWORKCALH = ? ";
            strSQLStrDel3 = "delete from EMWORKCALENDARIT_RANGE where CWORKCALH = ? ";

            pobjSQLUtil.SetPara(new object[] { App.ActiveCorp.RowID, this.txtQcPlant.Tag.ToString(), this.txtQcStdWorkHr.Tag.ToString(), this.txtQcHoliday.Tag.ToString(), this.txtDate.DateTime.Year });
            if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, "QDel_WorkCal", "EMWORKCALENDAR", strSQLStr, ref strErrorMsg))
            {
                DataRow dtrWorkCal = this.dtsDataEnv.Tables["QDel_WorkCal"].Rows[0];
                pobjSQLUtil.SetPara(new object[] { dtrWorkCal["cRowID"].ToString() });
                pobjSQLUtil.SQLExec(strSQLStrDel1, ref strErrorMsg);

                pobjSQLUtil.SetPara(new object[] { dtrWorkCal["cRowID"].ToString() });
                pobjSQLUtil.SQLExec(strSQLStrDel2, ref strErrorMsg);

                pobjSQLUtil.SetPara(new object[] { dtrWorkCal["cRowID"].ToString() });
                pobjSQLUtil.SQLExec(strSQLStrDel3, ref strErrorMsg);
            }
        }
예제 #5
0
        private static void pmSaveKeepLog(WS.Data.Agents.cDBMSAgent inSQLHelper, Entity.KeepLogType inType, string inTaskName, string inCode, string inName, string inAppUser, string inLoginName, string inOldCode, string inOldName)
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent objSQLHelper = inSQLHelper;
            objSQLHelper.SetPara(new object[] { inTaskName });
            if (objSQLHelper.SQLExec(ref KeepLogAgent.dtsDataEnv, "QAppObj", MapTable.Table.AppObj, "select * from " + MapTable.Table.AppObj + " where cTaskName = ?", ref strErrorMsg))
            {
                DataRow dtrAppObj   = KeepLogAgent.dtsDataEnv.Tables["QAppObj"].Rows[0];
                string  strMenuName = dtrAppObj["cText"].ToString();
                string  strUpdType  = "";
                switch (inType)
                {
                case Entity.KeepLogType.Insert:
                    strUpdType = BusinessEnum.gc_KEEPLOG_TYPE_INSERT;
                    break;

                case Entity.KeepLogType.Update:
                    strUpdType = BusinessEnum.gc_KEEPLOG_TYPE_UPDATE;
                    break;

                case Entity.KeepLogType.Delete:
                    strUpdType = BusinessEnum.gc_KEEPLOG_TYPE_DELETE;
                    break;

                case Entity.KeepLogType.LogIn:
                    strUpdType = BusinessEnum.gc_KEEPLOG_TYPE_LOG_IN;
                    break;

                case Entity.KeepLogType.LogOut:
                    strUpdType = BusinessEnum.gc_KEEPLOG_TYPE_LOG_OUT;
                    break;
                }

                DataRow dtrSaveInfo = null;
                objSQLHelper.SQLExec(ref KeepLogAgent.dtsDataEnv, mstrRefTable, mstrRefTable, "select * from " + mstrRefTable + " where 0=1", ref strErrorMsg);

                dtrSaveInfo = KeepLogAgent.dtsDataEnv.Tables[mstrRefTable].NewRow();
                WS.Data.Agents.cConn objConn = WS.Data.Agents.cConn.GetInStance();

                dtrSaveInfo["cRowID"]     = objConn.RunRowID(mstrRefTable);
                dtrSaveInfo["cType"]      = strUpdType;
                dtrSaveInfo["cTaskName"]  = inTaskName;
                dtrSaveInfo["cMenuName"]  = strMenuName.TrimEnd();
                dtrSaveInfo["cCode"]      = inCode;
                dtrSaveInfo["cName"]      = inName;
                dtrSaveInfo["cOldCode"]   = inOldCode;
                dtrSaveInfo["cOldName"]   = inOldName;
                dtrSaveInfo["cLoginName"] = inLoginName;
                dtrSaveInfo["cCreateBy"]  = inAppUser;

                string   strSQLUpdateStr = "";
                object[] pAPara          = null;
                cDBMSAgent.GenUpdateSQLString(dtrSaveInfo, "CROWID", true, ref strSQLUpdateStr, ref pAPara);

                objSQLHelper.SetPara(pAPara);
                objSQLHelper.SQLExec(strSQLUpdateStr, ref strErrorMsg);
            }
        }
예제 #6
0
        private void pmUpdateProcess_S1()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent objSQLHelper = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strSQLStr = "select * from Stock01 where cCorp = ? and cPdGrp = ? and dDate = ?";

            foreach (DataRow dtrSaleSum in this.dtsDataEnv.Tables[this.mstrTemPd].Rows)
            {
                string strRowID    = "";
                bool   bllIsNewRow = false;

                DataRow  dtrSaveInfo = null;
                DateTime dttDate     = Convert.ToDateTime(dtrSaleSum["dDate"]);
                objSQLHelper.SetPara(new object[] { App.gcCorp, dtrSaleSum["cPdGrp"].ToString(), dttDate.Date });
                if (!objSQLHelper.SQLExec(ref this.dtsDataEnv, this.mstrRefTable, this.mstrRefTable, strSQLStr, ref strErrorMsg))
                {
                    bllIsNewRow = true;
                    WS.Data.Agents.cConn objConn = WS.Data.Agents.cConn.GetInStance();
                    strRowID              = objConn.RunRowID(this.mstrRefTable);
                    dtrSaveInfo           = this.dtsDataEnv.Tables[this.mstrRefTable].NewRow();
                    dtrSaveInfo["cRowID"] = strRowID;
                }
                else
                {
                    dtrSaveInfo = this.dtsDataEnv.Tables[this.mstrRefTable].Rows[0];
                }

                dtrSaveInfo["cCorp"]  = App.gcCorp;
                dtrSaveInfo["dDate"]  = dttDate;
                dtrSaveInfo["cYear"]  = dtrSaleSum["cYear"].ToString();
                dtrSaveInfo["cPdGrp"] = dtrSaleSum["cPdGrp"].ToString();

                dtrSaveInfo["QcPdGrp"] = dtrSaleSum["cQcPdGrp"].ToString();
                dtrSaveInfo["QnPdGrp"] = dtrSaleSum["cQnPdGrp"].ToString();
                dtrSaveInfo["Qty_IN"]  = Convert.ToDecimal(dtrSaleSum["nQty_IN"]);
                dtrSaveInfo["Qty_Out"] = Convert.ToDecimal(dtrSaleSum["nQty_Out"]);
                dtrSaveInfo["Qty_Ret"] = Convert.ToDecimal(dtrSaleSum["nQty_Ret"]);

                dtrSaveInfo["Amt_IN"]  = Convert.ToDecimal(dtrSaleSum["nAmt_IN"]);
                dtrSaveInfo["Amt_Out"] = Convert.ToDecimal(dtrSaleSum["nAmt_Out"]);
                dtrSaveInfo["Amt_Ret"] = Convert.ToDecimal(dtrSaleSum["nAmt_Ret"]);

                string   strSQLUpdateStr = "";
                object[] pAPara          = null;
                cDBMSAgent.GenUpdateSQLString(dtrSaveInfo, "CROWID", bllIsNewRow, ref strSQLUpdateStr, ref pAPara);
                objSQLHelper.SetPara(pAPara);
                objSQLHelper.SQLExec(strSQLUpdateStr, ref strErrorMsg);
            }
        }
예제 #7
0
        private void pmLoadFormData()
        {
            DataRow dtrBrow = this.gridView1.GetDataRow(this.gridView1.FocusedRowHandle);

            if (dtrBrow != null)
            {
                this.mstrEditRowID = dtrBrow["fcSkid"].ToString();

                string strErrorMsg = "";
                WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
                pobjSQLUtil.SetPara(new object[] { this.mstrEditRowID });
                if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrRefTable, this.mstrRefTable, "select * from " + this.mstrRefTable + " where fcSkid = ?", ref strErrorMsg))
                {
                    DataRow dtrLoadForm = this.dtsDataEnv.Tables[this.mstrRefTable].Rows[0];
                    this.txtCode.Text  = dtrLoadForm["fcCode"].ToString().TrimEnd();
                    this.txtName.Text  = dtrLoadForm["FCNAME"].ToString().TrimEnd();
                    this.txtName2.Text = dtrLoadForm["FCNAME2"].ToString().TrimEnd();

                    this.txtQcWHouse.Tag = dtrLoadForm["FCWHOUSE"].ToString();
                    pobjSQLUtil.SetPara(new object[1] {
                        this.txtQcWHouse.Tag.ToString()
                    });
                    if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, "QWHouse", "WHOUSE", "select FCCODE,FCNAME from WHOUSE where fcSkid = ?", ref strErrorMsg))
                    {
                        this.txtQcWHouse.Text = this.dtsDataEnv.Tables["QWHouse"].Rows[0]["fcCode"].ToString().TrimEnd();
                        this.txtQnWHouse.Text = this.dtsDataEnv.Tables["QWHouse"].Rows[0]["fcName"].ToString().TrimEnd();
                    }

                    int    intSel  = 0;
                    string strType = dtrLoadForm["FCDOCRUNFM"].ToString().TrimEnd();
                    switch (strType)
                    {
                    case "":
                    case "1":
                        intSel = 0;
                        break;

                    case "2":
                        intSel = 1;
                        break;

                    case "3":
                        intSel = 2;
                        break;
                    }
                    this.cmbRunCodeType.SelectedIndex = intSel;
                }
                this.pmLoadOldVar();
            }
        }
예제 #8
0
        private void pmSetBrowView_Prod()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            string strFMDBName = App.ConfigurationManager.ConnectionInfo.ERPDBMSName;
            string strEmplRTab = strFMDBName + ".dbo.EMPLR";

            string strStat = "CSTATUS = case {0}.FCSTATUS when 'I' then 'INACTIVE' when '' then 'ACTIVE' end";

            //string strSQLExec = "select {0}.FCSKID as CROWID, {0}.FCCODE as CCODE, {0}.FCSNAME as CSNAME , {0}.FCNAME as CNAME, {0}.FNPRICE as NPRICE, " + strStat + ", {0}.FDINACTIVE as DINACTIVE, {0}.FCTYPE as CTYPE , {0}.FTDATETIME as DCREATE, {0}.FTLASTUPD as DLASTUPD from {0} ";
            string strSQLExec = "select {0}.FCSKID as CROWID, {0}.FCCODE as CCODE, {0}.FCSNAME as CSNAME , {0}.FCNAME as CNAME, {0}.FNPRICE as NPRICE, {0}.FNSTDCOST as STDCOST, " + strStat + ", {0}.FDINACTIVE as DINACTIVE, {0}.FCTYPE as CTYPE , {0}.FTDATETIME as DCREATE, {0}.FTLASTUPD as DLASTUPD ";

            strSQLExec += " , UM.FCCODE as QCUM,UM.FCNAME as QNUM,UM1.FCCODE as QCUM1 ,UM1.FCNAME as QNUM1,UM2.FCCODE as QCUM2 ,UM2.FCNAME as QNUM2,{0}.FNSTUMQTY1 ";
            strSQLExec += " from {0} ";
            strSQLExec += " left join UM on PROD.FCUM = UM.FCSKID";
            strSQLExec += " left join UM UM1 on PROD.FCUM1 = UM1.FCSKID";
            strSQLExec += " left join UM UM2 on PROD.FCSTUM1 = UM2.FCSKID";
            strSQLExec += " where {0}.FCCORP = ?";

            strSQLExec = string.Format(strSQLExec, new string[] { MapTable.Table.Product, "EMPLR" });

            pobjSQLUtil.SetPara(new object[] { App.gcCorp });
            pobjSQLUtil.NotUpperSQLExecString = true;
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, "PROD", "PROD", strSQLExec, ref strErrorMsg);
        }
예제 #9
0
        private static void pmSuBeSmartMRPBeforeDate(
            WS.Data.Agents.cDBMSAgent inSQLHelper
            , string inCorp
            , string inBranch
            , string inType
            , int inBGYear
            , string inSect
            , string inJob
            , DateTime inBeforeDate
            , ref decimal ioAmt)
        {
            string strErrorMsg = "";
            string strSQLText  = "select ";

            strSQLText += " sum(BGRECVIT.NAMT) as AMT ";
            strSQLText += " from BGRECVIT ";
            strSQLText += " where CCORP = ? AND CBRANCH = ? AND CREFTYPE = ? AND NBGYEAR = ? AND CSECT = ? AND CJOB = ? and CSTAT <> 'C' and CISREV <> 'Y' and DDATE < ? ";

            ioAmt = 0;
            WS.Data.Agents.cDBMSAgent objSQLHelper = inSQLHelper;
            objSQLHelper.SetPara(new object[] { inCorp, inBranch, inType, inBGYear, inSect, inJob, inBeforeDate });
            if (objSQLHelper.SQLExec(ref BudgetHelper.dtsDataEnv, "QSumBG", QBGBalanceInfo.TableName, strSQLText, ref strErrorMsg))
            {
                DataRow dtrBGBal = BudgetHelper.dtsDataEnv.Tables["QSumBG"].Rows[0];
                ioAmt = Convert.IsDBNull(dtrBGBal["AMT"]) ? 0 : Convert.ToDecimal(dtrBGBal["AMT"]);
            }
        }
예제 #10
0
        private static void pmSuBeSmartMRP(
            WS.Data.Agents.cDBMSAgent inSQLHelper
            , string inCorp
            , string inBranch
            , string inType
            , int inBGYear
            , string inSect
            , string inJob
            , ref decimal ioAmt, ref decimal ioRecvAmt, ref decimal ioUseAmt, ref decimal ioBalAmt)
        {
            string strErrorMsg = "";
            string strSQLText  = "select ";

            strSQLText += " sum(BGBALANCE.NAMT) as AMT ";
            strSQLText += " ,sum(BGBALANCE.NRECVAMT) as RECVAMT ";
            strSQLText += " ,sum(BGBALANCE.NUSEAMT) as USEAMT ";
            strSQLText += " ,sum(BGBALANCE.NAMT - BGBALANCE.NRECVAMT) as BALAMT ";
            strSQLText += " from " + QBGBalanceInfo.TableName;
            strSQLText += " where CCORP = ? AND CBRANCH = ? AND CTYPE = ? AND NBGYEAR = ? AND CSECT = ? AND CJOB = ? ";

            ioAmt = 0; ioRecvAmt = 0; ioUseAmt = 0; ioBalAmt = 0;
            WS.Data.Agents.cDBMSAgent objSQLHelper = inSQLHelper;
            objSQLHelper.SetPara(new object[] { inCorp, inBranch, inType, inBGYear, inSect, inJob });
            if (objSQLHelper.SQLExec(ref BudgetHelper.dtsDataEnv, "QSumBG", QBGBalanceInfo.TableName, strSQLText, ref strErrorMsg))
            {
                DataRow dtrBGBal = BudgetHelper.dtsDataEnv.Tables["QSumBG"].Rows[0];
                ioAmt     = Convert.IsDBNull(dtrBGBal["AMT"]) ? 0 : Convert.ToDecimal(dtrBGBal["AMT"]);
                ioRecvAmt = Convert.IsDBNull(dtrBGBal["RECVAMT"]) ? 0 : Convert.ToDecimal(dtrBGBal["RECVAMT"]);
                ioUseAmt  = Convert.IsDBNull(dtrBGBal["USEAMT"]) ? 0 : Convert.ToDecimal(dtrBGBal["USEAMT"]);
                ioBalAmt  = Convert.IsDBNull(dtrBGBal["BALAMT"]) ? 0 : Convert.ToDecimal(dtrBGBal["BALAMT"]);
            }
        }
예제 #11
0
        private static string pmGetSectList()
        {
            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strResult   = "";
            string strErrorMsg = "";
            string strSQLExec  = "select EMSECT.CROWID, EMSECT.CCODE, EMSECT.CNAME, EMSECT.CNAME2, EMSECT.DCREATE, EMSECT.DLASTUPDBY, EM1.CLOGIN as CLOGIN_ADD, EM2.CLOGIN as CLOGIN_UPD from EMSECT ";

            strSQLExec += " left join APPLOGIN EM1 ON EM1.CROWID = EMSECT.CCREATEBY ";
            strSQLExec += " left join APPLOGIN EM2 ON EM2.CROWID = EMSECT.CLASTUPDBY ";
            strSQLExec += " where EMSECT.CCORP = ? ";

            pobjSQLUtil.SetPara(new object[1] {
                App.ActiveCorp.RowID
            });

            pobjSQLUtil.SQLExec(ref dtsDataEnv, "QBrow", "EMSECT", strSQLExec, ref strErrorMsg);

            foreach (DataRow dtrBrow in dtsDataEnv.Tables["QBrow"].Rows)
            {
                if (App.PermissionManager.CheckPermissionBySect(AuthenType.CanAccess, App.AppUserName, App.AppUserID, dtrBrow["cRowID"].ToString()))
                {
                    strResult += "'" + dtrBrow[QEMSectInfo.Field.Code].ToString().TrimEnd() + "' ,";
                }
            }
            if (strResult.Trim() != string.Empty)
            {
                strResult = AppUtil.StringHelper.Left(strResult, StringHelper.RAt(",", strResult) - 1);
                strResult = "(" + strResult + ")";
            }

            return(strResult);
        }
예제 #12
0
        private void pmLoadFormData()
        {
            DataRow dtrBrow = this.gridView1.GetDataRow(this.gridView1.FocusedRowHandle);

            if (dtrBrow != null)
            {
                this.mstrEditRowID = dtrBrow["cRowID"].ToString();

                string strErrorMsg = "";
                WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
                pobjSQLUtil.SetPara(new object[] { this.mstrEditRowID });
                if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrRefTable, this.mstrRefTable, "select * from " + this.mstrRefTable + " where cRowID = ?", ref strErrorMsg))
                {
                    DataRow dtrLoadForm = this.dtsDataEnv.Tables[this.mstrRefTable].Rows[0];
                    this.txtCode.Text  = dtrLoadForm[QBGBookInfo.Field.Code].ToString().TrimEnd();
                    this.txtName.Text  = dtrLoadForm[QBGBookInfo.Field.Name].ToString().TrimEnd();
                    this.txtName2.Text = dtrLoadForm[QBGBookInfo.Field.Name2].ToString().TrimEnd();

                    //string strLevel = dtrLoadForm[QBGBookInfo.Field.Type].ToString().TrimEnd();
                    //int intSel = -1;
                    //switch (strLevel)
                    //{
                    //    case "D":
                    //        intSel = 0;
                    //        break;
                    //    case "G":
                    //        intSel = 1;
                    //        break;
                    //}
                    //this.cmbType.SelectedIndex = intSel;
                }
                this.pmLoadOldVar();
            }
        }
예제 #13
0
        private void pmLoadFormData()
        {
            DataRow dtrBrow = this.gridView1.GetDataRow(this.gridView1.FocusedRowHandle);

            if (dtrBrow != null)
            {
                this.mstrEditRowID = dtrBrow["fcSkid"].ToString();

                string strErrorMsg = "";
                WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
                pobjSQLUtil.SetPara(new object[] { this.mstrEditRowID });
                if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrRefTable, this.mstrRefTable, "select * from " + this.mstrRefTable + " where fcSkid = ?", ref strErrorMsg))
                {
                    DataRow dtrLoadForm = this.dtsDataEnv.Tables[this.mstrRefTable].Rows[0];
                    this.txtCode.Text   = dtrLoadForm[QBranchInfo.Field.Code].ToString().TrimEnd();
                    this.txtName.Text   = dtrLoadForm[QBranchInfo.Field.Name].ToString().TrimEnd();
                    this.txtAddr11.Text = dtrLoadForm[QBranchInfo.Field.Addr1].ToString().TrimEnd();
                    this.txtAddr12.Text = dtrLoadForm[QBranchInfo.Field.Addr2].ToString().TrimEnd();

                    this.txtName2.Text  = dtrLoadForm[QBranchInfo.Field.Name2].ToString().TrimEnd();
                    this.txtAddr21.Text = dtrLoadForm[QBranchInfo.Field.Addr12].ToString().TrimEnd();
                    this.txtAddr22.Text = dtrLoadForm[QBranchInfo.Field.Addr22].ToString().TrimEnd();
                    this.txtTel.Text    = dtrLoadForm[QBranchInfo.Field.TelNo].ToString().TrimEnd();
                    this.txtFax.Text    = dtrLoadForm[QBranchInfo.Field.FaxNo].ToString().TrimEnd();
                }
                this.pmLoadOldVar();
            }
        }
예제 #14
0
        private void pmSetBrowView()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            //strSQLExec = string.Format(strSQLExec, new string[] { this.mstrRefTable });

            //object[] pAPara = new object[] { App.gcCorp };
            object[] pAPara     = null;
            string   strSQLExec = "select COOR.FCSKID, COOR.FCCODE, COOR.FCNAME, COOR.FCSNAME from COOR where FCCORP = ? and " + this.mstrCoorFld + " = 'Y' ";

            if (this.mstrSearchStr != string.Empty)
            {
                strSQLExec += " and " + this.mstrSortKey + " like ? ";
                pAPara      = new object[] { App.gcCorp, this.mstrSearchStr };
            }
            else
            {
                strSQLExec += "";
                pAPara      = new object[] { App.gcCorp };
            }

            pobjSQLUtil.SetPara(pAPara);
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, this.mstrRefTable, strSQLExec, ref strErrorMsg);
        }
예제 #15
0
        private void pmSetBrowView()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strFMDBName = App.ConfigurationManager.ConnectionInfo.ERPDBMSName;
            string strEmplRTab = strFMDBName + ".dbo.EMPLR";

            string strSQLExec = "select {0}.CROWID, {0}.CCATEG, {0}.CCODE, {0}.CNAME, {0}.DCREATE, {0}.DLASTUPD, EM1.FCLOGIN as CLOGIN_ADD, EM2.FCLOGIN as CLOGIN_UPD from {0} ";

            strSQLExec += " left join {1} EM1 ON EM1.FCSKID = {0}.CCREATEBY ";
            strSQLExec += " left join {1} EM2 ON EM2.FCSKID = {0}.CLASTUPDBY ";

            if (this.mFormActiveMode == FormActiveMode.PopUp ||
                this.mFormActiveMode == FormActiveMode.Report)
            {
                strSQLExec += " where {0}.CCATEG = 'D' ";
            }

            strSQLExec = string.Format(strSQLExec, new string[] { this.mstrRefTable, strEmplRTab });

            //pobjSQLUtil.SetPara(pAPara);
            pobjSQLUtil.NotUpperSQLExecString = true;
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, "Master_Dept", strSQLExec, ref strErrorMsg);
        }
예제 #16
0
        private decimal pmSumCutQty2(string inOrderI)
        {
            string strErrorMsg = " ";
            string strSQLStr   = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strFMDBName = App.ConfigurationManager.ConnectionInfo.ERPDBMSName;
            string strSectTab  = strFMDBName + ".dbo.ORDERI";

            object[] pAPara = new object[] { inOrderI };
            strSQLStr  = " select ORDERI.FCPROD,ORDERI.FCCOOR , REFDOC.NQTY from " + strSectTab + " ORDERI ";
            strSQLStr += " left join REFDOC on REFDOC.CCHILDTYPE = 'SO' and REFDOC.CCHILDI = ORDERI.FCSKID ";
            strSQLStr += " where ORDERI.FCSKID = ? ";

            decimal decSumQty = 0;

            pobjSQLUtil.NotUpperSQLExecString = true;
            pobjSQLUtil.SetPara(pAPara);
            if (pobjSQLUtil.SQLExec(ref this.dtsDataEnv, "QORDERI", "ORDERI", strSQLStr, ref strErrorMsg))
            {
                foreach (DataRow dtrSum in this.dtsDataEnv.Tables["QORDERI"].Rows)
                {
                    if (!Convert.IsDBNull(dtrSum["NQTY"]))
                    {
                        decSumQty = decSumQty + Convert.ToDecimal(dtrSum["NQTY"]);
                    }
                }
            }
            return(decSumQty);
        }
예제 #17
0
        private bool pmRunCode()
        {
            //this.txtCode.Text = this.mobjTabRefer.RunCode(new object[] { App.ActiveCorp.RowID, this.mstrBranchID }, this.txtCode.MaxLength);

            string strErrorMsg    = "";
            string strLastRunCode = "";
            int    intCodeLen     = 0;
            int    intRunCode     = 1;
            int    inMaxLength    = this.txtCode.Properties.MaxLength;

            WS.Data.Agents.cDBMSAgent objSQLHelper = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
            //objSQLHelper.SetPara(inPrefixPara);
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QRunCode", this.mstrRefTable, "select fcCode from " + this.mstrRefTable + " where fcCode < ':' order by fcCode desc", ref strErrorMsg))
            {
                strLastRunCode = this.dtsDataEnv.Tables["QRunCode"].Rows[0]["FCCODE"].ToString().Trim();
                try
                {
                    intRunCode = Convert.ToInt32(strLastRunCode) + 1;
                }
                catch (Exception ex)
                {
                    strErrorMsg = ex.Message.ToString();
                    intRunCode++;
                }
            }
            intCodeLen        = (strLastRunCode.Length > 0 ? strLastRunCode.Length : inMaxLength);
            this.txtCode.Text = intRunCode.ToString(StringHelper.Replicate("0", intCodeLen));

            return(true);
        }
예제 #18
0
        private void pmSetBrowView()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            string strFMDBName = App.ConfigurationManager.ConnectionInfo.ERPDBMSName;
            string strEmplRTab = strFMDBName + ".dbo.EMPLR";

            //string strSQLExec = "select {0}.fcSkid, {0}.CCODE, {0}.CNAME, {0}.DCREATE, {0}.DLASTUPD, EM1.FCLOGIN as CLOGIN_ADD, EM2.FCLOGIN as CLOGIN_UPD from {0} ";
            //strSQLExec += " left join {1} EM1 ON EM1.FCSKID = {0}.CCREATEBY ";
            //strSQLExec += " left join {1} EM2 ON EM2.FCSKID = {0}.CLASTUPDBY ";
            //strSQLExec += " where {0}.CCORP = ? and {0}.CCOORTYPE = ? ";

            string strSQLExec = "select {0}.FCSKID as fcSkid, {0}.FCCODE as CCODE, {0}.FCNAME as CNAME , {0}.FTDATETIME as DCREATE, {0}.FTLASTUPD as DLASTUPD from {0} ";

            strSQLExec += " where {0}.FCCORP = ? and {0}.FCCOORTYPE = ? ";
            strSQLExec  = string.Format(strSQLExec, new string[] { MapTable.Table.CoorGroup, "EMPLR" });

            string strCoorType = (this.mCoorType == CoorType.Customer ? "C" : "S");

            pobjSQLUtil.SetPara(new object[] { App.gcCorp, strCoorType });
            pobjSQLUtil.NotUpperSQLExecString = true;
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, "Master_CrGrp", strSQLExec, ref strErrorMsg);
        }
예제 #19
0
        private bool pmCheckHasUsed(string inRowID, string inCode, ref string ioErrorMsg)
        {
            //TODO: Check Corp Has Used
            bool bllHasChild = false;

            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent objSQLHelper = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strMsg1    = "äÁèÊÒÁÒöźä´éà¹×èͧ¨Ò¡";
            string strMsg2    = "";
            bool   bllHasUsed = true;

            if (objSQLHelper.SetPara(new object[] { this.mstrEditRowID }) &&
                objSQLHelper.SQLExec(ref this.dtsDataEnv, "QHasUsed", this.mstrRefTable, "select cCode, cName from " + MapTable.Table.BudgetChart + " where cBgType = ? ", ref strErrorMsg))
            {
                strMsg2    = "(" + this.dtsDataEnv.Tables["QHasUsed"].Rows[0]["cCode"].ToString().TrimEnd() + ") " + this.dtsDataEnv.Tables["QHasUsed"].Rows[0]["cName"].ToString().TrimEnd();
                ioErrorMsg = strMsg1 + "Áռѧ§º»ÃÐÁÒ³ " + strMsg2 + " ÍéÒ§¶Ö§áÅéÇ";
            }
            else
            {
                bllHasUsed = false;
            }
            return(bllHasUsed);
        }
예제 #20
0
        private DateTime pmLoadRangeDate(string inOrder)
        {
            DateTime dttRetVal = DateTime.Now;

            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent objSQLHelper = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strSQLStr = "select top 1 DDATE from MFWORDERIT_OPPLAN where CWORDERH in (" + this.mstrDefaSQL_MOrderH + " ) order by " + (inOrder == "MIN" ? "DDATE asc" : "DDATE desc");

            objSQLHelper.SetPara(new object[] { App.ActiveCorp.RowID, this.mstrBranch, this.mstrPlant, this.mstrRefType, this.mstrBook, this.mdttBegDate, this.mdttEndDate });
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QGetDate", "MFWORDERIT_OPPLAN", strSQLStr, ref strErrorMsg))
            {
                DataRow  dtrOPPlan  = this.dtsDataEnv.Tables["QGetDate"].Rows[0];
                DateTime dttCalDate = Convert.ToDateTime(dtrOPPlan["DDATE"]);
                int      intDay     = 1;
                if (inOrder == "MIN")
                {
                    intDay    = (dttCalDate.Day < 15 ? 1 : 15);
                    dttRetVal = new DateTime(dttCalDate.Year, dttCalDate.Month, intDay);
                }
                else
                {
                    dttRetVal = new DateTime(dttCalDate.Year, dttCalDate.Month, 1).AddMonths(1).AddDays(-1);
                }
            }

            return(dttRetVal);
        }
예제 #21
0
        private void pmLoadOPPlan()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent objSQLHelper = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strSQLStr = "select ";

            strSQLStr += " MFWORDERIT_OPPLAN.* ";
            strSQLStr += " , MFGBOOK.CCODE as QCBOOK";
            strSQLStr += " , MFWKCTRHD.CCODE as QCWORKCTR, MFWKCTRHD.CNAME as QNWORKCTR";
            strSQLStr += " , MFWORDERHD.CCODE, MFWORDERHD.CREFNO, MFWORDERHD.DSTART, MFWORDERHD.DDUEDATE ";
            strSQLStr += " from MFWORDERIT_OPPLAN ";
            strSQLStr += " left join MFWORDERHD on MFWORDERHD.CROWID = MFWORDERIT_OPPLAN.CWORDERH ";
            strSQLStr += " left join MFGBOOK on MFGBOOK.CROWID = MFWORDERHD.CMFGBOOK ";
            strSQLStr += " left join MFWKCTRHD on MFWKCTRHD.CROWID = MFWORDERIT_OPPLAN.CWKCTRH ";
            strSQLStr += "where MFWORDERIT_OPPLAN.CWORDERH in (" + this.mstrDefaSQL_MOrderH + " ) ";

            objSQLHelper.SetPara(new object[] { App.ActiveCorp.RowID, this.mstrBranch, this.mstrPlant, this.mstrRefType, this.mstrBook, this.mdttBegDate, this.mdttEndDate });
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QLoadOPPlan", "MFWORDERIT_OPPLAN", strSQLStr, ref strErrorMsg))
            {
                //Loop for Load Planning
                foreach (DataRow dtrWkCtr in this.dtsDataEnv.Tables["QLoadOPPlan"].Rows)
                {
                    this.pmAddRow_OPPlanCap(dtrWkCtr);
                }
            }
        }
예제 #22
0
        private void pmSetBrowView()
        {
            UIBase.WaitWind("Loading รายการสินค้า...");
            string strErrorMsg = " ";
            string strSQLStr   = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            object[] pAPara = null;
            strSQLStr = " ";

            pAPara    = new object[] { App.ActiveCorp.RowID, this.mstrBranch, this.mstrRefType, this.mstrBook, this.mstrCoor };
            strSQLStr = " ";

            strSQLStr += " select ";
            strSQLStr += " BOOK.FCCODE as QCBOOK ";
            strSQLStr += " , ORDERH.FCREFNO ";
            strSQLStr += " , ORDERH.FCCODE ";
            strSQLStr += " , ORDERH.FDDATE ";
            strSQLStr += " , COOR.FCCODE as QCCOOR ";
            strSQLStr += " , COOR.FCNAME as QNCOOR ";
            strSQLStr += " , ORDERH.FCSKID as FCORDERH , ORDERH.FCCOOR ";
            strSQLStr += " from ORDERH ";
            strSQLStr += " left join COOR on COOR.FCSKID = ORDERH.FCCOOR ";
            strSQLStr += " left join BOOK on BOOK.FCSKID = ORDERH.FCBOOK ";
            strSQLStr += " where ORDERH.FCCORP = ? ";
            strSQLStr += " and ORDERH.FCBRANCH = ? ";
            strSQLStr += " and ORDERH.FCREFTYPE = ? ";
            strSQLStr += " and ORDERH.FCBOOK = ? ";
            strSQLStr += " and ORDERH.FCSTEP <> 'P' ";
            strSQLStr += " and ORDERH.FCSTEP <> 'L' ";
            strSQLStr += " and ORDERH.FCSTAT <> 'C' ";
            strSQLStr += " and ORDERH.FCCOOR = ? ";
            strSQLStr += " order by FCREFNO,FDDATE ";

            pobjSQLUtil.SetPara(pAPara);
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, this.mstrRefTable, strSQLStr, ref strErrorMsg);
            for (int i = 0; i < this.dtsDataEnv.Tables[this.mstrBrowViewAlias].Rows.Count; i++)
            {
                DataRow dtrBrow = this.dtsDataEnv.Tables[this.mstrBrowViewAlias].Rows[i];
                //decimal decCutQty = pmSumCutQty1(dtrBrow["FCCOOR"].ToString(), dtrBrow["FCPROD"].ToString());
                //decimal decBackQty = Convert.ToDecimal(dtrBrow["FNBACKQTY"]);
                //decimal decMOQty = decBackQty - decCutQty;
                //dtrBrow["FNBACKQTY"] = decMOQty;
                //if (decMOQty <= 0)
                //{
                //    this.dtsDataEnv.Tables[this.mstrBrowViewAlias].Rows[i].Delete();
                //    //this.dtsDataEnv.Tables[this.mstrBrowViewAlias].Rows.RemoveAt(i);
                //}
            }

            DataColumn dtcTagValue = new DataColumn("CTAGVALUE", Type.GetType("System.Boolean"));

            dtcTagValue.DefaultValue = false;
            this.dtsDataEnv.Tables[this.mstrBrowViewAlias].Columns.Add(dtcTagValue);

            UIBase.WaitClear();
        }
예제 #23
0
        private static void pmGetItemofFormula(string inFormula)
        {
            string strErrorMsg = "";

            mCurrFM = inFormula;

            toSQLHelper.SetPara(new object[] { inFormula });
            if (toSQLHelper.SQLExec(ref dtsTem, "QFormula", MapTable.Table.Formula, "select * from " + MapTable.Table.Formula + " where FCSKID = ? ", ref strErrorMsg))
            {
                mCurrQcFM = dtsTem.Tables["QFormula"].Rows[0]["fcCode"].ToString();
            }

            toSQLHelper.SetPara(new object[] { "C", inFormula });
            if (toSQLHelper.SQLExec(ref dtsTem, "QPdStruct", MapTable.Table.PdStruct, "select * from " + MapTable.Table.PdStruct + " where FCTYPE = ? and FCFORMULAS = ? order by FCSEQ", ref strErrorMsg))
            {
                foreach (DataRow dtrTemPdSt in dtsTem.Tables["QPdStruct"].Rows)
                {
                    FormulaInfo mInfo = tmFormula.NewRow();

                    mInfo.PdStruct   = dtrTemPdSt["fcSkid"].ToString();
                    mInfo.RefPdType  = dtrTemPdSt["fcProdOrFo"].ToString();
                    mInfo.PdOrFM     = dtrTemPdSt["fcCompo"].ToString();
                    mInfo.Qty        = Convert.ToDecimal(dtrTemPdSt["fnQty"]) * mRefQty;
                    mInfo.UM         = dtrTemPdSt["fcUm"].ToString();
                    mInfo.UMQty      = Convert.ToDecimal(dtrTemPdSt["fnUmQty"]);
                    mInfo.RootFM     = mRootFM;
                    mInfo.ParentFM   = mCurrFM;
                    mInfo.ParentQcFM = mCurrQcFM;

                    tmFormula.Add(mInfo);

                    mRefQty = Convert.ToDecimal(dtrTemPdSt["fnQty"]);

                    if (mInfo.RefPdType == "F")
                    {
                        string  strSavCurr = mCurrFM;
                        decimal decSaveQty = mRefQty;
                        pmGetItemofFormula(mInfo.PdOrFM);
                        mCurrFM = strSavCurr;
                        mRefQty = decSaveQty;
                    } // if
                }     // foreach
            }         //if
        }
예제 #24
0
        private void pmSetBrowView(bool inIsInit)
        {
            UIBase.WaitWind("Loading Items...");
            //dlgWaitWind dlg = new dlgWaitWind();
            //dlg.WaitWind();
            string strErrorMsg = "";
            string strSQLStr   = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string[] staPara      = { this.mstrRefTable, this.mstrSortKey, "%" + this.mstrSearchStr + "%" };
            string   strSearchStr = "";

            object[] pAPara = null;
            if (inIsInit)
            {
                strSQLStr = "select cRowID, cCode, cName from " + this.mstrRefTable + " where 0=1";
            }
            else
            {
                if (this.mstrFixProd.Trim() != string.Empty)
                {
                    if (this.mstrSearchStr != string.Empty)
                    {
                        pAPara       = new object[] { App.ActiveCorp.RowID, this.mstrFixProd, "%" + this.mstrSearchStr + "%" };
                        strSearchStr = (this.mstrSearchStr != string.Empty ? string.Format(" and {0}.CMFGPROD = ? and {0}.{1} like ?", staPara) : "");
                    }
                    else
                    {
                        pAPara       = new object[] { App.ActiveCorp.RowID, this.mstrFixProd };
                        strSearchStr = (this.mstrSearchStr != string.Empty ? string.Format(" and {0}.CMFGPROD = ?", staPara) : "");
                    }
                }
                else
                {
                    strSearchStr = (this.mstrSearchStr != string.Empty ? string.Format(" and {0}.{1} like ?", staPara) : "");
                    if (this.mstrSearchStr != string.Empty)
                    {
                        pAPara = new object[] { App.ActiveCorp.RowID, "%" + this.mstrSearchStr + "%" }
                    }
                    ;
                    else
                    {
                        pAPara = new object[] { App.ActiveCorp.RowID }
                    };
                }

                strSQLStr = "select cRowID, cCode, cName from " + this.mstrRefTable + " where CCORP = ? and CACTIVE = 'A' and CISAPPROVE = 'A' " + strSearchStr + " order by " + this.mstrSortKey;
                pobjSQLUtil.SetPara(pAPara);
            }

            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, this.mstrRefTable, strSQLStr, ref strErrorMsg);

            UIBase.WaitClear();
        }
예제 #25
0
        private void pmUpdateRecord()
        {
            string strErrorMsg = "";
            string strPwd      = "";

            App.PermissionManager.CreateCipherText(this.txtPwd1.Text.TrimEnd(), ref strPwd);

            WS.Data.Agents.cDBMSAgent objSQLHelper = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
            objSQLHelper.SetPara(new object[] { strPwd, App.FMAppUserID });
            objSQLHelper.SQLExec("update AppLogin set cPwd = ? where cRowID = ? ", ref strErrorMsg);
        }
예제 #26
0
        private void pmSetBrowView()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            string strSQLExec = "select EMPLR.FCSKID, EMPLR.FCLOGIN, EMPLR.FCRCODE from EMPLR ";

            //pobjSQLUtil.SetPara(pAPara);
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, this.mstrRefTable, strSQLExec, ref strErrorMsg);
        }
예제 #27
0
        private void pmDefaultOption()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent objSQLHelper = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            objSQLHelper.SetPara(new object[] { App.gcCorp });
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QBranch", "BRANCH", "select Branch.fcSkid, Branch.fcCode, Branch.fcName from " + MapTable.Table.Branch + " where fcCorp = ? order by fcCode", ref strErrorMsg))
            {
                this.mstrBranch       = this.dtsDataEnv.Tables["QBranch"].Rows[0]["fcSkid"].ToString();
                this.txtQcBranch.Tag  = this.dtsDataEnv.Tables["QBranch"].Rows[0]["fcSkid"].ToString();
                this.txtQcBranch.Text = this.dtsDataEnv.Tables["QBranch"].Rows[0]["fcCode"].ToString();
                this.txtQnBranch.Text = this.dtsDataEnv.Tables["QBranch"].Rows[0]["fcName"].ToString();
            }

            this.pmDefaultBookCode();

            this.txtBegDate.DateTime = DateTime.Now;
            this.txtEndDate.DateTime = DateTime.Now;

            objSQLHelper.SetPara(new object[] { App.gcCorp, System.Environment.MachineName });
            if (objSQLHelper.SQLExec(ref this.dtsDataEnv, "QWkStat", "WORKSTATION", "select * from WORKSTATION where fcCorp = ? and fcName = ? ", ref strErrorMsg))
            {
                this.mstrWkStat       = this.dtsDataEnv.Tables["QWkStat"].Rows[0]["fcSkid"].ToString();
                this.txtQcWkStat.Tag  = this.dtsDataEnv.Tables["QWkStat"].Rows[0]["fcSkid"].ToString();
                this.txtQcWkStat.Text = this.dtsDataEnv.Tables["QWkStat"].Rows[0]["fcCode"].ToString().TrimEnd();
                this.txtQnWkStat.Text = this.dtsDataEnv.Tables["QWkStat"].Rows[0]["fcName"].ToString().TrimEnd();
            }
            else
            {
                if (this.mbllIsValidateWorkStation)
                {
                    MessageBox.Show("äÁ辺à¤Ã×èͧ " + System.Environment.MachineName + " ã¹Ãкº !", "Application Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                this.txtQcWkStat.Tag  = "";
                this.txtQcWkStat.Text = "";
                this.txtQnWkStat.Text = "";
            }

            UIBase.SetDefaultChildAppreance(this);
        }
예제 #28
0
        private void pmBlankFormData()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrRefTable, this.mstrRefTable, "select * from " + this.mstrRefTable + " where 0=1", ref strErrorMsg);

            this.mstrEditRowID = "";
            this.txtCode.Text  = "";
            this.txtName.Text  = "";
            this.txtName2.Text = "";
        }
예제 #29
0
        private void pmSetBrowView()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ConnectionString, App.DatabaseReside);

            string strSQLExec = "select WSBOOK.CROWID, WSBOOK.CCODE, WSBOOK.CNAME from WSBOOK where CCORP = ? and CREFTYPE = ? ";

            object[] pAPara = new object[] { App.gcCorp, this.mstrRefType };
            pobjSQLUtil.SetPara(pAPara);
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, this.mstrRefTable, strSQLExec, ref strErrorMsg);
        }
예제 #30
0
        private void pmSetBrowView()
        {
            string strErrorMsg = "";

            WS.Data.Agents.cDBMSAgent pobjSQLUtil = new WS.Data.Agents.cDBMSAgent(App.ERPConnectionString, App.DatabaseReside);

            string strSQLExec = "select WHOUSE.FCSKID, WHOUSE.FCCODE, WHOUSE.FCNAME from WHOUSE where FCCORP = ? and FCBRANCH = ? " + (this.mstrFixType.Trim() != string.Empty ? "and FCTYPE in " + this.mstrFixType : "");

            object[] pAPara = new object[] { App.gcCorp, this.mstrBranch };
            pobjSQLUtil.SetPara(pAPara);
            pobjSQLUtil.SQLExec(ref this.dtsDataEnv, this.mstrBrowViewAlias, this.mstrRefTable, strSQLExec, ref strErrorMsg);
        }