Ejemplo n.º 1
0
        private void loginButton_Click(object sender, EventArgs e)
        {
            beObj.userName = userNameTextBox.Text;
            beObj.password = passwordTextBox.Text;

            bool result = daObj.login(beObj);

            if (result == true)
            {
                BEL allInfo = new BEL();
                allInfo = daObj.getAll(beObj);

                if (allInfo != null)
                {
                    Form df = new Donation(allInfo);
                    df.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Unable to fetch user data !");
                }
            }
            else
            {
                MessageBox.Show("No Match Found !");
                userNameTextBox.Clear();
                passwordTextBox.Clear();
            }
        }
Ejemplo n.º 2
0
    public int addUpdateUsersDetails(BEL obj_d)
    {
        try
        {
            SqlParameter[] p = new SqlParameter[17];
            p[0]  = new SqlParameter("@ShipFname", obj_d.ShipFname);
            p[1]  = new SqlParameter("@ShipLname", obj_d.ShipLname);
            p[2]  = new SqlParameter("@ShipEmail", obj_d.ShipEmail);
            p[3]  = new SqlParameter("@ShipMobile", obj_d.ShipMobile);
            p[4]  = new SqlParameter("@ShipAddress", obj_d.ShipAddress);
            p[5]  = new SqlParameter("@ShipNearby", obj_d.ShipNearby);
            p[6]  = new SqlParameter("@ShipState", obj_d.ShipState);
            p[7]  = new SqlParameter("@ShipZip", obj_d.ShipZip);
            p[8]  = new SqlParameter("@BillFname", obj_d.BillFname);
            p[9]  = new SqlParameter("@BillLname", obj_d.BillLname);
            p[10] = new SqlParameter("@BillEmailid", obj_d.BillEmailid);
            p[11] = new SqlParameter("@BillContact", obj_d.BillContact);
            p[12] = new SqlParameter("@BillAddress", obj_d.BillAddress);
            p[13] = new SqlParameter("@BillNearby", obj_d.BillNearby);
            p[14] = new SqlParameter("@BillState", obj_d.BillState);
            p[15] = new SqlParameter("@BillZip", obj_d.BillZip);
            p[16] = new SqlParameter("@TransactionId", obj_d.TransId);

            return(MySqlDataAccess.ExecuteNonQuery(MySqlDataAccess.ConnectionString, CommandType.StoredProcedure, "ProaddUpdateUserDetails", p));
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Ejemplo n.º 3
0
        public Donation(BEL allInfo)
        {
            InitializeComponent();
            this.allInfo = allInfo;

            helloUserLabel.Text = "WELCOME " + this.allInfo.userName.ToUpper() + " !";

            activityLabel.Text = allInfo.activity.ToUpper();

            if (allInfo.activity == "inactive")
            {
                activityLabel.ForeColor    = Color.Red;
                activityChangingLabel.Text = "Change to ACTIVE";
            }
            else if (allInfo.activity == "active")
            {
                activityLabel.ForeColor    = Color.Green;
                activityChangingLabel.Text = "Change to INACTIVE";
            }

            if (allInfo.requested == "yes")
            {
                requestLabel.ForeColor = Color.Green;
            }
            else if (allInfo.requested == "no")
            {
                requestLabel.ForeColor = Color.Red;
            }
        }
Ejemplo n.º 4
0
        public BEL getAll(BEL obj)
        {
            cmd.Connection = con;
            con.Open();

            cmd.CommandType = CommandType.Text;

            cmd.CommandText = @"SELECT * from donor where user_name = '" + obj._userName + "'";


            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                if (obj._userName == reader.GetString(1))
                {
                    obj.userName   = reader.GetString(1);
                    obj.password   = reader.GetString(2);
                    obj.phone      = reader.GetString(3);
                    obj.bloodGroup = reader.GetString(4);
                    obj.address    = reader.GetString(5);
                    obj.activity   = reader.GetString(6);
                    obj.requested  = reader.GetString(7);

                    con.Close();
                    return(obj);
                }
            }


            con.Close();
            return(null);
        }
Ejemplo n.º 5
0
        public int userDetailsInsertMethod(BEL obj)
        {
            bool available = checkUserName(obj._userName);

            if (available == true)
            {
                cmd.Connection = con;
                con.Open();

                cmd.CommandType = CommandType.Text;

                cmd.CommandText = @"INSERT INTO donor(user_name,password,phone,blood_group,address,activity,requested) VALUES(@param1,@param2,@param3,@param4,@param5,@param6,@param7)";
                cmd.Parameters.AddWithValue("@param1", obj._userName);
                cmd.Parameters.AddWithValue("@param2", obj._password);
                cmd.Parameters.AddWithValue("@param3", obj._phone);
                cmd.Parameters.AddWithValue("@param4", obj._bloodGroup);
                cmd.Parameters.AddWithValue("@param5", obj._address);
                cmd.Parameters.AddWithValue("@param6", obj._activity);
                cmd.Parameters.AddWithValue("@param7", obj._requested);

                int result = cmd.ExecuteNonQuery();

                cmd.Parameters.Clear();
                con.Close();

                return(result);
            }


            return(-1);
        }
Ejemplo n.º 6
0
        public void bindgrid()
        {
            BusinessEntityLayer = new BEL();

            BusinessLogicLayer = new BLL();

            ds = new DataSet();

            ds = BusinessLogicLayer.DisplayInventory(BusinessEntityLayer);

            gvaddstock.DataSource = ds.Tables[5];
            gvaddstock.DataBind();

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

                int columncount = gvtransferstock.Rows[0].Cells.Count;
                gvtransferstock.Rows[0].Cells.Clear();
                gvtransferstock.Rows[0].Cells.Add(new TableCell());
                gvtransferstock.Rows[0].Cells[0].ColumnSpan = columncount;
                gvtransferstock.Rows[0].Cells[0].Text       = " ";
            }
            else if (ds.Tables[6].Rows.Count > 0)
            {
                gvtransferstock.DataSource = ds.Tables[6];
                gvtransferstock.DataBind();
            }
        }
