public List<Customer> getCusByMultiFilter(CusSearchTerm filter) { List<Customer> cusList; UtilService utilService = new UtilService(); Hashtable hashTable = new Hashtable(); if (!(filter.CustomerName == null || filter.CustomerName.Equals(""))) { hashTable.Add("@CusName", utilService.buildWildSearchFilter(filter.CustomerName)); } if (!(filter.CompanyName == null || filter.CompanyName.Equals(""))) { hashTable.Add("@CusCompName", utilService.buildWildSearchFilter(filter.CompanyName)); } if (!(filter.TelNum == null || filter.TelNum.Equals(""))) { hashTable.Add("@TelNum", utilService.buildWildSearchFilter(filter.TelNum)); } if (!(filter.CusTypeID == null || filter.CusTypeID.Equals(""))) { hashTable.Add("@CusTypeID", filter.CusTypeID); } try { cusList = cusDAO.searchCusByMultiFilter(hashTable); } catch (Exception ex) { cusList = null; } return cusList; }
public static ArrayList GetEmpMultiFilterParams(ref string sqlStr, Hashtable hashTable, DBUtil dbUtil) { ArrayList listParms = new ArrayList(); UtilService utilService = new UtilService(); if (hashTable.Contains("@EmpName")) { sqlStr = utilService.validSearchFilter(sqlStr, "@EmpName"); listParms.Add(new SqlParameter("@EmpName", SqlDbType.NVarChar, 40)); } if (hashTable.Contains("@IdCard")) { sqlStr = utilService.validSearchFilter(sqlStr, "@IdCard"); listParms.Add(new SqlParameter("@IdCard", SqlDbType.VarChar, 20)); } if (hashTable.Contains("@DeptID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@DeptID"); listParms.Add(new SqlParameter("@DeptID", SqlDbType.VarChar, 800)); } if (hashTable.Contains("@EmpTypeID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@EmpTypeID"); listParms.Add(new SqlParameter("@EmpTypeID", SqlDbType.VarChar, 800)); } if (hashTable.Contains("@StatusKBN")) { sqlStr = utilService.validSearchFilter(sqlStr, "@StatusKBN"); listParms.Add(new SqlParameter("@StatusKBN", SqlDbType.VarChar, 800)); } if (hashTable.Contains("@EntryTimeStart")) { sqlStr = utilService.validSearchFilter(sqlStr, "@EntryTimeStart"); listParms.Add(new SqlParameter("@EntryTimeStart", SqlDbType.DateTime)); } if (hashTable.Contains("@EntryTimeEnd")) { sqlStr = utilService.validSearchFilter(sqlStr, "@EntryTimeEnd"); listParms.Add(new SqlParameter("@EntryTimeEnd", SqlDbType.DateTime)); } if (hashTable.Contains("@LeaveTimeStart")) { sqlStr = utilService.validSearchFilter(sqlStr, "@LeaveTimeStart"); listParms.Add(new SqlParameter("@LeaveTimeStart", SqlDbType.DateTime)); } if (hashTable.Contains("@LeaveTimeEnd")) { sqlStr = utilService.validSearchFilter(sqlStr, "@LeaveTimeEnd"); listParms.Add(new SqlParameter("@LeaveTimeEnd", SqlDbType.DateTime)); } return listParms; }
public static Hashtable EmpMultiFilterToHashTable(EmpSearchTerm filter) { UtilService utilService = new UtilService(); Hashtable hashTable = new Hashtable(); if (!(filter.EmpName == null || filter.EmpName.Equals(""))) { hashTable.Add("@EmpName", utilService.buildWildSearchFilter(filter.EmpName)); } if (!(filter.IdCard == null || filter.IdCard.Equals(""))) { hashTable.Add("@IdCard", utilService.buildWildSearchFilter(filter.IdCard)); } if (!(filter.MultiEmpTypeId == null || filter.MultiEmpTypeId.Equals(""))) { hashTable.Add("@EmpTypeID", filter.MultiEmpTypeId); } if (!(filter.MultiDeptId == null || filter.MultiDeptId.Equals(""))) { hashTable.Add("@DeptID", filter.MultiDeptId); } if (!(filter.MultiStatusKBN == null || filter.MultiStatusKBN.Equals(""))) { hashTable.Add("@StatusKBN", filter.MultiStatusKBN); } if (filter.EntryTimeStart != DateTime.MinValue) { hashTable.Add("@EntryTimeStart", filter.EntryTimeStart); } if (filter.EntryTimeEnd != DateTime.MinValue) { hashTable.Add("@EntryTimeEnd", filter.EntryTimeEnd); } if (filter.LeaveTimeStart != DateTime.MinValue) { hashTable.Add("@LeaveTimeStart", filter.LeaveTimeStart); } if (filter.LeaveTimeEnd != DateTime.MinValue) { hashTable.Add("@LeaveTimeEnd", filter.LeaveTimeEnd); } return hashTable; }
public PayrollItem searchPayrollItemById(string itemId) { string sqlStr = dbUtil.getSqlStatement("SQL_Payroll_PayrollItem_SearchById"); SqlParameter[] sqlParms = { new SqlParameter("@ItemId",SqlDbType.VarChar,20) }; sqlParms[0].Value = itemId; try { DataSet resultSet = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); UtilService utilService = new UtilService(); if (!utilService.isNullDataset(resultSet)) { PayrollItem item = new PayrollItem(); item.ItemId = resultSet.Tables[0].Rows[0]["ItemId"].ToString(); item.ItemName = resultSet.Tables[0].Rows[0]["ItemName"].ToString(); item.SystemItem = Convert.ToBoolean(resultSet.Tables[0].Rows[0]["SystemItem"]); item.Unit = Convert.ToInt32(resultSet.Tables[0].Rows[0]["Unit"]); item.WageBonus = Convert.ToInt32(resultSet.Tables[0].Rows[0]["WageBonus"]); item.Group = Convert.ToInt32(resultSet.Tables[0].Rows[0]["ItemGroup"]); item.CalcMethod = Convert.ToInt32(resultSet.Tables[0].Rows[0]["CalcMethod"]); item.Minus = Convert.ToBoolean(resultSet.Tables[0].Rows[0]["Minus"]); item.Fomula = resultSet.Tables[0].Rows[0]["Fomula"].ToString(); return item; } return null; } catch (Exception ex) { throw new DAOException("E0001", ex); } }
private void TaxTable_Invalidating(object sender, DataGridViewCellValidatingEventArgs e) { if (e.ColumnIndex >= 1 && e.ColumnIndex <= 4) { UtilService util = new UtilService(); if (!util.isNumber(e.FormattedValue.ToString())) { (sender as DataGridView).CancelEdit(); } } }
public List<Customer> searchCusByMultiFilter(Hashtable hashTable) { List<Customer> cusList = new List<Customer>(); string sqlStr = dbUtil.getSqlStatement("SQL_Cus_SearchByMultiFilter"); ArrayList listParms = new ArrayList(); UtilService utilService = new UtilService(); if (hashTable.Contains("@CusID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@CusID"); listParms.Add(new SqlParameter("@CusID", SqlDbType.VarChar, 20)); } if (hashTable.Contains("@CusName")) { sqlStr = utilService.validSearchFilter(sqlStr, "@CusName"); listParms.Add(new SqlParameter("@CusName", SqlDbType.NVarChar, 100)); } if (hashTable.Contains("@CusCompName")) { sqlStr = utilService.validSearchFilter(sqlStr, "@CusCompName"); listParms.Add(new SqlParameter("@CusCompName", SqlDbType.NVarChar, 100)); } if (hashTable.Contains("@TelNum")) { sqlStr = utilService.validSearchFilter(sqlStr, "@TelNum"); listParms.Add(new SqlParameter("@TelNum", SqlDbType.VarChar, 20)); } if (hashTable.Contains("@CusTypeID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@CusTypeID"); listParms.Add(new SqlParameter("@CusTypeID", SqlDbType.VarChar, 20)); } SqlParameter[] sqlParms = (SqlParameter[])listParms.ToArray(typeof(SqlParameter)); foreach (SqlParameter parm in sqlParms) { parm.Value = hashTable[parm.ParameterName]; } DataSet searchResult = null; try { searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); foreach (DataTable dt in searchResult.Tables) { foreach (DataRow dr in dt.Rows) { Customer cus = new Customer(); cus.CustomId = dr["CusID"].ToString(); cus.Name = dr["CusName"].ToString(); cus.CompanyName = dr["CusCompName"].ToString(); cus.CusTypeId = dr["CusTypeID"].ToString(); cus.TelNum1 = dr["Tel1"].ToString(); cus.TelNum2 = dr["Tel2"].ToString(); cus.ZipCode = dr["ZipCode"].ToString(); cus.Address = dr["CusAddress"].ToString(); cus.RebateTypeId = dr["RebateTypeID"].ToString(); cusList.Add(cus); } } } catch (Exception ex) { throw; } return cusList; }
public CommodityPrice SearchComdPriceBySaleEmpID(string strComdID, string strSaleEmpID) { CommodityPrice commodityPrice = new CommodityPrice(); string sqlStr = dbUtil.getSqlStatement("SQL_Comd_Price_SearchBySaleEmpID"); SqlParameter[] sqlParms = { new SqlParameter("@ComdID",SqlDbType.VarChar,20), new SqlParameter("@EmpID",SqlDbType.VarChar,20) }; sqlParms[0].Value = strComdID; sqlParms[1].Value = strSaleEmpID; DataSet searchResult = null; try { searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); UtilService utilService = new UtilService(); if (!utilService.isNullDataset(searchResult)) { commodityPrice.ComdID = searchResult.Tables[0].Rows[0]["ComdID"].ToString(); commodityPrice.PriceTypeID = searchResult.Tables[0].Rows[0]["PriceTypeID"].ToString(); commodityPrice.PriceTypeName = searchResult.Tables[0].Rows[0]["PriceTypeName"].ToString(); commodityPrice.Price = Convert.ToSingle(searchResult.Tables[0].Rows[0]["Price"]); commodityPrice.PriceType_KBN = Convert.ToInt32(searchResult.Tables[0].Rows[0]["PriceTypeKBN"]); } } catch (Exception ex) { throw new DAOException("E0001"); } return commodityPrice; }
public Commodity searchComdByComdID(string strComdID) { Commodity comd = new Commodity(); string sqlStr = dbUtil.getSqlStatement("SQL_Comd_SearchByComdID"); SqlParameter[] sqlParms = { new SqlParameter("@ComdID",SqlDbType.VarChar,20) }; sqlParms[0].Value = strComdID; DataSet searchResult = null; try { searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); UtilService utilService = new UtilService(); if (!utilService.isNullDataset(searchResult)) { comd.ComdID = searchResult.Tables[0].Rows[0]["ComdID"].ToString(); comd.ComdName = searchResult.Tables[0].Rows[0]["ComdName"].ToString(); comd.ComdStandard = searchResult.Tables[0].Rows[0]["ComdStandard"].ToString(); comd.Unit = searchResult.Tables[0].Rows[0]["Unit"].ToString(); comd.Description = searchResult.Tables[0].Rows[0]["Description"].ToString(); comd.Manufacturer = searchResult.Tables[0].Rows[0]["Manufacturer"].ToString(); comd.DeleteFLG = (bool)searchResult.Tables[0].Rows[0]["DeleteFLG"]; } } catch (Exception ex) { throw new DAOException("E0001"); } return comd; }
public List<SaleParent> SearchSaleParentByMultiFilter(Hashtable hashTable) { List<SaleParent> saleParentList = new List<SaleParent>(); string sqlStr = dbUtil.getSqlStatement("SQL_Comd_SaleParent_SearchByMultiFilter"); ArrayList listParms = new ArrayList(); UtilService utilService = new UtilService(); if (hashTable.Contains("@SaleOrderID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@SaleOrderID"); listParms.Add(new SqlParameter("@SaleOrderID", SqlDbType.NVarChar, 40)); } if (hashTable.Contains("@CustomerID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@CustomerID"); listParms.Add(new SqlParameter("@CustomerID", SqlDbType.VarChar, 20)); } if (hashTable.Contains("@CustomerName")) { sqlStr = utilService.validSearchFilter(sqlStr, "@CustomerName"); listParms.Add(new SqlParameter("@CustomerName", SqlDbType.NVarChar, 100)); } if (hashTable.Contains("@SaleEmpID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@SaleEmpID"); listParms.Add(new SqlParameter("@SaleEmpID", SqlDbType.VarChar, 20)); } if (hashTable.Contains("@SaleEmpName")) { sqlStr = utilService.validSearchFilter(sqlStr, "@SaleEmpName"); listParms.Add(new SqlParameter("@SaleEmpName", SqlDbType.NVarChar, 40)); } if (hashTable.Contains("@ComdID")) { sqlStr = utilService.validSearchFilter(sqlStr, "@ComdID"); listParms.Add(new SqlParameter("@ComdID", SqlDbType.VarChar, 20)); } if (hashTable.Contains("@ComdName")) { sqlStr = utilService.validSearchFilter(sqlStr, "@ComdName"); listParms.Add(new SqlParameter("@ComdName", SqlDbType.NVarChar, 100)); } if (hashTable.Contains("@SaleDateStart")) { sqlStr = utilService.validSearchFilter(sqlStr, "@SaleDateStart"); listParms.Add(new SqlParameter("@SaleDateStart", SqlDbType.VarChar, 10)); } if (hashTable.Contains("@SaleDateEnd")) { sqlStr = utilService.validSearchFilter(sqlStr, "@SaleDateEnd"); listParms.Add(new SqlParameter("@SaleDateEnd", SqlDbType.VarChar, 10)); } if (hashTable.Contains("@StatusKBN")) { sqlStr = utilService.validSearchFilter(sqlStr, "@StatusKBN"); listParms.Add(new SqlParameter("@StatusKBN", SqlDbType.Int)); } if (hashTable.Contains("@DeliveryFLG")) { sqlStr = utilService.validSearchFilter(sqlStr, "@DeliveryFLG"); listParms.Add(new SqlParameter("@DeliveryFLG", SqlDbType.Bit)); } if (hashTable.Contains("@PaymentFLG")) { sqlStr = utilService.validSearchFilter(sqlStr, "@PaymentFLG"); listParms.Add(new SqlParameter("@PaymentFLG", SqlDbType.Bit)); } SqlParameter[] sqlParms = (SqlParameter[])listParms.ToArray(typeof(SqlParameter)); foreach (SqlParameter parm in sqlParms) { parm.Value = hashTable[parm.ParameterName]; } DataSet searchResult = null; try { searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); foreach (DataTable dt in searchResult.Tables) { foreach (DataRow dr in dt.Rows) { SaleParent saleParent = new SaleParent(); saleParent.OrderId = dr["SaleOrderID"].ToString(); saleParent.CustomerID = dr["CustomerID"].ToString(); saleParent.CustomerName = dr["CustomerName"].ToString(); saleParent.SaleEmpID = dr["SaleEmpID"].ToString(); saleParent.SaleEmpName = dr["SaleEmpName"].ToString(); if (dr["SaleDate"].ToString() == string.Empty) { saleParent.SaleDate = DateTime.MinValue; } else { saleParent.SaleDate = DateTime.Parse(dr["SaleDate"].ToString()); } saleParent.StatusKBN = (int)dr["StatusKBN"]; saleParent.DeliveryFLG = (bool)dr["DeliveryFLG"]; saleParent.PaymentFLG = (bool)dr["PaymentFLG"]; saleParent.Remark = dr["Remark"].ToString(); saleParent.ReceivingAddress = dr["ReceivingAddress"].ToString(); saleParentList.Add(saleParent); } } } catch (Exception ex) { throw; } return saleParentList; }
public PurchaseParent SearchPurchaseParentByOrderID(string strPurchaseOrderID) { PurchaseParent purchaseParent = new PurchaseParent(); string sqlStr = dbUtil.getSqlStatement("SQL_Comd_PurchaseParent_SearchByOrderID"); SqlParameter[] sqlParms = { new SqlParameter("@PurchaseOrderID",SqlDbType.VarChar,20) }; sqlParms[0].Value = strPurchaseOrderID; DataSet searchResult = null; try { searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); UtilService utilService = new UtilService(); if (!utilService.isNullDataset(searchResult)) { purchaseParent.OrderId = searchResult.Tables[0].Rows[0]["PurchaseOrderID"].ToString(); purchaseParent.Supplier = searchResult.Tables[0].Rows[0]["SupplierID"].ToString(); purchaseParent.PurchaseEmpId = searchResult.Tables[0].Rows[0]["PurchaseEmpID"].ToString(); purchaseParent.PurEmpName = searchResult.Tables[0].Rows[0]["PurchaseEmpName"].ToString(); if (searchResult.Tables[0].Rows[0]["PurchaseDate"].ToString() == string.Empty) { purchaseParent.PurchaseDate = DateTime.MinValue; } else { purchaseParent.PurchaseDate = DateTime.Parse(searchResult.Tables[0].Rows[0]["PurchaseDate"].ToString()); } purchaseParent.StatusKBN = (int)searchResult.Tables[0].Rows[0]["StatusKBN"]; purchaseParent.ReceivingFLG = (bool)searchResult.Tables[0].Rows[0]["ReceivingFLG"]; purchaseParent.PaymentFLG = (bool)searchResult.Tables[0].Rows[0]["PaymentFLG"]; purchaseParent.Remark = searchResult.Tables[0].Rows[0]["Remark"].ToString(); } } catch (Exception ex) { throw new DAOException("E0001"); } return purchaseParent; }
/// <summary> /// ���ҷ���ID�IJ��š� /// ���Ҳ���������null. /// </summary> /// <param name="deptId"></param> /// <returns></returns> public Department searchDeptByDeptID(string deptId) { string sqlStr = dbUtil.getSqlStatement("SQL_Dept_SearchByDeptID"); SqlParameter[] sqlParms = { new SqlParameter("@DeptID",SqlDbType.VarChar,20) }; sqlParms[0].Value = deptId; DataSet searchResult = null; try { searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); UtilService utilService = new UtilService(); if (utilService.isNullDataset(searchResult)) { return null; } Department dept = new Department(); DataRowToDept(searchResult.Tables[0].Rows[0], dept); return dept; } catch (Exception ex) { throw new DAOException("E0001", ex); } }
public Company getCompany() { string sqlStr = dbUtil.getSqlStatement("SQL_COMP_GetCompany"); DataSet resultSet = null; try { Company comp = new Company(); resultSet = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, null); UtilService utilService = new UtilService(); if (!utilService.isNullDataset(resultSet)) { DataRow dr = resultSet.Tables[0].Rows[0]; comp.Name = dr["Name"].ToString(); comp.TelNum = dr["TelNum"].ToString(); comp.Legal = dr["Legal"].ToString(); comp.Address = dr["Addr"].ToString(); comp.ZipCode = dr["ZipCode"].ToString(); comp.IndowRate = Convert.ToDouble(dr["IndowRate"]); comp.Medicalrate = Convert.ToDouble(dr["Medicalrate"]); comp.UnEmpRate = Convert.ToDouble(dr["UnEmpRate"]); comp.EmpInjuryRate = Convert.ToDouble(dr["EmpInjuryRate"]); comp.HouseRate = Convert.ToDouble(dr["HouseRate"]); comp.TaxStart = Convert.ToDouble(dr["TaxStart"]); } return comp; } catch (Exception ex) { throw new DAOException("E0001", ex); } }
public EmpType searchEmpTypeByEmpTypeID(string strEmpTypeID) { string sqlStr = dbUtil.getSqlStatement("SQL_Emp_EmpType_SearchByEmpTypeID"); SqlParameter[] sqlParms = { new SqlParameter("@EmpTypeID",SqlDbType.VarChar,20) }; sqlParms[0].Value = strEmpTypeID; try { EmpType et = new EmpType(); DataSet searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); UtilService utilService = new UtilService(); if (!utilService.isNullDataset(searchResult)) { et.EmpTypeID = searchResult.Tables[0].Rows[0]["ID"].ToString(); et.Name = searchResult.Tables[0].Rows[0]["Name"].ToString(); et.Description = searchResult.Tables[0].Rows[0]["Description"].ToString(); } return et; } catch (Exception ex) { throw new DAOException("E0001", ex); } }
public Employee searchEmpByEmpId(string strEmpID) { string sqlStr = dbUtil.getSqlStatement("SQL_Emp_SearchByEmpId"); SqlParameter[] sqlParms = { new SqlParameter("@EmpID",SqlDbType.VarChar,20) }; sqlParms[0].Value = strEmpID; try { DataSet resultSet = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, sqlParms); UtilService utilService = new UtilService(); if (!utilService.isNullDataset(resultSet)) { Employee emp = new Employee(); DataRowToEmployee(resultSet.Tables[0].Rows[0], emp); return emp; } return null; } catch (Exception ex) { throw new DAOException("E0001", ex); } }
public List<SaleParent> SOGetParentByMultiFilter(SOSearchTerm filter) { List<SaleParent> saleParentList; UtilService utilService = new UtilService(); Hashtable hashTable = new Hashtable(); //orderid if (!(filter.OrderId == null || filter.OrderId.Equals(""))) { hashTable.Add("@SaleOrderID", filter.OrderId); } //customer if (!(filter.CustomerID == null || filter.CustomerID.Equals(""))) { hashTable.Add("@CustomerID", filter.CustomerID); } if (!(filter.CustomerName == null || filter.CustomerName.Equals(""))) { hashTable.Add("@CustomerName", utilService.buildWildSearchFilter(filter.CustomerName)); } //saleman if (!(filter.SaleEmpID == null || filter.SaleEmpID.Equals(""))) { hashTable.Add("@SaleEmpID", filter.SaleEmpID); } if (!(filter.SaleEmpName == null || filter.SaleEmpName.Equals(""))) { hashTable.Add("@SaleEmpName", utilService.buildWildSearchFilter(filter.SaleEmpName)); } //commodity if (!(filter.ComdID == null || filter.ComdID.Equals(""))) { hashTable.Add("@ComdID", filter.ComdID); } if (!(filter.ComdName == null || filter.ComdName.Equals(""))) { hashTable.Add("@ComdName", utilService.buildWildSearchFilter(filter.ComdName)); } //SaleDate if (filter.SaleDateStart != DateTime.MinValue) { hashTable.Add("@SaleDateStart", filter.SaleDateStart.ToString("yyyy-MM-dd")); } if (filter.SaleDateEnd != DateTime.MinValue) { hashTable.Add("@SaleDateEnd", filter.SaleDateEnd.ToString("yyyy-MM-dd")); } //KBN AND FLG if (filter.StatusKBN >= 0) { hashTable.Add("@StatusKBN", filter.StatusKBN); } if (filter.DeliveryFLG == 0) { hashTable.Add("@DeliveryFLG", false); } else if (filter.DeliveryFLG == 1) { hashTable.Add("@DeliveryFLG", true); } if (filter.PaymentFLG == 0) { hashTable.Add("@PaymentFLG", false); } else if (filter.PaymentFLG == 1) { hashTable.Add("@PaymentFLG", true); } try { saleParentList = comdDAO.SearchSaleParentByMultiFilter(hashTable); } catch (Exception ex) { throw; } return saleParentList; }
public List<PurchaseParent> POGetParentByMultiFilter(POSearchTerm filter) { List<PurchaseParent> purchaseParentList; UtilService utilService = new UtilService(); Hashtable hashTable = new Hashtable(); if (!(filter.Supplier == null || filter.Supplier.Equals(""))) { hashTable.Add("@SupplierID", utilService.buildWildSearchFilter(filter.Supplier)); } if (!(filter.PurchaseEmpName == null || filter.PurchaseEmpName.Equals(""))) { hashTable.Add("@EmpName", utilService.buildWildSearchFilter(filter.PurchaseEmpName)); } if (filter.PurchaseDateStart != DateTime.MinValue) { hashTable.Add("@PurchaseDateStart", filter.PurchaseDateStart.ToString("yyyy-MM-dd")); } if (filter.PurchaseDateEnd != DateTime.MinValue) { hashTable.Add("@PurchaseDateEnd", filter.PurchaseDateEnd.ToString("yyyy-MM-dd")); } if (!(filter.ComdName == null || filter.ComdName.Equals(""))) { hashTable.Add("@ComdName", utilService.buildWildSearchFilter(filter.ComdName)); } if (!(filter.ComdID == null || filter.ComdID.Equals(""))) { hashTable.Add("@ComdID", filter.ComdID); } if (filter.StatusKBN >= 0) { hashTable.Add("@StatusKBN", filter.StatusKBN); } if (filter.ReceivingFLG == 0) { hashTable.Add("@ReceivingFLG", false); } else if (filter.ReceivingFLG == 1) { hashTable.Add("@ReceivingFLG", true); } if (filter.PaymentFLG == 0) { hashTable.Add("@PaymentFLG", false); } else if (filter.PaymentFLG == 1) { hashTable.Add("@PaymentFLG", true); } try { purchaseParentList = comdDAO.SearchPurchaseParentByMultiFilter(hashTable); } catch (Exception ex) { throw; } return purchaseParentList; }