/// <summary> /// used get product wise batchID /// </summary> /// <param name="productID"></param> /// <returns></returns> public IList <BO.ProductBatch> GetProductIDWiseProductBactchList(int productID) { try { querry = @"Select ProductBatch.BatchID,ProductBatch.BatchNo from ProductBatch where dbo.ProductBatch.ProductID = " + productID + " and ProductBatch.IsActive = 1 "; DataTable dt = ExecuteQuerry(querry).Tables[0]; List <POS.BO.ProductBatch> objList = new List <POS.BO.ProductBatch>(); POS.BO.ProductBatch obj = null; foreach (DataRow row in dt.Rows) { obj = new BO.ProductBatch(); obj.BatchID = Convert.ToInt32(row["BatchID"]); obj.BatchNo = row["BatchNo"].ToString(); objList.Add(obj); } return(objList); } catch (Exception ex) { throw ex; } }
public BO.ProductBatch GetProductBatchByID(long BatchID) { try { querry = @"Select ProductBatch.BatchID,ProductBatch.BatchNo,ProductCode, ProductBatch.ProductID ,Product.ProductName from ProductBatch inner join dbo.Product on dbo.Product.ProductId = dbo.ProductBatch.ProductID where ProductBatch.IsActive = 1 and BatchID= " + BatchID + " "; DataTable dt = ExecuteQuerry(querry).Tables[0]; List <POS.BO.ProductBatch> objList = new List <POS.BO.ProductBatch>(); POS.BO.ProductBatch obj = null; foreach (DataRow row in dt.Rows) { obj = new BO.ProductBatch(); obj.BatchID = Convert.ToInt32(row["BatchID"]); obj.BatchNo = row["BatchNo"].ToString(); obj.ProductName = row["ProductName"].ToString(); obj.ProductCode = row["ProductCode"].ToString(); obj.ProductID = Convert.ToInt64(row["ProductID"].ToString()); } return(obj); } catch (Exception ex) { throw ex; } }
public IList <POS.BO.ProductBatch> GetProductBatchList() { try { SqlConnection con = CreateCon(); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand(); da.SelectCommand.CommandText = "[POS_SP_GET_GETProductBatch]"; da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Connection = con; if (con.State == ConnectionState.Closed) { con.Open(); } DataSet ds = new DataSet(); da.Fill(ds); if (con.State == ConnectionState.Open) { con.Close(); } DataTable dt = ds.Tables[0]; List <POS.BO.ProductBatch> objDoctorList = new List <POS.BO.ProductBatch>(); POS.BO.ProductBatch obj = null; int index = 1; foreach (DataRow row in dt.Rows) { obj = new BO.ProductBatch(); obj.Sln = index++; obj.BatchID = Convert.ToInt32(row["BatchID"]); obj.BatchName = row["BatchName"].ToString(); obj.BatchNo = row["BatchCode"].ToString(); obj.BatchDescription = row["Description"].ToString(); // obj.ProductName = row["ProductName"].ToString(); // obj.ProductID = Convert.ToInt64(row["ProductID"].ToString()); objDoctorList.Add(obj); } return(objDoctorList); } catch (Exception ex) { throw ex; } }
public int Update(BO.ProductBatch objProductBatch) { try { int returnStatus = 0; SqlConnection con = CreateCon(); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand(); da.SelectCommand.CommandText = "[POS_SP_Update_SET_ProductBatch]"; da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Connection = con; //"@BatchCode" Store Procedure da.SelectCommand.Parameters.Add("@BatchCode", System.Data.SqlDbType.VarChar, 500).Value = objProductBatch.BatchNo; da.SelectCommand.Parameters.Add("@BatchID", System.Data.SqlDbType.BigInt).Value = objProductBatch.BatchID; da.SelectCommand.Parameters.Add("@BatchName", System.Data.SqlDbType.VarChar, 500).Value = objProductBatch.BatchName; da.SelectCommand.Parameters.Add("@Description", System.Data.SqlDbType.VarChar, 500).Value = objProductBatch.BatchDescription; if (con.State == ConnectionState.Closed) { con.Open(); } if (da.SelectCommand.ExecuteNonQuery() == 1) { returnStatus = 1; } else { returnStatus = 0; } if (con.State == ConnectionState.Open) { con.Close(); } return(returnStatus); } catch (Exception ex) { throw ex; } }
public IList <BO.ProductBatch> GetProductBatchByObject(BO.ProductBatch objProductBatch, int pageIndex, int pageSize, string orderBy, string sortindex) { return(_iProductBatch.GetProductBatchByObject(objProductBatch, pageIndex, pageSize, orderBy, sortindex)); }
public int Update(BO.ProductBatch objProductBatch, long ProductID) { return(_iProductBatch.Update(objProductBatch, ProductID)); }
public int Update(BO.ProductBatch objProductBatch) { return(_iProductBatch.Update(objProductBatch)); }
public int Insert(BO.ProductBatch objProductBatch) { return(_iProductBatch.Insert(objProductBatch)); }
public IList <BO.ProductBatch> GetProductBatchByObject(BO.ProductBatch objProductBatch, int pageIndex, int pageSize, string orderBy, string sortindex) { return(new List <POS.BO.ProductBatch>()); }