Ejemplo n.º 1
0
    private void ShowSafeReport()
    {
        // get safe repor for (store/safe)
        var report = new SafeMainManager().GetMainSafeReport(1);

        if (report != null)
        {
            double safeTotal = report.SafeDebitValueTotal != null ? (double)report.SafeDebitValueTotal : 0.00;

            // Safe/Store name.
            divSafeName.InnerHtml = report.StoreName;

            // المبالغ المودعة فى الخزنة
            divSafeTotal.InnerHtml = string.Format("{0:F} AED", safeTotal);

            // اجمالى المصروفات من الخزنة
            double totExpenses = report.TotalExpenses != null ? (double)report.TotalExpenses : 0;
            divTotalExpenses.InnerHtml = string.Format("{0:F} AED", totExpenses);

            // اجمالى المدفوعات للخزنة
            double totPayments = (double)(report.Payments + report.InvoicesFirstAmount); //report.Invoices + report.InvoicesFirstAmount +  + report.InvoicesFirstAmount);
            divTotalPayments.InnerHtml = string.Format("{0:F} AED", (totPayments));

            // اجمالى المبقى فى الخزنة
            double totRemaining = (safeTotal + totPayments) - totExpenses;
            divRemainderInSafe.InnerHtml = string.Format("{0:F} AED", (totRemaining));
        }
    }
Ejemplo n.º 2
0
    private void ShowMainSafeDetails(int id)
    {
        var safe = new SafeMainManager().GetMainSafeDebitDetails(id);

        if (safe != null)
        {
            hfId.Value    = safe.SafeID.ToString();
            txtValue.Text = safe.SafeDebitValue;

            txtAddDate.Text           = MinutesuaeConcrete.GetDateOnly(safe.SafeDebitDate);
            ddlEmployee.SelectedValue = safe.Employee_ID.ToString();
            ddlStore.SelectedValue    = safe.Store_ID.ToString();
        }
        else
        {
            lblError.Text = Resources.AdminResources_en.DataNotFound;
        }
    }
Ejemplo n.º 3
0
    private void SaveExpenseType()
    {
        MainSafeDebitCredit safe    = new MainSafeDebitCredit();
        SafeMainManager     manager = new SafeMainManager();


        safe.SafeID = hfId.Value != String.Empty ? Convert.ToInt32(hfId.Value) : 0;
        if (ddlEmployee.SelectedIndex > 0)
        {
            safe.Employee_ID = Convert.ToInt32(ddlEmployee.SelectedValue);
        }
        if (ddlStore.SelectedIndex > 0)
        {
            safe.Store_ID = Convert.ToInt64(ddlStore.SelectedValue);
        }

        if (txtAddDate.Text != "")
        {
            safe.SafeDebitDate = Convert.ToDateTime(txtAddDate.Text);
        }
        safe.SafeDebitValue = txtValue.Text;

        safe.System_Who_Add       = ClientSession.Current.loginId;
        safe.System_LastAction_IP = ClientSession.Current.IP;


        if (manager.SaveMainSafeDebitInfo(safe))
        {
            // reset controls
            ResetControls();

            // refresh saved data list
            ShowExpenseTypesList();
        }
        else
        {
            lblError.Text = Resources.AdminResources_en.ErrorSave;
        }
    }