Example #1
0
 public static INV_Iteam GetSTD_CampusByCampusID(int CampusID)
 {
     INV_Iteam iNV_Iteam = new INV_Iteam();
     SqlINV_IteamProvider sqlINV_IteamProvider = new SqlINV_IteamProvider();
     iNV_Iteam = sqlINV_IteamProvider.GetINV_IteamByCampusID(CampusID);
     return iNV_Iteam;
 }
Example #2
0
 public static INV_Iteam GetINV_IteamByIteamID(int IteamID)
 {
     INV_Iteam iNV_Iteam = new INV_Iteam();
     SqlINV_IteamProvider sqlINV_IteamProvider = new SqlINV_IteamProvider();
     iNV_Iteam = sqlINV_IteamProvider.GetINV_IteamByIteamID(IteamID);
     return iNV_Iteam;
 }
Example #3
0
 private void showINV_IteamData()
 {
     INV_Iteam iNV_Iteam = new INV_Iteam();
     iNV_Iteam = INV_IteamManager.GetINV_IteamByIteamID(Int32.Parse(Request.QueryString["ID"]));
     ddlCampusID.SelectedValue = iNV_Iteam.CampusID.ToString();
     txtIteamCode.Text = iNV_Iteam.IteamCode.ToString();
     txtDescription.Text = iNV_Iteam.Description.ToString();
     ddlIteamCategoryID.SelectedValue = iNV_Iteam.IteamCategoryID.ToString();
     ddlIteamCategoryID_SelectedIndexChanged(this, new EventArgs());
     ddlIteamSubCategoryID.SelectedValue = iNV_Iteam.IteamSubCategoryID.ToString();
     txtPrice.Text = iNV_Iteam.Price.ToString("N");
     txtQuantity.Text = iNV_Iteam.Quantity.ToString("N");
     txtUnit.Text = iNV_Iteam.Unit.ToString();
     string txtUpdatedBy_Text = iNV_Iteam.UpdatedBy.ToString();
     string txtUpdatedDate_Text = iNV_Iteam.UpdatedDate.ToString();
 }
