Esempio n. 1
0
        public DataSet ShowInventoryDetails(BEL BusinessEntityLayer)
        {
            try
            {
                sqlcon = new SqlConnection(DatabaseCredientials);
                sqlcon.Open();

                sqlcmd             = new SqlCommand();
                sqlcmd.Connection  = sqlcon;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.CommandText = "Sp_AllInventorydetails";
                sqlcmd.Parameters.Add("@ID", SqlDbType.Int).Value = BusinessEntityLayer.ID;
                sqlad = new SqlDataAdapter(sqlcmd);
                ds    = new DataSet();
                sqlad.Fill(ds);

                if (ds.Tables[7].Rows.Count != 0)
                {
                    BusinessEntityLayer.Retout = 1;
                }
                else
                {
                    BusinessEntityLayer.Retout = 0;
                }
            }
            catch (Exception e)
            {
                BusinessEntityLayer.ErrorMessage = e.ToString();
            }
            finally
            {
            }
            return(ds);
        }
Esempio n. 2
0
        public string InsertAddStock(BEL BusinessEntityLayer)
        {
            DAL Databaselayer = new DAL();

            try
            {
                return(Databaselayer.AddStock(BusinessEntityLayer));
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                Databaselayer = null;
            }
        }
Esempio n. 3
0
        public string InsertWarehouseInventory(BEL BusinessEntityLayer)
        {
            DAL Databaselayer = new DAL();

            try
            {
                return(Databaselayer.WarehouseInventory(BusinessEntityLayer));
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                Databaselayer = null;
            }
        }
Esempio n. 4
0
        public DataSet DisplayInventory(BEL BusinessEntityLayer)
        {
            DAL Databaselayer = new DAL();

            try
            {
                return(Databaselayer.ShowInventoryDetails(BusinessEntityLayer));
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                Databaselayer = null;
            }
        }
Esempio n. 5
0
        public string AddStock(BEL BusinessEntityLayer)
        {
            try
            {
                sqlcon = new SqlConnection(DatabaseCredientials);
                sqlcon.Open();

                sqlcmd             = new SqlCommand();
                sqlcmd.Connection  = sqlcon;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.CommandText = "AddStock";
                sqlcmd.Parameters.Add("@InventoryID", SqlDbType.Int).Value = BusinessEntityLayer.ID;
                sqlcmd.Parameters.Add("@TransactionDetails", SqlDbType.VarChar, 255).Value = BusinessEntityLayer.TransDetails;
                sqlcmd.Parameters.Add("@ProductName", SqlDbType.VarChar, 255).Value        = BusinessEntityLayer.productname;
                sqlcmd.Parameters.Add("@WarehouseName", SqlDbType.VarChar, 255).Value      = BusinessEntityLayer.warehousename;
                sqlcmd.Parameters.Add("@Cost", SqlDbType.Decimal).Value                     = BusinessEntityLayer.Cost;
                sqlcmd.Parameters.Add("@OldQuantity", SqlDbType.Decimal).Value              = BusinessEntityLayer.OldQuantity;
                sqlcmd.Parameters.Add("@NewQuantity", SqlDbType.Decimal).Value              = BusinessEntityLayer.NewQuantity;
                sqlcmd.Parameters.Add("@Comments", SqlDbType.VarChar, 255).Value            = BusinessEntityLayer.Comments;
                sqlcmd.Parameters.Add("@TransactionType", SqlDbType.VarChar, 255).Value     = BusinessEntityLayer.TransType;
                sqlcmd.Parameters.Add("@ClientName", SqlDbType.VarChar, 255).Value          = BusinessEntityLayer.CLientName;
                sqlcmd.Parameters.Add("@CreatedOrModifiedBy", SqlDbType.VarChar, 255).Value = BusinessEntityLayer.CreatedBy;

                sqlcmd.Parameters.Add("@Retout", SqlDbType.Int).Direction = ParameterDirection.Output;

                sqlcmd.ExecuteNonQuery();

                BusinessEntityLayer.Retout = Convert.ToInt32(sqlcmd.Parameters["@Retout"].Value.ToString());

                strMessage = sqlcmd.Parameters["@Retout"].Value.ToString();
            }
            catch (Exception e)
            {
                BusinessEntityLayer.ErrorMessage = e.ToString();
            }
            finally
            {
                sqlcmd.Dispose();
                sqlcon.Close();
                sqlcon.Dispose();
            }
            return(strMessage);;
        }