Ejemplo n.º 7
0
        public DataTable savecustomerdetails(BEL objBELUserDetails)
        {
            SqlConnection con = new SqlConnection("data source=.;database=testdb;integrated security=SSPI");

            con.Open();
            SqlCommand cmd = new SqlCommand("savecustomerdetails", con);

            cmd.CommandType = CommandType.StoredProcedure;


            cmd.Parameters.AddWithValue("@customername", objBELUserDetails.customername);
            cmd.Parameters.AddWithValue("@customeremail", objBELUserDetails.customeremailid);
            cmd.Parameters.AddWithValue("@customerphoneno", objBELUserDetails.customerphoneno);

            cmd.Parameters.AddWithValue("@customeraddress", objBELUserDetails.customeraddress);
            cmd.Parameters.AddWithValue("@totalproducts", objBELUserDetails.totalproducts);
            cmd.Parameters.AddWithValue("@totalprice", objBELUserDetails.totalprice);
            cmd.Parameters.AddWithValue("@paymentmethod", objBELUserDetails.paymentmethod);

            int            Result = cmd.ExecuteNonQuery();
            DataTable      dtt    = new DataTable();
            SqlDataAdapter da     = new SqlDataAdapter("select @@IDENTITY as customerid from customerdetails", con);

            da.Fill(dtt);
            con.Close();
            return(dtt);
        }
