Пример #1
0
    private void ShowInvoiceDetails(long p)
    {
        var result = new SaleInvoicesManager().GetCarSaleInvoiceDetails(p);

        if (result != null)
        {
            divArrivalDate.InnerHtml = MinutesuaeConcrete.GetDateOnly(result.arrive_date, "dd/MM/yyyy");
            divCarModel.InnerHtml    = string.Format("{0}    -   {1}", result.MarkerNameEn, result.TypeNameEn);
            divCarNo.InnerHtml       = result.engine_no;
            divChassisNo.InnerHtml   = result.chassis_no;
            divColor.InnerHtml       = result.ExtColorEn;
            divLotNo.InnerHtml       = result.lot_no;
            divYear.InnerHtml        = result.YearNameEn;

            divClient.InnerHtml      = result.ClientName;
            divDescription.InnerHtml = result.Notes;
            divEmail.InnerHtml       = result.CompEmail;
            divFax.InnerHtml         = result.CompFax;
            divFirst.InnerHtml       = string.Format("{0:F}   {1}", result.FirstAmount, result.CurrencySymbol);
            divLotNo.InnerHtml       = result.lot_no;
            divName.InnerHtml        = result.CompName;
            divPhone.InnerHtml       = result.CompPhone;
            divPrice.InnerHtml       = string.Format("{0:F}   {1}", result.SalePrice, result.CurrencySymbol);
            divWebsite.InnerHtml     = result.CmopWebsite;

            divBillStatus.InnerHtml = result.Active == false ? "Canceled" : "";

            imgMain.ImageUrl += result.main_picture != null ? result.main_picture : "no_photo.jpg";

            // Go to list.
            string url = "client/" + result.Client_ID + "/invoices/" + MinutesuaeConcrete.ToSeoUrl(result.ClientName) + ".aspx";
            lnkGoList.Attributes.Add("href", url);
        }
    }
Пример #2
0
    /// <summary>
    /// Add new ClientPayment to db.
    /// </summary>
    private void SaveClientPaymentInformation()
    {
        ClientPayment item = new ClientPayment();

        try
        {
            if (hfID.Value != "")
            {
                item.PaymentID = Convert.ToInt32(hfID.Value);
            }
            item.Client_ID   = Convert.ToInt32(ddlClients.SelectedValue);
            item.Currency_ID = Convert.ToInt32(ddlCurrency.SelectedValue);

            item.Notes        = txtShortdesc.Text;
            item.ReceiverName = txtReceivedName.Text;

            if (ddlExchangeCo.SelectedIndex > 0)
            {
                item.ExchangeCompany_ID = Convert.ToInt32(ddlExchangeCo.SelectedValue);
            }
            if (ltlInvoiceID.Text != "")
            {
                item.Invoice_ID = Convert.ToInt32(ltlInvoiceID.Text);
            }
            if (txtDate.Text != "")
            {
                item.PaymentDate = Convert.ToDateTime(txtDate.Text);
            }
            if (txtPaymentValue.Text != "")
            {
                item.PaymentValue = Convert.ToDecimal(txtPaymentValue.Text);
            }
            //item.Active = cbActive.Checked;

            item.Store_ID             = 1; // Store sale from.
            item.System_Who_Add       = ClientSession.Current.loginId;
            item.System_LastAction_IP = ClientSession.Current.IP;


            // perform saving method.
            if (new ClientPaymentsManager().SaveClientPayment(item))
            {
                // go to ClientPayments list.
                string url = string.Format("client/{0}/payments/{1}.aspx", ddlClients.SelectedValue, MinutesuaeConcrete.ToSeoUrl(ddlClients.SelectedItem.Text)); //"ClientPaymentsView.aspx";

                if (hfID.Value != "")
                {
                    Response.Redirect(ResolveClientUrl(url));
                }
                else
                {
                    Response.Redirect(ResolveClientUrl(url));
                }
            }
            else
            {
                lblError.Text = Resources.AdminResources_en.ErrorSave;
            }
        }
        catch { lblError.Text = Resources.AdminResources_en.ErrorSave; }
    }
Пример #3
0
    private void SavePayment()
    {
        CarExpense exp = new CarExpense();

        exp.ExpenseID = (hfID.Value != "" ? Convert.ToInt64(hfID.Value) : 0);
        exp.InOutType = "payment";

        //exp.Active = cbActive.Checked;
        exp.CompanyType = rblCompanyType.SelectedValue;
        exp.InvoiceCode = txtInvoiceNo.Text;
        exp.Notes       = txtNotes.Text;
        //exp.Car_ID = Convert.ToInt64(lblCompanyCode.Text);
        //exp.ExpenseType_ID = Convert.ToInt32(ddlExpenseType.SelectedValue);
        exp.PaymentDate  = Convert.ToDateTime(txtPaymentDate.Text);
        exp.ExpenseValue = Convert.ToDecimal(txtValue.Text);
        exp.PaymentValue = Convert.ToDecimal(txtValue.Text);
        //exp.DueDate = Convert.ToDateTime(txtDueDate.Text);
        exp.Company_ID         = Convert.ToInt64(ddlDueforCompany.SelectedValue);
        exp.Currency_ID        = Convert.ToInt32(ddlCurrencyUsed.SelectedValue);
        exp.ExchangeCompany_ID = Convert.ToInt64(ddlExchangeCo.SelectedValue);

        exp.Store_ID = 1;
        exp.WhoAdd   = ClientSession.Current.loginId;
        exp.EditIP   = exp.AddIP = ClientSession.Current.IP;


        if (new ExpensesManager().SaveExpense(exp))
        {
            string url = ResolveClientUrl("payments/" + ddlDueforCompany.SelectedValue + "/" + rblCompanyType.SelectedValue + "/" + MinutesuaeConcrete.ToSeoUrl(ddlDueforCompany.SelectedItem.Text) + ".aspx");
            Response.RedirectPermanent(url);
        }
        else
        {
            lblError.Text = Resources.AdminResources_en.ErrorSave;
        }
    }