public virtual SalBoolean SavePassword() { using (new SalContext(this)) { SalString stmt = "&AO.Lch_Employee_API.ChangePassword(:i_hWndFrame.sEmployeeID,:i_hWndFrame.sNewPassword.Text.Trim())"; return(DbPLSQLBlock(cSessionManager.c_hSql, stmt)); } }
/// <summary> /// Shows the modal dialog. /// </summary> /// <param name="owner"></param> /// <returns></returns> public static SalNumber ModalDialog(Control owner, ref SalString sEmployeeID, ref SalString sOldpassword) { dlgLchChangePassword dlg = DialogFactory.CreateInstance <dlgLchChangePassword>(); dlg.sEmployeeID = sEmployeeID; dlg.sOldpassword = sOldpassword; dlg.sID.Text = dlg.sEmployeeID; SalNumber ret = dlg.ShowDialog(owner); return(ret); }
private void commandOk_Execute(object sender, Ifs.Fnd.Windows.Forms.FndCommandExecuteEventArgs e) { // Dialog class have AcceptButton set to run this logic if the user ends the dialog using the Return button. // PPJ dialog close trough Sal.EndDialog so we set DialogResult to prevent the dialog from closing premature. DialogResult = DialogResult.None; SalBoolean bOK = false; SalString stmt = ""; stmt = @"&AO.Exm_Inventory_Product_API.Add_prudct( :i_hWndFrame.dlgReceiveItem.dfnInventoryLocationId IN, :i_hWndFrame.dlgReceiveItem.dfnInventoryId IN, :i_hWndFrame.dlgReceiveItem.dfnPartId IN, :i_hWndFrame.dlgReceiveItem.dfnAddQty IN)"; bOK = DbPLSQLTransaction(cSessionManager.c_hSql, stmt); Sal.EndDialog(this, Sys.IDOK); }
private void cmdChangePassword_Execute(object sender, FndCommandExecuteEventArgs e) { #region Actions using (new SalContext(this)) { this.sEmployeeID = colsEmployeeId.Text; this.sOldpassword = colsLoginPassword.Text; if (dlgLchChangePassword.ModalDialog(Sys.hWndForm, ref this.sEmployeeID, ref this.sOldpassword) == Sys.IDOK) { Sal.SendMsg(i_hWndSelf, Ifs.Fnd.ApplicationForms.Const.PM_DataSourceRefresh, Ifs.Fnd.ApplicationForms.Const.METHOD_Execute, 0); return; } return; } #endregion }
public new SalNumber UserMethod(SalNumber nWhat, SalString sMethod) { #region Actions using (new SalContext(this)) { if (sMethod == "ok") { switch (nWhat) { case Ifs.Fnd.ApplicationForms.Const.METHOD_Inquire: return(1); case Ifs.Fnd.ApplicationForms.Const.METHOD_Execute: if (!(CheckPassword())) { return(0); } else { SavePassword(); return(Sal.EndDialog(this, Sys.IDOK)); } } } else if (sMethod == "cancel") { switch (nWhat) { case Ifs.Fnd.ApplicationForms.Const.METHOD_Inquire: return(1); case Ifs.Fnd.ApplicationForms.Const.METHOD_Execute: Sal.EndDialog(this, Sys.IDCANCEL); break; } } } return(0); #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; } }
public override SalNumber vrtUserMethod(SalNumber nWhat, SalString sMethod) { return(this.UserMethod(nWhat, sMethod)); }