Ejemplo n.º 8
0
        public DataTable getsetcustomerdetails(BEL objBELUserDetails)
        {
            SqlConnection con = new SqlConnection("data source=.;database=testdb;integrated security=SSPI");

            con.Open();
            //   SqlCommand cmd = new SqlCommand("orderstatus", con);
            // cmd.CommandType = CommandType.StoredProcedure;

            /*    cmd.Parameters.AddWithValue("@transactionno", objBELUserDetails._orderno);
             *  cmd.Parameters.AddWithValue("@orderstatus", objBELUserDetails._orderstatus);
             *  cmd.Parameters.AddWithValue("@flag", objBELUserDetails._flag);
             *
             */
            SqlDataAdapter da = new SqlDataAdapter("orderstatus", con);

            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@transactionno", objBELUserDetails._orderno);
            da.SelectCommand.Parameters.AddWithValue("@orderstatus", objBELUserDetails._orderstatus);
            da.SelectCommand.Parameters.AddWithValue("@flag", objBELUserDetails._flag);
            DataTable dt = new DataTable();

            da.Fill(dt);

            //   int Result = cmd.ExecuteNonQuery();
            // DataTable dtt = new DataTable();
            // SqlDataAdapter da = new SqlDataAdapter("select * from delieverystatus", con);
            // da.Fill(dtt);
            // con.Close();
            return(dt);
        }
        protected void addnew_category(object sender, EventArgs e)
        {
            BEL objUserBEL = new BEL();

            objUserBEL.Category_Name = TextBox1.Text;
            Class1 BLL = new Class1();

            BLL.InsertUserDetails(objUserBEL);
        }
