private void dfnPartId_WindowActions(object sender, WindowActionsEventArgs e)
 {
     switch (e.ActionType)
     {
     case Const.PM_DataItemValidate:
         dfnPartId_OnPM_DataItemValidate(sender, e);
         break;
     }
 }
Example #2
0
 private void tableWindow_coldBirthday_WindowActions(object sender, WindowActionsEventArgs e)
 {
     #region Actions
     switch (e.ActionType)
     {
     case Sys.SAM_FieldEdit:
         this.coldBirthday_OnAM_FieldEdit(sender, e);
         break;
     }
     #endregion
 }
Example #3
0
 private void coldBirthday_OnAM_FieldEdit(object sender, WindowActionsEventArgs e)
 {
     #region Actions
     e.Handled = true;
     if (!Sal.IsNull(coldBirthday))
     {
         DbPLSQLBlock(cSessionManager.c_hSql, "SELECT TRUNC(Months_between(sysdate, to_date('" + coldBirthday.Text + "','yyyy-mm-dd'))/12) INTO :i_hWndFrame.colnAge FROM DUAL");
         this.colnAge.EditDataItemSetEdited();
         this.colnAge.Enabled = false;
     }
     else
     {
         this.colnAge.Clear();
     }
     #endregion
 }
        private void dfnPartId_OnPM_DataItemValidate(object sender, WindowActionsEventArgs e)
        {
            e.Handled = true;
            SalNumber  nReturn;
            SalBoolean bOK  = false;
            SalString  stmt = "";

            //Run framework valdation first, proceed if it succeeds, if set sendmessage it will be a nevr ending loop
            nReturn = Sal.SendClassMessage(Const.PM_DataItemValidate, e.WParam, e.LParam);
            if (nReturn == Sys.VALIDATE_Ok)
            {
                //call the DB function and assign the Quantity to appropriate data fied

                if (!this.dfnInventoryId.IsEmpty() && !this.dfnInventoryLocationId.IsEmpty() && !this.dfnPartId.IsEmpty())
                {
                    stmt = @":i_hWndFrame.dlgReceiveItem.dfnQtyAvailable := nvl(&AO.Exm_Inventory_Product_API.Get_Quantity(
                                                                                            :i_hWndFrame.dlgReceiveItem.dfnInventoryLocationId  IN,
                                                                                            :i_hWndFrame.dlgReceiveItem.dfnInventoryId          IN,
                                                                                            :i_hWndFrame.dlgReceiveItem.dfnPartId               IN), 0)";

                    bOK = DbPLSQLBlock(cSessionManager.c_hSql, stmt);
                    if (bOK)
                    {
                        e.Return = Sys.VALIDATE_Ok;
                    }
                    else
                    {
                        e.Return = Sys.VALIDATE_Cancel;
                    }
                }
            }
            else
            {
                e.Return = nReturn;
            }
        }