public FedexShipServiceClient(CourierConfigBO credentials, decimal weight, string packagingType, AddressBO senderBO, AddressBO receiverBO, string path) { _credentials = credentials; _weight = weight; _packagingType = packagingType; _senderBO = senderBO; _receiverBO = receiverBO; _path = path; }
public CourierConfigBO getcourierdetail(int TenantID) { CourierConfigBO courierBO = new CourierConfigBO(); try { using (SqlConnection sqlCon = new SqlConnection(Constant.DBConnectionString)) { SqlCommand sqlCmd = new SqlCommand("Select * from stblCourierConfig where TenantID=@TenantID ", sqlCon); { sqlCmd.CommandType = CommandType.Text; sqlCmd.Parameters.Add(new SqlParameter("@TenantID", TenantID)); // sqlCmd.Parameters.Add(new SqlParameter("@CourierConfigID", CourierConfigID)); sqlCon.Open(); SqlDataReader reader = sqlCmd.ExecuteReader(); { if (reader.HasRows) { while (reader.Read()) { courierBO.CourierConfigID = reader["CourierConfigID"] == DBNull.Value ? 0 : Convert.ToInt32(reader["CourierConfigID"]); courierBO.TenantID = reader["TenantID"] == DBNull.Value ? 0 : Convert.ToInt32(reader["TenantID"]); courierBO.FedexMeterNo = reader["FedexMeterNo"] == DBNull.Value ? 0 : Convert.ToInt32(reader["FedexMeterNo"]); courierBO.FedexACNo = reader["FedexACNo"] == DBNull.Value ? 0 : Convert.ToInt32(reader["FedexACNo"]); courierBO.FedexParentKey = reader["FedexParentKey"] == DBNull.Value ? string.Empty : Convert.ToString(reader["FedexParentKey"]); courierBO.FedexParentPassword = reader["FedexParentPassword"] == DBNull.Value ? string.Empty : Convert.ToString(reader["FedexParentPassword"]); courierBO.FedexUserKey = reader["FedexUserKey"] == DBNull.Value ? string.Empty : Convert.ToString(reader["FedexUserKey"]); courierBO.FedexUserPassword = reader["FedexUserPassword"] == DBNull.Value ? string.Empty : Convert.ToString(reader["FedexUserPassword"]); courierBO.DefaultWeight = reader["DefaultWeight"] == DBNull.Value ? string.Empty : Convert.ToString(reader["DefaultWeight"]); courierBO.FedexUserPassword = reader["FedexUserPassword"] == DBNull.Value ? string.Empty : Convert.ToString(reader["FedexUserPassword"]); courierBO.SignatureOn = reader["SignatureOn"] == DBNull.Value ? false : Convert.ToBoolean(reader["SignatureOn"]); } } reader.Close(); // reader = null; sqlCon.Close(); } } } } catch (Exception ex) { _ErrMsg = ex.Message; throw; } return(courierBO); }
public int SaveCourierConfiguration(CourierConfigBO objCourier) { int returnvalue = 0; try { using (SqlConnection sqlCon = new SqlConnection(Constant.DBConnectionString)) { SqlCommand sqlCmd = new SqlCommand("sppCourierConfigur", sqlCon); { sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Parameters.Add(new SqlParameter("@CourierConfigID", objCourier.CourierConfigID)); sqlCmd.Parameters.Add(new SqlParameter("@FedexAcNo", objCourier.FedexACNo)); sqlCmd.Parameters.Add(new SqlParameter("@FedexMeterNo", objCourier.FedexMeterNo)); sqlCmd.Parameters.Add(new SqlParameter("@FedexUserKey", objCourier.FedexUserKey)); sqlCmd.Parameters.Add(new SqlParameter("@FedexUserPassword", objCourier.FedexUserPassword)); sqlCmd.Parameters.Add(new SqlParameter("@FedexParentKey", objCourier.FedexParentKey)); sqlCmd.Parameters.Add(new SqlParameter("@FedexParentPassword", objCourier.FedexParentPassword)); sqlCmd.Parameters.Add(new SqlParameter("@DefaultWeight", objCourier.DefaultWeight)); sqlCmd.Parameters.Add(new SqlParameter("@SignatureOn", objCourier.SignatureOn)); sqlCmd.Parameters.Add(new SqlParameter("@TenantID", objCourier.TenantID)); sqlCon.Open(); SqlDataReader reader = sqlCmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { returnvalue = (reader[0] == DBNull.Value ? 0 : Convert.ToInt32(reader[0])); } } reader.Close(); reader = null; sqlCon.Close(); } } } catch (Exception ex) { _ErrMsg = ex.Message; throw; } return(returnvalue); }
public FedexAddressValidationServiceClient(AddressBO addressBO, CourierConfigBO configBO) { _addressBO = addressBO; _configBO = configBO; }