Ejemplo n.º 10
0
    //Insert Order Details
    public int InsertProductDetails(BEL obj_d)
    {
        try
        {
            SqlParameter[] p = new SqlParameter[43];
            p[0]  = new SqlParameter("@ProductId", obj_d.ProductId);
            p[1]  = new SqlParameter("@TransId", obj_d.TransId);
            p[2]  = new SqlParameter("@Userid", obj_d.Userid);
            p[3]  = new SqlParameter("@ShipFname", obj_d.ShipFname);
            p[4]  = new SqlParameter("@ShipLname", obj_d.ShipLname);
            p[5]  = new SqlParameter("@ShipEmail", obj_d.ShipEmail);
            p[6]  = new SqlParameter("@ShipCompany", obj_d.ShipCompany);
            p[7]  = new SqlParameter("@ShipMobile", obj_d.ShipMobile);
            p[8]  = new SqlParameter("@ShipAddress", obj_d.ShipAddress);
            p[9]  = new SqlParameter("@ShipNearby", obj_d.ShipNearby);
            p[10] = new SqlParameter("@ShipCountry", obj_d.ShipCountry);
            p[11] = new SqlParameter("@ShipState", obj_d.ShipState);
            p[12] = new SqlParameter("@ShipCity", obj_d.ShipCity);
            p[13] = new SqlParameter("@ShipZip", obj_d.ShipZip);
            p[14] = new SqlParameter("@BillFname", obj_d.BillFname);
            p[15] = new SqlParameter("@BillLname", obj_d.BillLname);
            p[16] = new SqlParameter("@BillEmailid", obj_d.BillEmailid);
            p[17] = new SqlParameter("@BillCompay", obj_d.BillCompay);
            p[18] = new SqlParameter("@BillContact", obj_d.BillContact);
            p[19] = new SqlParameter("@BillAddress", obj_d.BillAddress);
            p[20] = new SqlParameter("@BillNearby", obj_d.BillNearby);
            p[21] = new SqlParameter("@BillCountry", obj_d.BillCountry);
            p[22] = new SqlParameter("@BillState", obj_d.BillState);
            p[23] = new SqlParameter("@BillCity", obj_d.BillCity);
            p[24] = new SqlParameter("@BillZip", obj_d.BillZip);
            p[25] = new SqlParameter("@Productname", obj_d.Productname);
            p[26] = new SqlParameter("@Quantity", obj_d.Quantity);
            p[27] = new SqlParameter("@Thumbnail", obj_d.Thumbnail);
            p[28] = new SqlParameter("@Orderdetailid", obj_d.Orderdetailid);
            p[29] = new SqlParameter("@Currency", obj_d.Currency);
            p[30] = new SqlParameter("@Paymentmode", obj_d.Paymentmode);
            p[31] = new SqlParameter("@ItemSubTotal", obj_d.ItemSubtotal);
            p[32] = new SqlParameter("@ShippingCharge", obj_d.ShippinCharge);
            p[33] = new SqlParameter("@ItemPrice", obj_d.ItemPrice);
            p[34] = new SqlParameter("@Orderstatus", obj_d.Orderstatus);
            p[35] = new SqlParameter("@OrderCancel", obj_d.OrderCancel);
            p[36] = new SqlParameter("@Useridentifyno", obj_d.UserIdetifyNo);
            p[37] = new SqlParameter("@Capacity", obj_d.Capacity);
            p[38] = new SqlParameter("@Flavour", obj_d.Flavour);

            p[39] = new SqlParameter("@VariantName", obj_d.Variantname);
            p[40] = new SqlParameter("@VariantQuantity", obj_d.Variantquantity);
            p[41] = new SqlParameter("@CouponPrice", obj_d.finalCouponPrice);
            p[42] = new SqlParameter("@FinalShippingCharges", obj_d.FinalShippingCharges);

            return(MySqlDataAccess.ExecuteNonQuery(MySqlDataAccess.ConnectionString, CommandType.StoredProcedure, "ProAddOrderDetails", p));
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Ejemplo n.º 11
0
        public Profile(BEL obj)
        {
            InitializeComponent();

            if (obj != null)
            {
                userNameLabel.Text   = obj.userName;
                phoneLabel.Text      = obj.phone;
                bloodGroupLabel.Text = obj.bloodGroup;
                addressLabel.Text    = obj.address;
            }
        }
Ejemplo n.º 12
0
        protected void btnclientsaveclose_Click(object sender, EventArgs e)
        {
            BusinessEntityLayer = new BEL();

            BusinessLogicLayer = new BLL();

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

            BusinessEntityLayer.CLientName = txtclientname.Text;

            BusinessEntityLayer.contactperson = txtContactperson.Text;

            BusinessEntityLayer.contactno = txtContactNo.Text;

            BusinessEntityLayer.Address = txtClientAddress.Text;

            BusinessEntityLayer.EmailID = txtemailid.Text;

            if (chkCustomer.Checked == true)
            {
                BusinessEntityLayer.IsCustomer = 1;
                BusinessEntityLayer.IsVendor   = 0;
            }
            else if (chkIsVendor.Checked == true)
            {
                BusinessEntityLayer.IsCustomer = 0;
                BusinessEntityLayer.IsVendor   = 1;
            }

            BusinessEntityLayer.CreatedBy = "Pankaj Sapkal";

            BusinessLogicLayer.InsertClientInventory(BusinessEntityLayer);

            if (BusinessEntityLayer.Retout == 1)
            {
                ShowMessage("Successfully Inserted Your Transaction");
                ControlState();
                bindgrid();
            }
            else
            {
                ShowMessage("Error while Inserting product Name" + BusinessEntityLayer.ErrorMessage);
            }
        }
Ejemplo n.º 13
0
        public int InsertUserInformation(BEL objBELUserDetails)
        {
            SqlConnection con = new SqlConnection("data source=.;database=testdb;integrated security=SSPI");

            con.Open();
            SqlCommand cmd = new SqlCommand("sp_userinformation", con);

            cmd.CommandType = CommandType.StoredProcedure;


            cmd.Parameters.AddWithValue("@category", objBELUserDetails.Category_Name);
            int Result = cmd.ExecuteNonQuery();

            return(Result);
        }
        public void GetSetOrderStatus(int flag)
        {
            BEL k = new BEL();

            k._orderstatus = TextBox2.Text;
            k._orderno     = Convert.ToInt32(TextBox1.Text);
            k._flag        = flag;

            DAL       BLL      = new DAL();
            DataTable dtResult = BLL.getsetcustomerdetails(k);

            GridView1.DataSource = dtResult;
            GridView1.DataBind();
            TextBox2.Text = string.Empty;
        }
Ejemplo n.º 15
0
 public int DeductMoney(BEL obj_data)
 {
     try
     {
         return(ob_wal.DeductWalletMoney(obj_data));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
         ob_wal = null;
     }
 }
Ejemplo n.º 16
0
 public int AddOrderDetails(BEL obj_d)
 {
     try
     {
         return(obj_cart.InsertProductDetails(obj_d));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
         obj_cart = null;
     }
 }
Ejemplo n.º 17
0
 public int AddUpdateUserDetails(BEL obj_d)
 {
     try
     {
         return(obj_cart.addUpdateUsersDetails(obj_d));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
         obj_cart = null;
     }
 }
 /* protected void Button2_Click(object sender, EventArgs e)
  * {
  *   if(FileUpload1.HasFile)
  *   {
  *       string filextension = System.IO.Path.GetExtension(FileUpload1.FileName);
  *       if(filextension.ToLower()==".jpeg" || filextension.ToLower() == ".png" )
  *       {
  *           FileUpload1.SaveAs(Server.MapPath("~/images/" + FileUpload1.FileName));
  *       }
  *   }
  * }
  */
 protected void addnew_product(object sender, EventArgs e)
 {
     if (FileUpload1.PostedFile != null)
     {
         saveproductsphoto();
         BEL objUserBEL = new BEL();
         objUserBEL.productname     = TextBox1.Text;
         objUserBEL.Categoryid      = Convert.ToInt32(DropDownList1.SelectedValue);
         objUserBEL.description     = TextBox2.Text;
         objUserBEL.productimage    = "~/images/" + FileUpload1.FileName;
         objUserBEL.price           = TextBox3.Text;
         objUserBEL.productquantity = Convert.ToInt32(TextBox4.Text);
         Class1 BLL = new Class1();
         BLL.addproducts(objUserBEL);
     }
 }
Ejemplo n.º 19
0
        public void updateproducts(BEL objBELUserDetails)
        {
            SqlConnection con = new SqlConnection("data source=.;database=testdb;integrated security=SSPI");

            con.Open();
            SqlCommand cmd = new SqlCommand("sp_updateproducts", con);

            cmd.CommandType = CommandType.StoredProcedure;



            cmd.Parameters.AddWithValue("@productid", objBELUserDetails._productid);
            cmd.Parameters.AddWithValue("@productquantity", objBELUserDetails._totalproducts);

            cmd.ExecuteNonQuery();
        }
Ejemplo n.º 20
0
        public void bindgrid()
        {
            BusinessEntityLayer = new BEL();

            BusinessLogicLayer = new BLL();

            ds = new DataSet();

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

            ds = BusinessLogicLayer.DisplayInventory(BusinessEntityLayer);

            if (p == "List All Vendors")
            {
                gvclientvendor.DataSource = ds.Tables[3];
                gvclientvendor.DataBind();
            }
            else if (p == "List All Customers")
            {
                gvclientvendor.DataSource = ds.Tables[4];
                gvclientvendor.DataBind();
            }
            if (ds.Tables[8].Rows.Count == 0)
            {
                ds.Tables[8].Rows.Add(ds.Tables[8].NewRow());
                gvclientvendorInventory.DataSource = ds.Tables[8];
                gvclientvendorInventory.DataBind();

                int columncount = gvclientvendorInventory.Rows[0].Cells.Count;
                gvclientvendorInventory.Rows[0].Cells.Clear();
                gvclientvendorInventory.Rows[0].Cells.Add(new TableCell());
                gvclientvendorInventory.Rows[0].Cells[0].ColumnSpan = columncount;
                gvclientvendorInventory.Rows[0].Cells[0].Text       = " ";
            }
            else if (ds.Tables[8].Rows.Count > 0)
            {
                gvclientvendorInventory.DataSource = ds.Tables[8];
                gvclientvendorInventory.DataBind();
            }
        }
        protected void place_order(object sender, EventArgs e)
        {
            //submit customer form
            string    productids = string.Empty;
            DataTable dt;

            if (Session["mycart"] != null)
            {
                dt = (DataTable)Session["mycart"];
                BEL k = new BEL();

                k._customername    = TextBox22.Text.ToString();
                k._customeremailid = TextBox44.Text.ToString();
                k._customeraddress = TextBox55.Text.ToString();
                k._customerphoneno = TextBox33.Text.ToString();
                k._totalproducts   = Convert.ToInt32(txttotalproduct.Text);
                k._totalprice      = Convert.ToInt32(txttotalpric.Text);
                //k._productlist = productids;
                k._paymentmethod = RadioButtonList1.SelectedItem.Text;

                DAL       BLL      = new DAL();
                DataTable dtResult = BLL.savecustomerdetails(k);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    BEL saveproducts = new BEL();


                    saveproducts._customerid    = Convert.ToInt32(dtResult.Rows[0][0]);
                    saveproducts._productid     = Convert.ToInt32(dt.Rows[i]["productid"]);
                    saveproducts._totalproducts = Convert.ToInt32(dt.Rows[i]["productquantity"]);

                    DAL kk = new DAL();
                    kk.savecustomerproducts(saveproducts);
                    kk.updateproducts(saveproducts);

                    //  SendOrderPlacedAlert(TextBox22.Text, TextBox44.Text, Convert.ToString(dtResult.Rows[0][0]));
                    pnlemptycart.Visible        = false;
                    pnlmycart.Visible           = false;
                    Panel1.Visible              = false;
                    pnlproducts.Visible         = false;
                    pnlcategories.Visible       = false;
                    pnlordersuccessfull.Visible = true;
                    Session.Clear();
                }
            }
        }
Ejemplo n.º 22
0
        public int addproducts(BEL objUserDetails)
        {
            DAL objUserDAL = new DAL();

            try
            {
                return(objUserDAL.Insertproducts(objUserDetails));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objUserDAL = null;
            }
        }
Ejemplo n.º 23
0
        public int InsertUserDetails(BEL objUserDetails)
        {
            DAL objUserDAL = new DAL();

            try
            {
                return(objUserDAL.InsertUserInformation(objUserDetails));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objUserDAL = null;
            }
        }
Ejemplo n.º 24
0
        protected void btnTransferstock_Click(object sender, EventArgs e)
        {
            BusinessEntityLayer = new BEL();
            BusinessLogicLayer  = new BLL();

            ds = new DataSet();

            BusinessEntityLayer.ID = Convert.ToInt32(txttransactQuantity.Text);

            ds = BusinessLogicLayer.DisplayInventory(BusinessEntityLayer);

            if (BusinessEntityLayer.Retout == 1)
            {
                BusinessEntityLayer.TransDetails    = txttransactiondetails.Text;
                BusinessEntityLayer.TransType       = drptransactionType.SelectedItem.Value;
                BusinessEntityLayer.Comments        = txtRemark.Text;
                BusinessEntityLayer.CLientName      = drpclientname.SelectedItem.Value;
                BusinessEntityLayer.productname     = drpprdctname.SelectedItem.Value;
                BusinessEntityLayer.warehousename   = drpwarehousename.SelectedItem.Value;
                BusinessEntityLayer.Towarehousename = drpWarehouseNameTO.SelectedItem.Value;
                BusinessEntityLayer.NewQuantity     = Convert.ToDecimal(txttransactQuantity.Text);
                BusinessEntityLayer.CreatedBy       = "Pankaj Sapkal";

                BusinessLogicLayer.TransferAddStock(BusinessEntityLayer);

                if (BusinessEntityLayer.Retout == 1)
                {
                    ShowMessage("Successfully Transfer Your Transaction");
                    //ControlState();
                    bindgrid();
                }
                else
                {
                    ShowMessage("Error while Transferring" + BusinessEntityLayer.ErrorMessage);
                }
            }
            else
            {
                ShowMessage("The stock is not available, please add stock for particular product");
            }
        }
Ejemplo n.º 25
0
        public int Insertproducts(BEL objBELUserDetails)
        {
            SqlConnection con = new SqlConnection("data source=.;database=testdb;integrated security=SSPI");

            con.Open();
            SqlCommand cmd = new SqlCommand("addnewproducts", con);

            cmd.CommandType = CommandType.StoredProcedure;


            cmd.Parameters.AddWithValue("@productname", objBELUserDetails.productname);
            cmd.Parameters.AddWithValue("@productimage", objBELUserDetails.productimage);

            cmd.Parameters.AddWithValue("@productprice", objBELUserDetails.price);
            cmd.Parameters.AddWithValue("@productdescription", objBELUserDetails.description);
            cmd.Parameters.AddWithValue("@categoryid", objBELUserDetails.Categoryid);
            cmd.Parameters.AddWithValue("@productquantity", objBELUserDetails.productquantity);
            int Result = cmd.ExecuteNonQuery();

            return(Result);
        }
Ejemplo n.º 26
0
        public void bindgrid()
        {
            BusinessEntityLayer = new BEL();

            BusinessLogicLayer = new BLL();

            ds = new DataSet();

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

            ds = BusinessLogicLayer.DisplayInventory(BusinessEntityLayer);

            gvwarehouse.DataSource = ds.Tables[2];
            gvwarehouse.DataBind();

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

                int columncount = gvwarehouseInventory.Rows[0].Cells.Count;
                gvwarehouseInventory.Rows[0].Cells.Clear();
                gvwarehouseInventory.Rows[0].Cells.Add(new TableCell());
                gvwarehouseInventory.Rows[0].Cells[0].ColumnSpan = columncount;
                gvwarehouseInventory.Rows[0].Cells[0].Text       = " ";
            }
            else if (ds.Tables[1].Rows.Count > 0)
            {
                gvwarehouseInventory.DataSource = ds.Tables[1];
                gvwarehouseInventory.DataBind();
            }
        }
