예제 #1
0
        public static void SaveInvoice(object o, List <KeyValuePair <string, string> > p_pkv)
        {
            var report = initReport("DS", o, "Report.Report1.rdlc", p_pkv);
            //
            string p = Path.Combine(C_Variables.Path_.dir_Invoice, "Invoice_" + F_Time.DateTime2String_File_yyyy_MM_dd_HH_mm_ss(DateTime.Now) + ".pdf");;

            WritePDF(report, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), p));
            DialogInformation.OK();
        }
        /// <summary>Deletes <font color="#ff0000"><strong>selected</strong></font>item from the active management actor's page. This assumes that the item is already selected.</summary>
        public void Delete()
        {
            PanelModuleCommon.MoreButtonClick();
            PanelModuleCommon.DeleteButtonClick();
            DialogInformation dlg = new DialogInformation();

            dlg.ClickButtonByButtonTitle(Resource.Yes);
            // a delay is required here because selenium runs so fast that the next elements may not be ready to receive
            // input but also present so it does not fail to find the element
            Thread.Sleep(2000);
        }
        public void Clone(string code)
        {
            string clonedValue = code + Resource.CloneSuffix;

            PanelModuleCommon.CloneButtonClick();
            DialogFileMaintenanceClone dlg = new DialogFileMaintenanceClone();

            dlg.SetNewRecordCodeList(clonedValue);
            dlg.ContinueButtonClick();

            DialogInformation dlgInfo = new DialogInformation();

            dlg.ClickButtonByButtonTitle(Resource.ProcessButtonTitle);
            Dialog dlgSuccess = new Dialog(Resource.SuccessDialogTitle);

            dlgSuccess.CloseDialogByCloseButton();
        }
예제 #4
0
        public new void Clone(string code)
        {
            string clonedValue = code + Resource.CloneSuffix;

            PanelModuleCommon.CloneButtonClick();

            DialogFileMaintenanceClone cloneDlg = new DialogFileMaintenanceClone();

            cloneDlg.SetNewRecordCodeList(clonedValue);
            cloneDlg.SetNewSeason(Season);
            cloneDlg.SetNewYear(Year);
            cloneDlg.ContinueButtonClick();
            DialogInformation infoDlg = new DialogInformation();

            infoDlg.ClickButtonByButtonTitle("Process");
            RecTracPom.OnScreenElements.Dialog dialog = new RecTracPom.OnScreenElements.Dialog("Success");
            dialog.CloseDialogByCloseButton();
        }
예제 #5
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "EditImage":
            {
                try
                {
                    var path = F_File.browserFile("image | *.png;*.jpg;");
                    if (path != "")
                    {
                        PICTURE = new byte[] { };
                    }
                }
                catch (Exception e)
                {
                    F_File.LogError(e);
                }
            }
            break;

            case "DeleteImage":
            {
                PICTURE = new byte[] { };
            }
            break;

            case "Save":
            {
                SaveInput();
                DialogInformation.OK();
            }
            break;

            default: break;
            }
        }
예제 #6
0
            public static void Validate(int p_invoice_id, double p_mony_paid, string p_description)
            {
                var mInvoiceSell = Get(p_invoice_id);

                if (mInvoiceSell.VALIDATION == 1)
                {
                    DialogError.Error(); return;
                }

                var productsViews = productSell.GetProductsFromInvoice(p_invoice_id).ToList();

                foreach (object o in productsViews)
                {
                    double QUANTITY   = F_File.GetPropertyDouble(o, "QUANTITY");
                    int    ID_PRODUCT = F_File.GetPropertyInt(o, "ID_PRODUCT");
                    var    p          = product.Get(ID_PRODUCT);
                    if ((p.QUANTITY - QUANTITY) < 0)
                    {
                        DialogError.Error(); return;
                    }
                    p.QUANTITY = p.QUANTITY - QUANTITY;
                }

                mInvoiceSell.MONEY_PAID   = p_mony_paid;
                mInvoiceSell.MONEY_UNPAID = mInvoiceSell.MONEY_TOTAL - p_mony_paid;
                mInvoiceSell.DESCRIPTION  = p_description;
                mInvoiceSell.VALIDATION   = 1;

                if (mInvoiceSell.MONEY_PAID < mInvoiceSell.MONEY_TOTAL)
                {
                    var c = customer.Get((int)mInvoiceSell.ID_USERS);
                    c.MONEY_ACCOUNT = c.MONEY_ACCOUNT - mInvoiceSell.MONEY_UNPAID;
                }
                _db.SaveChanges();
                if (mInvoiceSell.VALIDATION == 1)
                {
                    DialogInformation.OK(); return;
                }
            }
예제 #7
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "DatabasePath":
            {
                TB_DatabasePath      = F_File.browserFile("Database | *.FDB;");
                C_Variables.DB_.file = TB_DatabasePath;
            }
            break;

            case "Save":
            {
                C_Setting_DB.SaveConfigDatabase();
            }
            break;

            case "Test":
            {
                if (T_Helper.IsNull())
                {
                    DialogError.Error();
                }
                else
                {
                    DialogInformation.OK();
                }
            }
            break;

            case "Shutdown":
            {
                if (DB_Access.GetInstatce().Shutdown())
                {
                    DialogInformation.OK();
                }
                else
                {
                    DialogError.Error();
                }
            }
            break;

            case "Backup":
            {
                if (DB_Access.GetInstatce().Backup() == "")
                {
                    DialogError.Error();
                }
                else
                {
                    DialogInformation.OK();
                }
            }
            break;

            case "Restore":
            {
                string p = F_File.browserFile("Database | *.FBK;");
                if (p == "")
                {
                    DialogError.Error(); break;
                }
                if (DB_Access.GetInstatce().Restore(p))
                {
                    DialogInformation.OK();
                }
                else
                {
                    DialogError.Error();
                }
            }
            break;

            case "CreateNew":
            {
                if (DB_Access.GetInstatce().CreateNew())
                {
                    DialogInformation.OK();
                }
                else
                {
                    DialogError.Error();
                }
            }
            break;

            case "Default":
            {
                C_Setting_DB.set_db_Default();
                TB_DatabaseDataSource = C_Variables.DB_.host;
                TB_DatabasePath       = C_Variables.DB_.file;
                TB_DatabasePort       = C_Variables.DB_.Port;
                TB_DatabaseUserID     = C_Variables.DB_.UserID;
                TB_DatabasePassword   = C_Variables.DB_.Password;
                ComboBoxSelected      = C_Variables.DB_.type == 0 ? "Default" : "Embedded";
            }
            break;

            case "Embedded":
            {
                C_Setting_DB.set_db_Embedded();
                TB_DatabaseDataSource = C_Variables.DB_.host;
                TB_DatabasePath       = C_Variables.DB_.file;
                TB_DatabasePort       = C_Variables.DB_.Port;
                TB_DatabaseUserID     = C_Variables.DB_.UserID;
                TB_DatabasePassword   = C_Variables.DB_.Password;
                ComboBoxSelected      = C_Variables.DB_.type == 0 ? "Default" : "Embedded";
            }
            break;

            default: break;
            }
        }