Example #4
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            int SubCategory = 0;
            string categoryName = "";
            string SubCategoryName = "";

            if (txtCategory.Text != "")
            {
                INV_IteamCategory iNV_IteamCategory = new INV_IteamCategory();
                //	iNV_IteamCategory.IteamCategoryID=  int.Parse(ddlIteamCategoryID.SelectedValue);
                iNV_IteamCategory.IteamCategoryName = txtCategory.Text;
                iNV_IteamCategory.AddedBy = Profile.card_id;
                iNV_IteamCategory.AddedDate = DateTime.Now;
                iNV_IteamCategory.UpdatedBy = Profile.card_id;
                iNV_IteamCategory.UpdatedDate = DateTime.Now;
                int categoryID = INV_IteamCategoryManager.InsertINV_IteamCategory(iNV_IteamCategory);
                categoryName = txtCategory.Text;

                INV_IteamSubCategory iNV_IteamSubCategory = new INV_IteamSubCategory();
                //	iNV_IteamSubCategory.IteamSubCategoryID=  int.Parse(ddlIteamSubCategoryID.SelectedValue);
                iNV_IteamSubCategory.IteamSubCategoryName = txtSubCategory.Text;
                iNV_IteamSubCategory.IteamCategoryID = categoryID;
                iNV_IteamSubCategory.AddedBy = Profile.card_id;
                iNV_IteamSubCategory.AddedDate = DateTime.Now;
                iNV_IteamSubCategory.UpdatedBy = Profile.card_id;
                iNV_IteamSubCategory.UpdatedDate = DateTime.Now;
                SubCategory = INV_IteamSubCategoryManager.InsertINV_IteamSubCategory(iNV_IteamSubCategory);

                SubCategoryName = txtSubCategory.Text;
            }
            else if (txtSubCategory.Text != "")
            {
                INV_IteamSubCategory iNV_IteamSubCategory = new INV_IteamSubCategory();
                //	iNV_IteamSubCategory.IteamSubCategoryID=  int.Parse(ddlIteamSubCategoryID.SelectedValue);
                iNV_IteamSubCategory.IteamSubCategoryName = txtSubCategory.Text;
                iNV_IteamSubCategory.IteamCategoryID = int.Parse(ddlIteamCategoryID.SelectedValue);
                iNV_IteamSubCategory.AddedBy = Profile.card_id;
                iNV_IteamSubCategory.AddedDate = DateTime.Now;
                iNV_IteamSubCategory.UpdatedBy = Profile.card_id;
                iNV_IteamSubCategory.UpdatedDate = DateTime.Now;
                SubCategory = INV_IteamSubCategoryManager.InsertINV_IteamSubCategory(iNV_IteamSubCategory);

                categoryName = ddlIteamCategoryID.SelectedItem.Text;
                SubCategoryName = txtSubCategory.Text;
            }
            else
            {
                SubCategory = int.Parse(ddlIteamSubCategoryID.SelectedValue);
                categoryName = ddlIteamCategoryID.SelectedItem.Text;
                SubCategoryName = ddlIteamSubCategoryID.SelectedItem.Text;
            }

            string barcodes = categoryName + "  --->  " + SubCategoryName + "<br/><br/>" + "<table><tr>";
            int remaining = 5;
            for (int i = 0; i < int.Parse(txtNoOfItems.Text.Trim()); i++)
            {

                INV_Iteam iNV_Iteam = new INV_Iteam();
                //	iNV_Iteam.IteamID=  int.Parse(ddlIteamID.SelectedValue);
                iNV_Iteam.CampusID =  int.Parse(ddlCampusID.SelectedValue);
                iNV_Iteam.IteamCode = txtIteamCode.Text;
                iNV_Iteam.Description = txtDescription.Text;
                iNV_Iteam.IteamSubCategoryID = SubCategory;
                iNV_Iteam.Price = decimal.Parse(txtPrice.Text);
                iNV_Iteam.Quantity = decimal.Parse(txtQuantity.Text);
                iNV_Iteam.Unit = txtUnit.Text;
                iNV_Iteam.AddedBy = Profile.card_id;
                iNV_Iteam.AddedDate = DateTime.Now;
                iNV_Iteam.UpdatedBy = Profile.card_id;
                iNV_Iteam.UpdatedDate = DateTime.Now;
                int resutl = INV_IteamManager.InsertINV_Iteam(iNV_Iteam);

                if (i % 5 == 0)
                {
                    barcodes += "</tr><tr>";
                    remaining = 4;
                }
                else
                {
                    remaining--;
                }

                barcodes += "<td><div style='overflow:hidden;margin-left:-12px;width:157px; height:30px;margin-top: 28px;'><img style='margin-top:-30px' src='http://www.bcgen.com/demo/linear-dbgs.aspx?D=";
                barcodes+=resutl.ToString()+"'/></div></td>";
            }

            for (int i = 0; i < remaining; i++)
            {
                barcodes += "<td></td>";
            }
            barcodes += "</tr></table>";

            lblBarCode.Text = barcodes;

            ItemBarcode itemBarcode = new ItemBarcode();

            itemBarcode.SubCategoryID = SubCategory;
            itemBarcode.NoOfItem = Int32.Parse(txtNoOfItems.Text);
            itemBarcode.BarcodeText = barcodes;
            itemBarcode.AddedDate = DateTime.Now;
            int result = ItemBarcodeManager.InsertItemBarcode(itemBarcode);
        }
        catch (Exception ex) { }

        //Response.Redirect("AdminDisplayINV_Iteam.aspx");
    }
