Exemple #1
0
    protected void btnAdd_Click(object sender, EventArgs e)

    {
        CPurchseMasterServices ObjCPurchseMasterServices = new CPurchseMasterServices();
        int intReturnValues = CPurchseMasterServices.StockQtyList(Convert.ToInt32(LblProductId.Text));

        LblStockQty.Text = intReturnValues.ToString();
        if (LblStockQty.Text == "0")
        {
            Lblmsg.Text = "No Stock";
        }
        else
        {
            double tot;
            LblQty.Text   = "1";
            tot           = Convert.ToDouble(LblPrice.Text);  Convert.ToDouble(LblQty.Text);
            LblTotal.Text = Convert.ToString(tot);

            int intReturnValue = CCartMasterrServices.CartInsert(Convert.ToInt32(LblProductId.Text), Convert.ToInt32(DropdownSize.SelectedValue), Convert.ToDouble(LblPrice.Text), Convert.ToInt32(LblQty.Text), Convert.ToDouble(LblTotal.Text), Image2.ImageUrl);

            if (intReturnValue > 0)
            {
                Lblmsg.Text = "Item Add to Cart";
            }
        }
    }
    protected void ButOderDetail_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow gvRow in GvshoppingList.Rows)
        {
            //Label CartId = (Label)gvRow.FindControl("LblCartId");
            HiddenField CartId = (HiddenField)gvRow.FindControl("hidcartId");
            int         Cart1  = Convert.ToInt32(CartId.Value);

            HiddenField ProductId1 = (HiddenField)gvRow.FindControl("hidProductId");
            int         ProductId  = Convert.ToInt32(ProductId1.Value);

            HiddenField SizeId1 = (HiddenField)gvRow.FindControl("hidSizeId");
            int         SizeId  = Convert.ToInt32(SizeId1.Value);

            //Label Productname = (Label)gvRow.FindControl("LblProductId");
            //string data1 = (Productname.Text).ToString();
            //Label SizeDec = (Label)gvRow.FindControl("LblSize");

            //string data6 =(SizeDec.Text).ToString();
            Label  Qty          = (Label)gvRow.FindControl("LblQty");
            int    data2        = Convert.ToInt32(Qty.Text);
            Label  Price        = (Label)gvRow.FindControl("LblPrice");
            double data3        = Convert.ToDouble(Price.Text);
            Label  LineTotalAmt = (Label)gvRow.FindControl("LblTotal");
            double data4        = Convert.ToDouble(LineTotalAmt.Text);
            Label  TotalAmt     = (Label)GvshoppingList.FooterRow.FindControl("LblTotalAmt");
            double data5        = Convert.ToDouble(TotalAmt.Text);
            int    d1           = Convert.ToInt32(LblOrderId.Text);

            int intReturnValue = COrderMasterDetailServices.OrderMasterDetailInsert
                                     (Convert.ToInt32(d1),
                                     Convert.ToInt32(ProductId),
                                     Convert.ToInt32(SizeId),
                                     Convert.ToInt32(data2),
                                     Convert.ToDouble(data3),
                                     Convert.ToDouble(data4),
                                     Convert.ToDouble(data5));
            int intReturnValues     = CPurchseMasterServices.SellEnteryInsert(Convert.ToInt32(ProductId), Convert.ToInt32(data2), Convert.ToDouble(data3));
            int intReturnValuescart = CCartMasterrServices.CartDelete(Convert.ToInt32(Cart1));
            ButOder.Visible = false;
        }
        Response.Redirect("CreditcardMaster.aspx");
    }
