public static INV_IteamSubCategory GetINV_IteamSubCategoryByIteamSubCategoryID(int IteamSubCategoryID) { INV_IteamSubCategory iNV_IteamSubCategory = new INV_IteamSubCategory(); SqlINV_IteamSubCategoryProvider sqlINV_IteamSubCategoryProvider = new SqlINV_IteamSubCategoryProvider(); iNV_IteamSubCategory = sqlINV_IteamSubCategoryProvider.GetINV_IteamSubCategoryByIteamSubCategoryID(IteamSubCategoryID); return iNV_IteamSubCategory; }
private void showINV_IteamSubCategoryData() { INV_IteamSubCategory iNV_IteamSubCategory = new INV_IteamSubCategory (); iNV_IteamSubCategory = INV_IteamSubCategoryManager.GetINV_IteamSubCategoryByIteamSubCategoryID(Int32.Parse(Request.QueryString["ID"])); txtIteamSubCategoryName.Text =iNV_IteamSubCategory.IteamSubCategoryName.ToString(); ddlIteamCategoryID.SelectedValue =iNV_IteamSubCategory.IteamCategoryID.ToString(); string txtUpdatedBy_Text =iNV_IteamSubCategory.UpdatedBy.ToString(); string txtUpdatedDate_Text =iNV_IteamSubCategory.UpdatedDate.ToString(); }
protected void btnUpdate_Click(object sender, EventArgs e) { try { INV_IteamSubCategory iNV_IteamSubCategory = new INV_IteamSubCategory (); iNV_IteamSubCategory.IteamSubCategoryID= int.Parse(Request.QueryString["ID"].ToString()); iNV_IteamSubCategory.IteamSubCategoryName= txtIteamSubCategoryName.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; bool resutl =INV_IteamSubCategoryManager.UpdateINV_IteamSubCategory(iNV_IteamSubCategory); }catch(Exception ex){}Response.Redirect("AdminDisplayINV_IteamSubCategory.aspx"); }
protected void btnAdd_Click(object sender, EventArgs e) { try { INV_IteamSubCategory iNV_IteamSubCategory = new INV_IteamSubCategory (); // iNV_IteamSubCategory.IteamSubCategoryID= int.Parse(ddlIteamSubCategoryID.SelectedValue); iNV_IteamSubCategory.IteamSubCategoryName= txtIteamSubCategoryName.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; int resutl =INV_IteamSubCategoryManager.InsertINV_IteamSubCategory(iNV_IteamSubCategory); }catch(Exception ex){}Response.Redirect("AdminDisplayINV_IteamSubCategory.aspx"); }
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"); }
public static int InsertINV_IteamSubCategory(INV_IteamSubCategory iNV_IteamSubCategory) { SqlINV_IteamSubCategoryProvider sqlINV_IteamSubCategoryProvider = new SqlINV_IteamSubCategoryProvider(); return sqlINV_IteamSubCategoryProvider.InsertINV_IteamSubCategory(iNV_IteamSubCategory); }
public static bool UpdateINV_IteamSubCategory(INV_IteamSubCategory iNV_IteamSubCategory) { SqlINV_IteamSubCategoryProvider sqlINV_IteamSubCategoryProvider = new SqlINV_IteamSubCategoryProvider(); return sqlINV_IteamSubCategoryProvider.UpdateINV_IteamSubCategory(iNV_IteamSubCategory); }
public bool UpdateINV_IteamSubCategory(INV_IteamSubCategory iNV_IteamSubCategory) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("UpdateINV_IteamSubCategory", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@IteamSubCategoryID", SqlDbType.Int).Value = iNV_IteamSubCategory.IteamSubCategoryID; cmd.Parameters.Add("@IteamSubCategoryName", SqlDbType.NVarChar).Value = iNV_IteamSubCategory.IteamSubCategoryName; cmd.Parameters.Add("@IteamCategoryID", SqlDbType.Int).Value = iNV_IteamSubCategory.IteamCategoryID; //cmd.Parameters.Add("@IteamCategoryID", SqlDbType.Int).Value = iNV_IteamSubCategory.IteamCategoryID; //cmd.Parameters.Add("@IteamCategoryID", SqlDbType.Int).Value = iNV_IteamSubCategory.IteamCategoryID; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = iNV_IteamSubCategory.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = iNV_IteamSubCategory.UpdatedDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public int InsertINV_IteamSubCategory(INV_IteamSubCategory iNV_IteamSubCategory) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("InsertINV_IteamSubCategory", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@IteamSubCategoryID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@IteamSubCategoryName", SqlDbType.NVarChar).Value = iNV_IteamSubCategory.IteamSubCategoryName; cmd.Parameters.Add("@IteamCategoryID", SqlDbType.Int).Value = iNV_IteamSubCategory.IteamCategoryID; cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = iNV_IteamSubCategory.AddedBy; cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = iNV_IteamSubCategory.AddedDate; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = iNV_IteamSubCategory.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = iNV_IteamSubCategory.UpdatedDate; connection.Open(); int result = cmd.ExecuteNonQuery(); return (int)cmd.Parameters["@IteamSubCategoryID"].Value; } }
public INV_IteamSubCategory GetINV_IteamSubCategoryFromReader(IDataReader reader) { try { INV_IteamSubCategory iNV_IteamSubCategory = new INV_IteamSubCategory ( DataAccessObject.IsNULL<int>(reader["IteamSubCategoryID"]), DataAccessObject.IsNULL<string>(reader["IteamSubCategoryName"]), DataAccessObject.IsNULL<int>(reader["IteamCategoryID"]), DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]), DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["UpdatedDate"]) ); return iNV_IteamSubCategory; } catch(Exception ex) { return null; } }