Esempio n. 6
0
        protected void btnsaveclose_Click(object sender, EventArgs e)
        {
            BusinessEntityLayer = new BEL();

            BusinessLogicLayer = new BLL();

            if (lblproductid.Text != "")
            {
                BusinessEntityLayer.ID = Convert.ToInt32(lblproductid.Text);
            }
            else
            {
                BusinessEntityLayer.ID = 0;
            }

            BusinessEntityLayer.productname = txtproductname.Text;

            BusinessEntityLayer.Manufacturer = txtmanufacturar.Text;

            BusinessEntityLayer.description = txtdescription.Text;

            BusinessEntityLayer.prod_tag1 = txtprodtag1.Text;

            BusinessEntityLayer.prod_tag2 = txtprodtag2.Text;

            BusinessEntityLayer.saleprice = Convert.ToDecimal(txtsaleprice.Text);

            BusinessEntityLayer.CreatedBy = "Pankaj Sapkal";

            BusinessLogicLayer.InsertProductInventory(BusinessEntityLayer);

            if (BusinessEntityLayer.Retout == 1)
            {
                ShowMessage("Successfully Inserted Your Transaction");
                ControlState();
                bindgrid();
            }
            else
            {
                ShowMessage("Error while Inserting product Name" + BusinessEntityLayer.ErrorMessage);
            }
        }
Esempio n. 7
0
        public string ClientInventory(BEL BusinessEntityLayer)
        {
            try
            {
                sqlcon = new SqlConnection(DatabaseCredientials);
                sqlcon.Open();

                sqlcmd             = new SqlCommand();
                sqlcmd.Connection  = sqlcon;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.CommandText = "Sp_InsInventoryClient";
                sqlcmd.Parameters.Add("@ClientID", SqlDbType.Int).Value                     = BusinessEntityLayer.ID;
                sqlcmd.Parameters.Add("@ClientName", SqlDbType.VarChar, 255).Value          = BusinessEntityLayer.CLientName;
                sqlcmd.Parameters.Add("@ContactNo", SqlDbType.VarChar, 255).Value           = BusinessEntityLayer.contactno;
                sqlcmd.Parameters.Add("@ContactPerson", SqlDbType.VarChar, 255).Value       = BusinessEntityLayer.contactperson;
                sqlcmd.Parameters.Add("@Address", SqlDbType.VarChar, 255).Value             = BusinessEntityLayer.Address;
                sqlcmd.Parameters.Add("@EmailID", SqlDbType.VarChar, 255).Value             = BusinessEntityLayer.EmailID;
                sqlcmd.Parameters.Add("@IsVendor", SqlDbType.Bit).Value                     = BusinessEntityLayer.IsVendor;
                sqlcmd.Parameters.Add("@IsCustomer", SqlDbType.Bit).Value                   = BusinessEntityLayer.IsCustomer;
                sqlcmd.Parameters.Add("@CreatedOrModifiedBy", SqlDbType.VarChar, 255).Value = BusinessEntityLayer.CreatedBy;

                sqlcmd.Parameters.Add("@Retout", SqlDbType.Int).Direction = ParameterDirection.Output;

                sqlcmd.ExecuteNonQuery();

                BusinessEntityLayer.Retout = Convert.ToInt32(sqlcmd.Parameters["@Retout"].Value.ToString());

                strMessage = sqlcmd.Parameters["@Retout"].Value.ToString();
            }
            catch (Exception e)
            {
                BusinessEntityLayer.ErrorMessage = e.ToString();
            }
            finally
            {
                sqlcmd.Dispose();
                sqlcon.Close();
                sqlcon.Dispose();
            }
            return(strMessage);;
        }
