Пример #1
0
        //public static decimal get_exchangerate(string CurrencyFrom, string CurrencyTo)
        //{
        //    if (string.Equals(CurrencyFrom, CurrencyTo)) return 1;

        //    object rate = SqlProvider.dbExecuteScalar("MY", string.Format("select top 1 UKURS from SAP_EXCHANGERATE where fCURR='{0}' and TCURR='{1}' order by exch_date desc", CurrencyFrom, CurrencyTo));
        //    if (rate == null) return 1;
        //    decimal _rate = 1;
        //    decimal.TryParse(rate.ToString(), out _rate);
        //    return _rate;
        //}
        public static string getTimeZoneName(string ORG)
        {
            object timezone = SqlProvider.dbExecuteScalar("MY", string.Format("select top 1 isnull(timezonename,'') as timezonename from TIMEZONE where org like '%{0}'", ORG));

            if (timezone == null)
            {
                return(string.Empty);
            }
            return(timezone.ToString());
        }
Пример #2
0
        public static int GetSeqNo(String _parentguid)
        {
            String str = "DECLARE @Child hierarchyid " +
                         " SELECT @Child = HIE_ID FROM CBOM_CATALOG_V2 " +
                         " WHERE ID = '" + _parentguid + "'" +
                         " SELECT ISNULL(MAX(SEQ_NO),0) AS [SEQ_NO] " +
                         " FROM CBOM_CATALOG_V2 " +
                         " WHERE HIE_ID.GetAncestor(1) = @Child ";

            return(Convert.ToInt32(SqlProvider.dbExecuteScalar("CBOMV2", str)) + 1);
        }
Пример #3
0
        public static Boolean HasRepeatBrother(String _parentguid, String _categoryid)
        {
            String str = "DECLARE @Child hierarchyid " +
                         " SELECT @Child = HIE_ID FROM CBOM_CATALOG_V2 " +
                         " WHERE ID = '" + _parentguid + "' " +
                         " SELECT COUNT(*) FROM CBOM_CATALOG_V2 " +
                         " WHERE HIE_ID.GetAncestor(1) = @Child " +
                         " AND CATALOG_NAME = N'" + _categoryid + "'";
            int count = Convert.ToInt32(SqlProvider.dbExecuteScalar("CBOMV2", str));

            return((count > 0) ? true : false);
        }
Пример #4
0
 /// <summary>
 /// Get Siebel Sales Position by email
 /// </summary>
 /// <param name="emial"></param>
 /// <returns>POSITION</returns>
 public static object GetSiebelSalesPositionByEmail(string emial)
 {
     //return SqlProvider.dbExecuteScalar("MY", string.Format(" select top 1 POSITION from SIEBEL_SALES_HIERARCHY where EMAIL = '{0}' ", emial));
     //ICC 2015/11/11 SIEBEL_SALES_HIERARCHY data is not accurate, so change to SIEBEL_POSITION for instead.
     return(SqlProvider.dbExecuteScalar("MY", string.Format(" select top 1 PRIMARY_POSITION_NAME from SIEBEL_POSITION where EMAIL_ADDR = '{0}' order by CREATED desc", emial)));
 }