Пример #1
0
        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 DownloadSale()
 {
     using (SqlConnection connection = new SqlConnection(ConnectionString))
     {
         SqlCommand command = new SqlCommand();
         command.CommandText = "EXECUTE [spListOfSale]";
         command.Connection  = connection;
         command.Connection.Open();
         SqlDataReader sqlDataReader = command.ExecuteReader();
         while (sqlDataReader.Read())
         {
             int     id   = (int)sqlDataReader["SalId"];
             string  navn = (string)sqlDataReader["SalNavn"];
             decimal leje = (decimal)sqlDataReader["Leje"];
             int     cap  = (int)sqlDataReader["Kapacitet"];
             Sal     sal  = new Sal(navn, id, leje, cap);
             SalRepo.AddItem(sal);
         }
         sqlDataReader.Close();
         connection.Close();
     }
 }
Пример #3
0
 public virtual SalBoolean CheckPassword()
 {
     #region Actions
     using (new SalContext(this))
     {
         if (sOldPasswordInput.Text != sOldpassword)
         {
             this.sOldPasswordInput.Focus();
             Ifs.Fnd.ApplicationForms.Int.AlertBox(Properties.Resources.TEXT_PasswordNotSame, Ifs.Fnd.ApplicationForms.Properties.Resources.CAPTION_Error, Ifs.Fnd.ApplicationForms.Const.WARNING_Ok);
             return(false);
         }
         else if (Sal.IsNull(this.sNewPassword))
         {
             this.sNewPassword.Focus();
             Ifs.Fnd.ApplicationForms.Int.AlertBox(Properties.Resources.TEXT_PasswordMustInput, Ifs.Fnd.ApplicationForms.Properties.Resources.CAPTION_Error, Ifs.Fnd.ApplicationForms.Const.WARNING_Ok);
             return(false);
         }
         else
         {
             return(true);
         }
     }
     #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 string ToString()
 {
     return(Sal.Aggregate(JoinDate, (current, s) => current + s.ToString()));
 }
 private void commandList_Inquire(object sender, Fnd.Windows.Forms.FndCommandInquireEventArgs e)
 {
     Ifs.Fnd.Windows.Forms.FndCommand command = (Ifs.Fnd.Windows.Forms.FndCommand)sender;
     hWndCurrentFocus = Sal.GetFocus();
     command.Enabled  = hWndCurrentFocus.SendMessage(Const.PM_DataItemLov, Const.METHOD_Inquire, 0);
 }