Esempio n. 1
0
        protected virtual void LookUpProgram(EditResponseSet response)
        {
            switch (response.Name)
            {
            case ScreenName.ReportFields.ChargeCodeStart:
            case ScreenName.ReportFields.ChargeCodeEnd:
                //if (response.FunctionKey != FunctionKey.F9)
                //    return;
                ////clear
                this.unitEnv.KeyValue = string.Empty;
                this.CallProgram("rw21rc");
                if (this.unitEnv.FunctionKey != FunctionKey.Esc && this.unitEnv.KeyValue != string.Empty)
                {
                    response.StringValue = this.unitEnv.KeyValue;
                    this.virtualClient.PutData(response.Name, response.StringValue);
                }
                break;

            case ScreenName.ReportFields.BldingStart:
            case ScreenName.ReportFields.BldingEnd:
                if (response.FunctionKey != FunctionKey.F9)
                {
                    return;
                }
                //clear
                this.unitEnv.KeyValue = string.Empty;
                this.CallProgram("Rw07bu");
                if (this.unitEnv.FunctionKey != FunctionKey.Esc && this.unitEnv.KeyValue != string.Empty)
                {
                    response.StringValue = this.unitEnv.KeyValue;
                    this.virtualClient.PutData(response.Name, response.StringValue);
                }
                break;
            }
        }
Esempio n. 2
0
        protected override void EditOptions(EditResponseSet response)
        {
            switch (response.Name)
            {
            case ScreenName.ReportFields.BldingStart:
            case ScreenName.ReportFields.BldingEnd:
            case ScreenName.ReportFields.ChargeCodeStart:
            case ScreenName.ReportFields.ChargeCodeEnd:
                if (response.FunctionKey == FunctionKey.F9)
                {
                    this.LookUpProgram(response);
                }
                break;

            case "G_" + UnitType.ControlName.UnitTypeID:

                if (this.unitTypeObj.CheckKeyExist(response.StringValue) != FxAccess.OK)
                {
                    this.virtualClient.ShowMessageBox("Unit Type not found");
                    this.unitTypeSortGrid.ClearRow(response.RowIndex);
                }
                //if (response.StringValue == this.unitTypeSortGrid.GetRowDataString(this.unitTypeSortGrid.CurrentRowIndex, "G_" + UnitType.ControlName.UnitTypeID))
                //    break;
                ////Check UnitType Duplicate
                //bool TypeExist = false;
                //for (int rowindex = 1; rowindex <= this.unitTypeSortGrid.DataGridObject.RowCount; rowindex++)
                //{
                //    string TempUnitType = this.unitTypeSortGrid.GetRowDataString(rowindex, "G_" + UnitType.ControlName.UnitTypeID);
                //    if (response.StringValue == TempUnitType)
                //    {
                //        this.virtualClient.ShowMessageBox("Unit Type not found");
                //        this.unitTypeSortGrid.ClearRow(response.RowIndex);
                //        TypeExist = true;
                //    }
                //}
                //if(!TypeExist)
                this.unitTypeSortGrid.SetRowData(response.RowIndex, "G_" + UnitType.ControlName.UnitTypeID, response.StringValue);
                break;
            }
            base.EditOptions(response);
        }