Esempio n. 8
0
        public string ProductInventory(BEL BusinessEntityLayer)
        {
            try
            {
                sqlcon = new SqlConnection(DatabaseCredientials);
                sqlcon.Open();

                sqlcmd             = new SqlCommand();
                sqlcmd.Connection  = sqlcon;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.CommandText = "Sp_InsInventoryProddetails";
                sqlcmd.Parameters.Add("@ProductID", SqlDbType.Int).Value                    = BusinessEntityLayer.ID;
                sqlcmd.Parameters.Add("@ProductName", SqlDbType.VarChar, 255).Value         = BusinessEntityLayer.productname;
                sqlcmd.Parameters.Add("@Describtion", SqlDbType.VarChar, 255).Value         = BusinessEntityLayer.description;
                sqlcmd.Parameters.Add("@Manufacturer", SqlDbType.VarChar, 255).Value        = BusinessEntityLayer.Manufacturer;
                sqlcmd.Parameters.Add("@ProductTag1", SqlDbType.VarChar, 255).Value         = BusinessEntityLayer.prod_tag1;
                sqlcmd.Parameters.Add("@ProductTag2", SqlDbType.VarChar, 255).Value         = BusinessEntityLayer.prod_tag2;
                sqlcmd.Parameters.Add("@Saleprice", SqlDbType.Decimal).Value                = BusinessEntityLayer.saleprice;
                sqlcmd.Parameters.Add("@CreatedOrModifiedBy", SqlDbType.VarChar, 255).Value = BusinessEntityLayer.CreatedBy;

                sqlcmd.Parameters.Add("@Retout", SqlDbType.Int).Direction = ParameterDirection.Output;

                sqlcmd.ExecuteNonQuery();

                BusinessEntityLayer.Retout = Convert.ToInt32(sqlcmd.Parameters["@Retout"].Value.ToString());

                strMessage = sqlcmd.Parameters["@Retout"].Value.ToString();
            }
            catch (Exception e)
            {
                BusinessEntityLayer.ErrorMessage = e.ToString();
            }
            finally
            {
                sqlcmd.Dispose();
                sqlcon.Close();
                sqlcon.Dispose();
            }
            return(strMessage);;
        }
Esempio n. 9
0
        public void bindgrid()
        {
            BusinessEntityLayer = new BEL();

            BusinessLogicLayer = new BLL();

            ds = new DataSet();

            if (lblproductid.Text != "")
            {
                BusinessEntityLayer.ID = Convert.ToInt32(lblproductid.Text);
            }
            else
            {
                BusinessEntityLayer.ID = 0;
            }

            ds = BusinessLogicLayer.DisplayInventory(BusinessEntityLayer);

            gvprodct.DataSource = ds.Tables[0];
            gvprodct.DataBind();

            if (ds.Tables[1].Rows.Count == 0)
            {
                ds.Tables[1].Rows.Add(ds.Tables[1].NewRow());
                gvProdInventory.DataSource = ds.Tables[1];
                gvProdInventory.DataBind();

                int columncount = gvProdInventory.Rows[0].Cells.Count;
                gvProdInventory.Rows[0].Cells.Clear();
                gvProdInventory.Rows[0].Cells.Add(new TableCell());
                gvProdInventory.Rows[0].Cells[0].ColumnSpan = columncount;
                gvProdInventory.Rows[0].Cells[0].Text       = " ";
            }
            else if (ds.Tables[1].Rows.Count > 0)
            {
                gvProdInventory.DataSource = ds.Tables[1];
                gvProdInventory.DataBind();
            }
        }
Esempio n. 10
0
        public string WarehouseInventory(BEL BusinessEntityLayer)
        {
            try
            {
                sqlcon = new SqlConnection(DatabaseCredientials);
                sqlcon.Open();

                sqlcmd             = new SqlCommand();
                sqlcmd.Connection  = sqlcon;
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.CommandText = "Sp_InsInventoryWarehouseDetails";
                sqlcmd.Parameters.Add("@WarehouseID", SqlDbType.Int).Value                  = BusinessEntityLayer.ID;
                sqlcmd.Parameters.Add("@WarehouseName", SqlDbType.VarChar, 255).Value       = BusinessEntityLayer.warehousename;
                sqlcmd.Parameters.Add("@Describtion", SqlDbType.VarChar, 255).Value         = BusinessEntityLayer.description;
                sqlcmd.Parameters.Add("@Address", SqlDbType.VarChar, 255).Value             = BusinessEntityLayer.Address;
                sqlcmd.Parameters.Add("@Telephone", SqlDbType.VarChar, 255).Value           = BusinessEntityLayer.telephone;
                sqlcmd.Parameters.Add("@CreatedOrModifiedBy", SqlDbType.VarChar, 255).Value = BusinessEntityLayer.CreatedBy;

                sqlcmd.Parameters.Add("@Retout", SqlDbType.Int).Direction = ParameterDirection.Output;

                sqlcmd.ExecuteNonQuery();

                BusinessEntityLayer.Retout = Convert.ToInt32(sqlcmd.Parameters["@Retout"].Value.ToString());

                strMessage = sqlcmd.Parameters["@Retout"].Value.ToString();
            }
            catch (Exception e)
            {
                BusinessEntityLayer.ErrorMessage = e.ToString();
            }
            finally
            {
                sqlcmd.Dispose();
                sqlcon.Close();
                sqlcon.Dispose();
            }
            return(strMessage);;
        }