Ejemplo n.º 27
0
        protected void deleteStock_Click(object sender, EventArgs e)
        {
            BusinessEntityLayer = new BEL();
            BusinessLogicLayer  = new BLL();

            ImageButton bindtextbox = sender as ImageButton;

            GridViewRow gvrow = (GridViewRow)bindtextbox.NamingContainer;

            string ID = gvaddstock.DataKeys[gvrow.RowIndex].Value.ToString();

            BusinessEntityLayer.ID = Convert.ToInt32(ID);

            BusinessEntityLayer.TransDetails = "Removic stock details from " + BusinessEntityLayer.warehousename;

            BusinessEntityLayer.productname = txtproduct.Text = gvrow.Cells[1].Text;

            BusinessEntityLayer.warehousename = txtWarehouse.Text = gvrow.Cells[2].Text;

            txtCostvalue.Text        = gvrow.Cells[3].Text;
            BusinessEntityLayer.Cost = Convert.ToDecimal(txtCostvalue.Text);

            txtQuantity.Text = gvrow.Cells[4].Text;
            BusinessEntityLayer.NewQuantity = Convert.ToDecimal(txtQuantity.Text);
            BusinessEntityLayer.CreatedBy   = "Pankaj Sapkal";

            BusinessLogicLayer.RemoveAddStock(BusinessEntityLayer);

            if (BusinessEntityLayer.Retout == 1)
            {
                ShowMessage("Successfully Deleted Your Transaction");
                //ControlState();
                bindgrid();
            }
            else
            {
                ShowMessage("Error while Deleting" + BusinessEntityLayer.ErrorMessage);
            }
        }
