private void BindRegions() { DataTable dtRegion = PFCDBHelper.ExecuteERPSelectQuery("Select distinct LocSalesGrp From LocMaster (NOLOCK) where isnull(LocSalesGrp,'') <> ''"); if (dtRegion != null && dtRegion.Rows.Count > 0) { _ddlBind.ddlBindControl(ddlRegion, dtRegion, "LocSalesGrp", "LocSalesGrp", "ALL", "ALL"); BindSalesPerson(); } }
public void BindSalesPerson() { try { string _region = (ddlRegion.SelectedValue.ToUpper() == "ALL" ? "LocSalesGrp" : "'" + ddlRegion.SelectedValue + "'"); string _erpQuery = "Select distinct RepNo,RepName " + "from RepMaster (NOLOCK) " + "Where (RepStatus='A' OR RepStatus='N' OR RepStatus='P') " + "AND (RepClass='I') AND SalesOrgNo in (Select LocId From LocMaster (NOLOCK) Where LocSalesGrp=" + _region + ") Order By RepName "; DataTable dtSalesRep = PFCDBHelper.ExecuteERPSelectQuery(_erpQuery); _ddlBind.ddlBindControl(ddlSalesPerson, dtSalesRep, "RepNo", "RepName", "ALL", "ALL"); } catch (Exception ex) { } }
public string[] GetGTIItemDesc(string itemNo, string binLabel) { string[] _itemInfo = new string[20]; _itemInfo[0] = "add"; _itemInfo[1] = ""; // First Check if the item is already exist in the table // if item not exist in the HTI table then try to find the Description string isExistCmd = "Select pHTIBranchItemDetailID" + " ,ItemDesc " + " ,Cast(Quantity as decimal(18,0)) as Quantity" + " ,Cast(PiecesPerQuantity as decimal(18,0)) as PiecesPerQuantity" + " ,PackagedForLabel " + "From HTIBranchItemDetail " + "Where ItemNo ='" + itemNo + "'" + " and BinLabel='" + binLabel + "'" + " and Location='" + Session["BranchID"].ToString() + "'"; DataTable dsExistingRecord = PFCDBHelper.ExecuteERPSelectQuery(isExistCmd); if (dsExistingRecord != null && dsExistingRecord.Rows.Count > 0) { _itemInfo[0] = "update"; // Mode _itemInfo[1] = dsExistingRecord.Rows[0]["ItemDesc"].ToString(); _itemInfo[2] = dsExistingRecord.Rows[0]["Quantity"].ToString(); _itemInfo[3] = dsExistingRecord.Rows[0]["PiecesPerQuantity"].ToString(); _itemInfo[4] = dsExistingRecord.Rows[0]["PackagedForLabel"].ToString(); _itemInfo[5] = dsExistingRecord.Rows[0]["pHTIBranchItemDetailID"].ToString(); } else { string getDescCmd = "Select AliasDesc " + "From ItemAlias (NOLOCK)"+ "Where AliasWhseNo='HTI'"+ " And OrganizationNo='000000'" + " And AliasItemNo='" + itemNo + "'"; DataTable dtResult = PFCDBHelper.ExecuteERPSelectQuery(getDescCmd); if (dtResult != null && dtResult.Rows.Count > 0) { _itemInfo[1] = dtResult.Rows[0]["AliasDesc"].ToString(); } } return(_itemInfo); }