Example #5
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {

            INV_Iteam iNV_Iteam = new INV_Iteam();
            iNV_Iteam.IteamID = int.Parse(Request.QueryString["ID"].ToString());
            iNV_Iteam.CampusID =int.Parse(ddlCampusID.SelectedValue);
            iNV_Iteam.IteamCode = txtIteamCode.Text;
            iNV_Iteam.Description = txtDescription.Text;
            iNV_Iteam.IteamSubCategoryID = int.Parse(ddlIteamSubCategoryID.SelectedValue);
            iNV_Iteam.Price = decimal.Parse(txtPrice.Text);
            iNV_Iteam.Quantity = decimal.Parse(txtQuantity.Text);
            iNV_Iteam.Unit = txtUnit.Text;
            iNV_Iteam.AddedBy = Profile.card_id;
            iNV_Iteam.AddedDate = DateTime.Now;
            iNV_Iteam.UpdatedBy = Profile.card_id;
            iNV_Iteam.UpdatedDate = DateTime.Now;
            bool resutl = INV_IteamManager.UpdateINV_Iteam(iNV_Iteam);
        }
        catch (Exception ex) { } Response.Redirect("AdminDisplayINV_Iteam.aspx");
    }
Example #6
0
    public bool UpdateINV_Iteam(INV_Iteam iNV_Iteam)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateINV_Iteam", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@IteamID", SqlDbType.Int).Value = iNV_Iteam.IteamID;
            cmd.Parameters.Add("@CampusID", SqlDbType.Int).Value = iNV_Iteam.CampusID;
            cmd.Parameters.Add("@IteamCode", SqlDbType.NVarChar).Value = iNV_Iteam.IteamCode;
            cmd.Parameters.Add("@Description", SqlDbType.NVarChar).Value = iNV_Iteam.Description;
            cmd.Parameters.Add("@IteamSubCategoryID", SqlDbType.Int).Value = iNV_Iteam.IteamSubCategoryID;
            cmd.Parameters.Add("@Price", SqlDbType.Decimal).Value = iNV_Iteam.Price;
            cmd.Parameters.Add("@Quantity", SqlDbType.Decimal).Value = iNV_Iteam.Quantity;
            cmd.Parameters.Add("@Unit", SqlDbType.NVarChar).Value = iNV_Iteam.Unit;
            //cmd.Parameters.Add("@Unit", SqlDbType.NVarChar).Value = iNV_Iteam.Unit;
            //cmd.Parameters.Add("@Unit", SqlDbType.NVarChar).Value = iNV_Iteam.Unit;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = iNV_Iteam.UpdatedBy;
            cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = iNV_Iteam.UpdatedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Example #7
0
    public INV_Iteam GetINV_IteamFromReader(IDataReader reader)
    {
        try
        {
            INV_Iteam iNV_Iteam = new INV_Iteam
                (

                     DataAccessObject.IsNULL<int>(reader["IteamID"]),
                     DataAccessObject.IsNULL<int>(reader["CampusID"]),
                     DataAccessObject.IsNULL<string>(reader["IteamCode"]),
                     DataAccessObject.IsNULL<string>(reader["Description"]),
                     DataAccessObject.IsNULL<int>(reader["IteamSubCategoryID"]),
                     DataAccessObject.IsNULL<decimal>(reader["Price"]),
                     DataAccessObject.IsNULL<decimal>(reader["Quantity"]),
                     DataAccessObject.IsNULL<string>(reader["Unit"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["UpdatedDate"])
                );
            iNV_Iteam.IteamCategoryID = DataAccessObject.IsNULL<int>(reader["IteamCategoryID"]);
             return iNV_Iteam;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
Example #8
0
 public static int InsertINV_Iteam(INV_Iteam iNV_Iteam)
 {
     SqlINV_IteamProvider sqlINV_IteamProvider = new SqlINV_IteamProvider();
     return sqlINV_IteamProvider.InsertINV_Iteam(iNV_Iteam);
 }
Example #9
0
 public static bool UpdateINV_Iteam(INV_Iteam iNV_Iteam)
 {
     SqlINV_IteamProvider sqlINV_IteamProvider = new SqlINV_IteamProvider();
     return sqlINV_IteamProvider.UpdateINV_Iteam(iNV_Iteam);
 }