Ejemplo n.º 28
0
        protected override void DoCommandAction()
        {
            if (IdentifierManager.Instance.IsMatch(Location, IdentifierManager.RegexTypes.CLB))
            {
                Tile where = FPGA.FPGA.Instance.GetTile(Location);

                if (SliceNumber >= where.Slices.Count)
                {
                    throw new ArgumentException("Slice index exceeded on " + where);
                }

                string constraint = "";
                if (FPGA.FPGA.Instance.BackendType == FPGATypes.BackendType.ISE)
                {
                    OutputManager.WriteUCFOutput("INST \"" + InstanceName + "\" LOC = \"" + where.Slices[SliceNumber] + "\"; # generated_by_GoAhead");
                }
                else if (FPGA.FPGA.Instance.BackendType == FPGATypes.BackendType.Vivado)
                {
                    // place_cell inst_PartialSubsystem/inst_3 SLICE_X6Y66/C6LUT
                    OutputManager.WriteUCFOutput("place_cell " + InstanceName + " " + where.Slices[SliceNumber] + "/" + BEL + "; # generated_by_GoAhead");
                    // LOCK_PINS can only be applied to LUTs, for UltraScale we used FlipFops as well
                    if (BEL.EndsWith("LUT"))
                    {
                        OutputManager.WriteUCFOutput("set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4 I4:A5 I5:A6} [get_cells " + InstanceName + "]; # generated_by_GoAhead");
                    }
                    OutputManager.WriteUCFOutput("set_property DONT_TOUCH TRUE [get_cells " + InstanceName + "]; # generated_by_GoAhead");

                    /*
                     * // set_property LOC SLICE_X33Y15 [get_cells My_LUT6_inst]
                     * this.OutputManager.WriteUCFOutput("set_property LOC " + where.Slices[this.SliceNumber] + " [get_cells " + this.InstanceName + "]; # generated_by_GoAhead");
                     * // set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4} [get_cells inst_PartialSubsystem/inst_0]
                     * this.OutputManager.WriteUCFOutput("set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4 I4:A5 I5:A6} [get_cells " + this.InstanceName + "]; # generated_by_GoAhead");
                     * */
                }

                // promt ucf to text box
                OutputManager.WriteUCFOutput(constraint);
            }
        }
