示例#1
0
        public bool Save(TimedProductLotEL TimedProductLotEL, out string Responcetxt)
        {
            ProcedureExecute proc;
            bool             Res = false; string strError = string.Empty;

            try
            {
                using (proc = new ProcedureExecute("prcTimedProductLot"))
                {
                    proc.AddVarcharPara("@Action", 100, "Save");
                    proc.AddVarcharPara("@ProductUsed", 200, TimedProductLotEL.ProductUsed);
                    proc.AddIntegerPara("@CategoryId", TimedProductLotEL.CategoryId);
                    proc.AddIntegerPara("@AuctionId", TimedProductLotEL.AuctionId);
                    proc.AddBooleanPara("@IsBranded", TimedProductLotEL.IsBranded);
                    proc.AddVarcharPara("@Title", 200, TimedProductLotEL.Title);
                    proc.AddVarcharPara("@SKU", 200, TimedProductLotEL.SKU);
                    proc.AddVarcharPara("@Description", 200, TimedProductLotEL.Description);
                    proc.AddVarcharPara("@Question", 200, TimedProductLotEL.Question);
                    proc.AddIntegerPara("@Quantity", TimedProductLotEL.Quantity);
                    proc.AddVarcharPara("@CostBasis", 200, TimedProductLotEL.CostBasis);
                    proc.AddVarcharPara("@RetailPrice", 200, TimedProductLotEL.RetailPrice);
                    proc.AddVarcharPara("@BuyPrice", 200, TimedProductLotEL.BuyPrice);
                    proc.AddVarcharPara("@StartingBid", 200, TimedProductLotEL.StartingBid);
                    proc.AddVarcharPara("@ShipWithin", 200, TimedProductLotEL.ShipWithin);
                    proc.AddVarcharPara("@DeliveryTime", 200, TimedProductLotEL.DeliveryTime);
                    proc.AddVarcharPara("@ShipCountry", 200, TimedProductLotEL.ShipCountry);
                    proc.AddVarcharPara("@ShippingPrice", 200, TimedProductLotEL.ShippingPrice);
                    proc.AddBooleanPara("@IsFreeShipping", TimedProductLotEL.IsFreeShipping);
                    proc.AddBooleanPara("@IsShippedEverywhere", TimedProductLotEL.IsShippedEverywhere);
                    proc.AddVarcharPara("@Images", 800, TimedProductLotEL.images);
                    proc.AddNVarcharPara("@ReturnValue", 500, TimedProductLotEL.ReturnValue, QueryParameterDirection.Output);
                    proc.AddVarcharPara("@LowEstimatePrice", 200, TimedProductLotEL.LowEstimatePrice);
                    proc.AddVarcharPara("@HighEstimatePrice", 200, TimedProductLotEL.HighEstimatePrice);
                    proc.AddVarcharPara("@MaximumReserveValue", 200, TimedProductLotEL.MaximumReserveValue);
                    proc.AddBooleanPara("@IsSold", TimedProductLotEL.IsSold);
                    proc.AddIntegerPara("@BidderId", TimedProductLotEL.BidderId);
                    int i = proc.RunActionQuery();
                    if (i > 0)
                    {
                        Res = true;
                        TimedProductLotEL.ProductLotId = Convert.ToInt32(proc.GetParaValue("@ReturnValue"));
                        strError = "Item added successfully.";
                    }
                    else
                    {
                        strError = Convert.ToString(proc.GetParaValue("@ReturnValue"));
                    }

                    Responcetxt = strError;
                    return(Res);
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }

            finally
            {
                proc = null;
            }
        }
示例#2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         TimedProductLotBL objTimedProductLotBL = new TimedProductLotBL();
         TimedProductLotEL objTimedProductLotEL = new TimedProductLotEL();
         string            Responsetxt          = string.Empty;
         string            productimages        = Request["hdnimagefiles"];
         objTimedProductLotEL.ProductUsed = ItemUsed.SelectedItem.ToString();
         if (!categotyLevel2.Visible)
         {
             objTimedProductLotEL.CategoryId = Convert.ToInt32(categotyLevel1.SelectedValue);
         }
         else
         {
             if (categotyLevel3.Visible)
             {
                 objTimedProductLotEL.CategoryId = Convert.ToInt32(categotyLevel3.SelectedValue);
             }
             else
             {
                 objTimedProductLotEL.CategoryId = Convert.ToInt32(categotyLevel2.SelectedValue);
             }
         }
         objTimedProductLotEL.AuctionId           = Convert.ToInt32(auction.SelectedValue);
         objTimedProductLotEL.IsBranded           = rdbYes.Checked;
         objTimedProductLotEL.Title               = txtTitle.Text;
         objTimedProductLotEL.SKU                 = txtSKU.Text;
         objTimedProductLotEL.Description         = txtDesc.Text;
         objTimedProductLotEL.Question            = txtQuestion.Text;
         objTimedProductLotEL.Quantity            = Convert.ToInt32(txtQuantity.Text);
         objTimedProductLotEL.CostBasis           = txtCost.Text;
         objTimedProductLotEL.RetailPrice         = txtRetail.Text;
         objTimedProductLotEL.BuyPrice            = txtBuy.Text;
         objTimedProductLotEL.StartingBid         = txtStartBid.Text;
         objTimedProductLotEL.ShipCountry         = ddlCountry.Text;
         objTimedProductLotEL.ShipWithin          = ddlShipWithin.Text;
         objTimedProductLotEL.DeliveryTime        = ddlTimeTake.Text;
         objTimedProductLotEL.IsFreeShipping      = chkFreeShipping.Checked;
         objTimedProductLotEL.ShippingPrice       = ddlPrice.Text;
         objTimedProductLotEL.IsShippedEverywhere = chkShip.Checked;
         objTimedProductLotEL.LowEstimatePrice    = lowEstimatePrice.Text;
         objTimedProductLotEL.HighEstimatePrice   = highEstimatePrice.Text;
         objTimedProductLotEL.MaximumReserveValue = maximumReserveValue.Text;
         objTimedProductLotEL.BidderId            = 0;
         objTimedProductLotEL.IsSold              = false;
         objTimedProductLotEL.images              = productimages;
         if (objTimedProductLotBL.Save(objTimedProductLotEL, out Responsetxt))
         {
             rdbYes.Checked           = false;
             txtTitle.Text            = "";
             txtSKU.Text              = "";
             txtDesc.Text             = "";
             txtQuestion.Text         = "";
             txtQuantity.Text         = "";
             txtCost.Text             = "";
             txtRetail.Text           = "";
             txtBuy.Text              = "";
             txtStartBid.Text         = "";
             ddlCountry.Text          = "";
             ddlShipWithin.Text       = "";
             ddlTimeTake.Text         = "";
             chkFreeShipping.Checked  = false;
             ddlPrice.Text            = "";
             chkShip.Checked          = false;
             lowEstimatePrice.Text    = "";
             highEstimatePrice.Text   = "";
             maximumReserveValue.Text = "";
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "alert('" + Responsetxt + "');", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "alert('" + Responsetxt + "');", true);
         }
     }
 }