Exemple #3
0
    protected void ButUpdate_Click(object sender, EventArgs e)
    {
        TblAddEdit.Visible = true;
        ButUpdate.Visible  = true;
        Butinsert.Visible  = false;
        ButCancle.Visible  = true;
        int intReturnvalue2  = 0;
        int intReturnValues3 = 0;

        int intReturnValue = CProductMasterServices.ProductMasterUpdate(
            Convert.ToInt32(TxtproductId.Text),
            Convert.ToInt32(Dropsupplierlist.SelectedValue),
            Convert.ToInt32(droplistcategory.SelectedValue),
            Convert.ToInt32(droplistsubcategory.SelectedValue),
            Convert.ToInt32(DropCosubcategoryList.SelectedValue),
            Convert.ToInt32(DropFabric.SelectedValue),
            TxtColor.Text,
            // DroplistColour.SelectedValue,
            TxtProductName.Text,
            Txtproductdescription.Text,
            Convert.ToInt32(LblTotalQty.Text),
            //FileUpload1.FileName,
            ViewState["Imagename"].ToString(),
            CheckStatus.Checked);

        foreach (GridViewRow gvrow in GvStockList.Rows)
        {
            DropDownList Size1      = (DropDownList)gvrow.FindControl("DropSize");
            int          Size       = Convert.ToInt32(Size1.SelectedValue);
            TextBox      Qty1       = (TextBox)gvrow.FindControl("TxtQty");
            int          Qty        = Convert.ToInt32(Qty1.Text);
            TextBox      PRate1     = (TextBox)gvrow.FindControl("TxtPRate");
            double       PRate      = Convert.ToDouble(PRate1.Text);
            TextBox      SRate1     = (TextBox)gvrow.FindControl("TxtSRate");
            double       SRate      = Convert.ToDouble(SRate1.Text);
            Label        Amount1    = (Label)gvrow.FindControl("LblAmount");
            decimal      Amount     = Convert.ToDecimal(Amount1.Text);
            HiddenField  StockId1   = (HiddenField)gvrow.FindControl("hidStockId");
            int          StockId    = Convert.ToInt32(StockId1.Value);
            HiddenField  PurchseId1 = (HiddenField)gvrow.FindControl("hidPurchaseId");
            int          PurchseId  = Convert.ToInt32(PurchseId1.Value);
            //int PurchaseBillno = Convert.ToInt32(PurchaseBillno1.Text);
            //TextBox PurchaseBillDate1 = (TextBox)gvrow.FindControl("TxtPBillDate");
            //DateTime PurchaseBillDate=Convert.ToDateTime(PurchaseBillDate1.Text);
            //TextBox ReturnStatus1 = (TextBox)gvrow.FindControl("TxtReturnStatus");
            //string purchaseId = GvStockList.DataKeys[gvrow.RowIndex][0].ToString();

            CPurchseMasterServices objCPurchseMasterServices = new CPurchseMasterServices();

            intReturnvalue2 = objCPurchseMasterServices.PurchseUpdate
                                  (PurchseId, Convert.ToInt32(TxtPurchaseBillno.Text), Convert.ToDateTime(TxtPurchaseBillDate.Text),
                                  Size, Qty, PRate, SRate, Amount, Convert.ToDecimal(LblTotalQty.Text), Convert.ToDecimal(TxtAddLess.Text), Convert.ToDecimal(LblTotalAmount.Text));

            CStockMasterServices ObjCStockMasterServices = new CStockMasterServices();

            intReturnValues3 = ObjCStockMasterServices.StockMasterUpdate(StockId, Convert.ToInt32(TxtproductId.Text), Size, Qty, PRate, SRate);
        }



        if (intReturnValue > 0)
        {
            lblmsgbox.Text = "Product Update";
            BindgvProdutlist();
            TxtproductId.Text   = "";
            TxtProductName.Text = "";
            TxtColor.Text       = "";
            LblTotalQty.Text    = "";
            LblTotalQty.Text    = "";
            LblNetAmount.Text   = "";
            LblTotalAmount.Text = "";
            TxtAddLess.Text     = "";

            CheckStatus.Checked = false;
        }

        else
        {
            lblmsgbox.Text = "Error occured while Updateing Product";
        }
        if (intReturnvalue2 > 0)
        {
            SetInitialRow();
            lblmsgbox.Text = "Update Purchse";
        }
        else
        {
            lblmsgbox.Text = "Error occured while Updateing Purchse";
        }
    }
