Example #1
0
        /// <summary>
        /// Description  : Get the Client information from CSS1
        /// Created By   : Sudheer  
        /// Created Date : 14th Oct 2014
        /// Modified By  : 
        /// Modified Date: 
        /// </summary>   
        public static _ChoosenBillingPartyInfo GetBillingPartyInformation(string ClientName, string WOID)
        {
            var GetClientInfo = new _ChoosenBillingPartyInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[2];
                sqlParams[0] = new SqlParameter("@WOID", WOID);
                sqlParams[1] = new SqlParameter("@ClientName", ClientName);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "GetAllBillingPartyDetails", sqlParams);
                var safe = new SafeDataReader(reader);

                while (reader.Read())
                {
                    var ClientInfo = new _ChoosenClient();
                    ClientInfo.FetchBillingPartyInfo(ClientInfo, safe);
                    GetClientInfo._ChoosenBillingPartyList.Add(ClientInfo);
                }

                return GetClientInfo;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return GetClientInfo;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Example #2
0
        private _ChoosenClient FetchClientInfo(_ChoosenClient getClientInfo, SafeDataReader dr)
        {
            getClientInfo.ClientCode = dr.GetString("ID");
            getClientInfo.ClientName = dr.GetString("Name");
            getClientInfo.SourceID = dr.GetString("SourceCode");
            getClientInfo.UniqueID = dr.GetInt32("UniqueID");

            return getClientInfo;
        }