Esempio n. 1
0
        protected void btnAddAgentProductItem_click(object sender, EventArgs e)
        {
            Invoice     invocie    = new Invoice();
            InvoiceData invicedata = new InvoiceData();

            invocie.TokanId    = hftokanno.Value;
            invocie.UserID     = GlobalInfo.Userid;
            invocie.TypeID     = Convert.ToInt32(dpAgentProductType.SelectedItem.Value);
            invocie.ProductID  = Convert.ToInt32(dpAgentProductdetaisl.SelectedItem.Value);
            invocie.qty        = Convert.ToDouble(txtagentOrderqty.Text);
            invocie.UnitCost   = Convert.ToDouble(hfAgentProductUnitPrice.Value);
            invocie.totalCoast = Convert.ToDouble(txtagentOrderqty.Text) * Convert.ToDouble(hfAgentProductUnitPrice.Value);
            int  flag   = 1;
            bool result = invicedata.CheckTempInvoiceItam(invocie, flag);

            if (!result)
            {
                invicedata.InsertTempInvoiceItam(invocie);
                BindAgntTempItam(invocie);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Item already exists')", true);
            }
        }
Esempio n. 2
0
        protected void btnAddAgentProductItem_click(object sender, EventArgs e)
        {
            dpAgent.Enabled = false;

            double  tempQty = 0;
            DataSet ds      = new DataSet();

            Invoice     invocie    = new Invoice();
            InvoiceData invicedata = new InvoiceData();

            invocie.TokanId        = hftokanno.Value;
            invocie.UserID         = GlobalInfo.Userid;
            invocie.TypeID         = Convert.ToInt32(dpAgentProductType.SelectedItem.Value);
            invocie.ProductID      = Convert.ToInt32(dpAgentProductdetaisl.SelectedItem.Value);
            invocie.qty            = Convert.ToDouble(txtagentOrderqty.Text);
            invocie.UnitCost       = Convert.ToDouble(hfAgentProductUnitPrice.Value);
            invocie.totalCoast     = Convert.ToDouble(txtagentOrderqty.Text) * Convert.ToDouble(hfAgentProductUnitPrice.Value);
            tempQty                = Convert.ToDouble(txtagentOrderqty.Text);
            invocie.orderDate      = GlobalInfo.OfflineBoothDate;
            invocie.CurrentBoothID = GlobalInfo.CurrentbothID;
            int  flag   = 2;
            bool result = invicedata.CheckTempInvoiceItam(invocie, flag);

            if (!result)
            {
                ds = invicedata.checkStock(invocie);
                if (!Comman.Comman.IsDataSetEmpty(ds))
                {
                    double temp = Convert.ToDouble(ds.Tables[0].Rows[0]["avail"]);

                    if (temp >= tempQty)
                    {
                        invicedata.Booth_InsertTempInvoiceItam(invocie);
                        BindAgntTempItam(invocie);
                        pnlBills.Visible      = false;
                        txtagentOrderqty.Text = "";
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "alertMessage", "alertMessage();", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "alertMessage", "alertMessage();", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Item already exists')", true);
            }
        }
Esempio n. 3
0
        //
        protected void btnaddCustomeraItam_clcik(object sender, EventArgs e)
        {
            double      tempQty    = 0;
            Invoice     invocie    = new Invoice();
            InvoiceData invicedata = new InvoiceData();
            DataSet     ds         = new DataSet();

            invocie.TokanId        = hftokanno.Value;
            invocie.UserID         = GlobalInfo.Userid;
            invocie.TypeID         = Convert.ToInt32(dpCustomerPRoductType.SelectedItem.Value);
            invocie.ProductID      = Convert.ToInt32(dpCustomerPRoductDetails.SelectedItem.Value);
            invocie.qty            = Convert.ToDouble(txtcustomerqty.Text);
            invocie.UnitCost       = Convert.ToDouble(hfCustmoerUnitPrice.Value);
            invocie.totalCoast     = Convert.ToDouble(txtcustomerqty.Text) * Convert.ToDouble(hfCustmoerUnitPrice.Value);
            tempQty                = Convert.ToDouble(txtcustomerqty.Text);
            invocie.orderDate      = DateTime.Now.ToString("dd-MM-yyyy");
            invocie.CurrentBoothID = GlobalInfo.CurrentbothID;
            int  flag   = 2;
            bool result = invicedata.CheckTempInvoiceItam(invocie, flag);

            if (!result)
            {
                ds = invicedata.checkStock(invocie);
                if (!Comman.Comman.IsDataSetEmpty(ds))
                {
                    double temp = Convert.ToDouble(ds.Tables[0].Rows[0]["avail"]);

                    if (temp >= invocie.qty)
                    {
                        invicedata.Booth_InsertTempInvoiceItam(invocie);
                        BindCustomerTempItam(invocie);
                        pnlBill.Visible     = true;
                        btnPrint.Visible    = false;
                        pnlBills.Visible    = false;
                        pnlBill.Enabled     = true;
                        txtcustomerqty.Text = "";
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "alertMessage", "alertMessage();", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "alertMessage", "alertMessage();", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Item already exists')", true);
            }
        }