Ejemplo n.º 29
0
        protected void btnwaresaveclose_Click(object sender, EventArgs e)
        {
            BusinessEntityLayer = new BEL();

            BusinessLogicLayer = new BLL();

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

            BusinessEntityLayer.warehousename = txtwarehousename.Text;

            BusinessEntityLayer.description = txtwarehousedescription.Text;

            BusinessEntityLayer.Address = txtwarehouseAddress.Text;

            BusinessEntityLayer.telephone = txttelephonnumber.Text;

            BusinessEntityLayer.CreatedBy = "Pankaj Sapkal";

            BusinessLogicLayer.InsertWarehouseInventory(BusinessEntityLayer);

            if (BusinessEntityLayer.Retout == 1)
            {
                ShowMessage("Successfully Inserted Your Transaction");
                ControlState();
                bindgrid();
            }
            else
            {
                ShowMessage("Error while Inserting product Name" + BusinessEntityLayer.ErrorMessage);
            }
        }
Ejemplo n.º 30
0
        public bool login(BEL obj)
        {
            cmd.Connection = con;
            con.Open();

            cmd.CommandType = CommandType.Text;

            cmd.CommandText = @"SELECT user_name,password from donor";

            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                if (obj._userName == reader.GetString(0) && obj._password == reader.GetString(1))
                {
                    con.Close();
                    return(true);
                }
            }


            con.Close();
            return(false);
        }