Exemple #4
0
    protected void Butinsert_Click(object sender, EventArgs e)
    {
        {
            TblAddEdit.Visible = true;
            ButUpdate.Visible  = false;
            ButCancle.Visible  = true;


            //    }
            //}

            int intReturnValue = CProductMasterServices.ProductMasterInsert(
                Convert.ToInt32(Dropsupplierlist.SelectedValue),
                Convert.ToInt32(droplistcategory.SelectedValue),
                Convert.ToInt32(droplistsubcategory.SelectedValue),
                Convert.ToInt32(DropCosubcategoryList.SelectedValue),
                TxtProductName.Text, Convert.ToInt32(DropFabric.SelectedValue),
                TxtColor.Text,
                //DroplistColour.SelectedValue,
                Convert.ToInt32(LblTotalQty.Text),
                Txtproductdescription.Text,
                //Convert.ToDouble(TxtPrice.Text),
                //strFileName,
                ViewState["Imagename"].ToString(),
                CheckStatus.Checked);
            LblProductno.Text = intReturnValue.ToString();

            int intReturnValue1 = 0;
            foreach (GridViewRow gvrow in GvStockList.Rows)
            {
                DropDownList Size1   = (DropDownList)gvrow.FindControl("DropSize");
                int          Size    = Convert.ToInt32(Size1.Text);
                TextBox      Qty1    = (TextBox)gvrow.FindControl("TxtQty");
                int          Qty     = Convert.ToInt32(Qty1.Text);
                TextBox      PRate1  = (TextBox)gvrow.FindControl("TxtPRate");
                double       PRate   = Convert.ToDouble(PRate1.Text);
                TextBox      SRate1  = (TextBox)gvrow.FindControl("TxtSRate");
                double       SRate   = Convert.ToDouble(SRate1.Text);
                Label        Amount1 = (Label)gvrow.FindControl("LblAmount");
                decimal      Amount  = Convert.ToInt32(Amount1.Text);
                //TextBox PurchaseBillDate1 = (TextBox)gvrow.FindControl("TxtPBillDate");
                //DateTime PurchaseBillDate = Convert.ToDateTime(PurchaseBillDate1.Text);
                //TextBox ReturnStatus1 = (TextBox)gvrow.FindControl("TxtReturnStatus");
                //string purchaseId = GvStockList.DataKeys[gvrow.RowIndex][0].ToString();

                //int ReturnStatus = 0;
                //if (ReturnStatus1.Text != "")
                //{
                //    ReturnStatus = Convert.ToInt32(ReturnStatus1.Text);
                //}


                CPurchseMasterServices objCPurchseMasterServices = new CPurchseMasterServices();
                intReturnValue1 = objCPurchseMasterServices.PurchseEnteryInsert(Convert.ToInt32(LblProductno.Text), Convert.ToInt32(TxtPurchaseBillno.Text),
                                                                                Convert.ToDateTime(TxtPurchaseBillDate.Text),
                                                                                Size, Qty, PRate, Amount, Convert.ToDecimal(LblTotalAmount.Text), Convert.ToDecimal(TxtAddLess.Text), Convert.ToDecimal(LblNetAmount.Text));
                int intReturnValues = CStockMasterServices.StockMasterInsert(Convert.ToInt32(LblProductno.Text), Size, Qty, PRate, SRate);
            }

            if (intReturnValue > 0)
            {
                lblmsgbox.Text = "Insert Data";

                BindgvProdutlist();
                BindCategoryName();
                //BindgvProductlist();
                TxtproductId.Text          = "";
                TxtProductName.Text        = "";
                Txtproductdescription.Text = "";
                TxtColor.Text          = "";
                TxtPurchaseBillno.Text = "";
                // TxtPrice.Text = "";
                LblTotalQty.Text    = "";
                LblNetAmount.Text   = "";
                LblTotalAmount.Text = "";
                TxtAddLess.Text     = "";
            }

            else
            {
                lblmsgbox.Text = "Error occured while insering Product";
            }

            if (intReturnValue1 > 0)
            {
                SetInitialRow();
            }
            else
            {
                lblmsgbox.Text = "Error occured while insering Purchse";
            }
        }
    }
Exemple #5
0
    protected void gvProductlist_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        TblAddEdit.Visible = false;
        Butinsert.Visible  = false;
        ButCancle.Visible  = true;
        ButUpdate.Visible  = true;
        //int  inReturnValue1=0;
        //int intReturnValue2=0;

        int            intProductId = Convert.ToInt32(gvProductlist.DataKeys[e.RowIndex].Value);
        CProductMaster ObjProduct   = new CProductMaster(intProductId);

        if (ObjProduct.IsExit == true)
        {
            lblmsgbox.Text    = "";
            TxtproductId.Text = ObjProduct.ProductId.ToString();
            droplistcategory.SelectedValue    = ObjProduct.CategoryId.ToString();
            droplistsubcategory.SelectedValue = ObjProduct.SubCategoryId.ToString();

            //DroplistColour.SelectedValue = ObjProduct.Colour;
            TxtProductName.Text        = ObjProduct.ProductName;
            Txtproductdescription.Text = ObjProduct.ProductDesc;
            //TxtPrice.Text = ObjProduct.Price.ToString();
            LblTotalQty.Text    = ObjProduct.Qty.ToString();
            CheckStatus.Checked = ObjProduct.Status;
        }
        int intReturnValue = CProductMasterServices.ProductMasterDelete(Convert.ToInt32(TxtproductId.Text));

        //int intstockid = Convert.ToInt32(GvStockList.DataKeys[e.RowIndex].Value);
        //CStockMaster Objstockid = new CStockMaster(intstockid);
        //if (Objstockid.IsExit == true)
        //{

        //}

        foreach (GridViewRow gvrow in GvStockList.Rows)
        {
            HiddenField StockId1 = (HiddenField)gvrow.FindControl("hidStockId");
            int         StockId  = Convert.ToInt32(StockId1.Value);

            HiddenField PurchseId1      = (HiddenField)gvrow.FindControl("hidPurchaseId");
            int         PurchseId       = Convert.ToInt32(PurchseId1.Value);
            int         intReturnValues = CStockMasterServices.StockMasterDelete(StockId);
            int         inReturnValue1  = CPurchseMasterServices.PurchaseDelete(PurchseId);
        }
        //CPurchseMasterServices ObjCPurchseMasterServices = new CPurchseMasterServices();



        if (intReturnValue > 0)
        {
            lblmsgbox.Text = "Product Delete";
            BindgvProdutlist();
            TxtproductId.Text          = "";
            Txtproductdescription.Text = "";
            TxtProductName.Text        = "";
            TxtColor.Text = "";

            //TxtPrice.Text = "";
            LblTotalQty.Text = "";
        }
        else
        {
            lblmsgbox.Text = "Error occured while Deleting Data.";
        }
    }