Example #1
0
        protected void btnAddItem_Click(object sender, EventArgs e)
        {
            dpVendor.Enabled = false;

            orderCart           = new OrderCart();
            purchaseData        = new PurchaseData();
            orderCart.Tokan     = hftokanno.Value;
            orderCart.CreatedBy = GlobalInfo.Userid;

            orderCart.RequestDetailsId = Convert.ToInt32(dpItem.SelectedItem.Value);
            orderCart.Quantity         = Convert.ToDecimal(hfQuantity.Value);
            orderCart.VendorId         = Convert.ToInt32(dpVendor.SelectedItem.Value);
            orderCart.Price            = Convert.ToDecimal(txtPrice.Text);
            orderCart.Excise           = Convert.ToDouble(txtExcise.Text);
            orderCart.cst = Convert.ToDouble(txtCST.Text);
            orderCart.Vat = Convert.ToDouble(txtVat.Text);
            //orderCart.Insurance = Convert.ToDecimal(txtInsurance.Text);
            orderCart.Insurance = 0;
            orderCart.Amt       = orderCart.Quantity * (orderCart.Price + (orderCart.Price / 100) * Convert.ToDecimal(orderCart.Excise) + (orderCart.Price / 100) * Convert.ToDecimal(orderCart.cst) + (orderCart.Price / 100) * Convert.ToDecimal(orderCart.Vat) + orderCart.Insurance);

            orderCart.Flag = 1; //1 for INSERT

            bool result = purchaseData.OrderCartDML(orderCart);

            if (result)
            {
                clearField();
                bindCartList(orderCart);
            }
            dpSelect();
        }
Example #2
0
        protected void rpAgentOrderdetails_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int TempID = 0;

            TempID = Convert.ToInt32(e.CommandArgument);
            switch (e.CommandName)
            {
            case ("delete"):
            {
                orderCart             = new OrderCart();
                purchaseData          = new PurchaseData();
                orderCart.OrderCartId = TempID;
                orderCart.Tokan       = hftokanno.Value;
                orderCart.CreatedBy   = GlobalInfo.Userid;

                orderCart.Flag = 2;         //2 for delete
                purchaseData.OrderCartDML(orderCart);

                bindCartList(orderCart);
                //RemoveTempID(TempID);
                //invocie.TokanId = hftokanno.Value;
                //invocie.UserID = GlobalInfo.Userid;
                //BindAgntTempItam(invocie);
                upMain.Update();

                break;
            }
            }
        }